Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local signing fixed #2580

Merged
merged 17 commits into from
Mar 27, 2019
Merged

Local signing fixed #2580

merged 17 commits into from
Mar 27, 2019

Conversation

nivida
Copy link
Contributor

@nivida nivida commented Mar 26, 2019

Description

ethereumjs-tx signing implemented.

Fixes #1021 #1517 #1074 #1169 #2033 #1793 #1126 #1134 #2578 #2569

Type of change

  • Bug fix

Checklist:

  • I have selected the correct base branch.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no warnings.
  • I have updated or added types for all modules I've changed
  • Any dependent changes have been merged and published in downstream modules.
  • I ran npm run test in the root folder with success and extended the tests if necessary.
  • I ran npm run build in the root folder and tested it in the browser and with node.
  • I ran npm run dtslint in the root folder and tested that all my types are correct
  • I have tested my code on an ethereum test network.

@nivida nivida added Bug Addressing a bug In Progress Currently being worked on labels Mar 26, 2019
@nivida nivida removed the In Progress Currently being worked on label Mar 26, 2019
@coveralls
Copy link

coveralls commented Mar 26, 2019

Coverage Status

Coverage decreased (-0.002%) to 95.731% when pulling e49da4f on fix/send-signed-transaction into 1e31cc2 on 1.0.

Copy link

@wolovim wolovim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coming in with little context, so just some surface-level feedback and clarifying questions:

  1. ethereumjs-tx tidies up the TransactionSigner nicely 👌
  2. Is ethereumjs-tx a full replacement for eth-lib? I've wondered if eth-lib is "actively" maintained (last commit 1 yr ago).
  3. Haven't looked into how you're packaging the lib or what support promises web3.js has made; just making sure this line in the ethereumjs-tx README is on your radar:

Note: this package expects ECMAScript 6 (ES6) as a minimum environment. From browsers lacking ES6 support, please use a shim (like es6-shim) before including any of the builds from this repo.

@@ -153,7 +169,7 @@ export default class EthSendTransactionMethod extends SendTransactionMethod {
* @returns {Boolean}
*/
hasAccounts() {
return this.moduleInstance.accounts && this.moduleInstance.accounts.accountsIndex > 0;
return this.moduleInstance.accounts && this.moduleInstance.accounts.wallet.accountsIndex > 0;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any opportunity for wallet to return undefined and break here?

@@ -20,7 +20,7 @@
import scryptsy from 'scrypt.js';
import isString from 'lodash/isString';
import isObject from 'lodash/isObject';
import {fromPrivate, create, sign, decodeSignature} from 'eth-lib/lib/account'; // TODO: Remove this dependency
import * as EthLibAccount from 'eth-lib/lib/account'; // TODO: Remove this dependency
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌 namespacing. Is this functionality redundant with ethereumjs-tx?

Copy link
Contributor Author

@nivida nivida Mar 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an ethereumjs package I could use to replace the eth-lib here too. But I will do this later because other enhancements have a higher priority. Thanks for the hint. I'll write it down on my checklist.

@nivida
Copy link
Contributor Author

nivida commented Mar 27, 2019

The es6-shim isn't required because of the babel polyfill I'm including. Thanks for your review! @marcgarreau

@nivida nivida merged commit 6773c73 into 1.0 Mar 27, 2019
@nivida nivida deleted the fix/send-signed-transaction branch March 27, 2019 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Addressing a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

insufficient funds for gas * price + value
3 participants