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

globally installed helpeth interprets hex as number #9

Open
kumavis opened this issue Jul 28, 2016 · 3 comments
Open

globally installed helpeth interprets hex as number #9

kumavis opened this issue Jul 28, 2016 · 3 comments

Comments

@kumavis
Copy link
Member

kumavis commented Jul 28, 2016

╭─kumavis@xyzs-MBP  ~/dev/udapp ‹node-v4.2.3›  (master*) 
╰─$ helpeth parseTx 0xf86c018504a817c80082520894e0defb92145fef3c3a945637705fafd3aa74a241880de0b6b3a7640000001ba01893f2731799dc436da31e092f75bece7bfbdb4942b60b106d61ec06f143aed2a075548818010ccd7fd3e3dd6172f072d4dec19c8956c735bdd34b4aea809ff6be
/Users/kumavis/.nvm/versions/node/v4.2.3/lib/node_modules/helpeth/node_modules/ethereumjs-util/index.js:698
      throw new Error('invalid data')
      ^

Error: invalid data
    at Object.exports.defineProperties (/Users/kumavis/.nvm/versions/node/v4.2.3/lib/node_modules/helpeth/node_modules/ethereumjs-util/index.js:698:13)
    at FakeTransaction.module.exports (/Users/kumavis/.nvm/versions/node/v4.2.3/lib/node_modules/helpeth/node_modules/ethereumjs-tx/index.js:92:11)
    at new FakeTransaction (/Users/kumavis/.nvm/versions/node/v4.2.3/lib/node_modules/helpeth/node_modules/ethereumjs-tx/fake.js:40:26)
    at Object.<anonymous> (/Users/kumavis/.nvm/versions/node/v4.2.3/lib/node_modules/helpeth/helpeth:333:14)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Function.Module.runMain (module.js:467:10)
    at startup (node.js:136:18)
@kumavis
Copy link
Member Author

kumavis commented Jul 28, 2016

works when i clone the repo - seems to be a problem when I install globally

╭─kumavis@xyzs-MBP  ~/dev/helpeth ‹node-v4.2.3›  (master) 
╰─$ ./helpeth parseTx 0xf86c018504a817c80082520894e0defb92145fef3c3a945637705fafd3aa74a241880de0b6b3a7640000001ba01893f2731799dc436da31e092f75bece7bfbdb4942b60b106d61ec06f143aed2a075548818010ccd7fd3e3dd6172f072d4dec19c8956c735bdd34b4aea809ff6be
argv.tx: 0xf86c018504a817c80082520894e0defb92145fef3c3a945637705fafd3aa74a241880de0b6b3a7640000001ba01893f2731799dc436da31e092f75bece7bfbdb4942b60b106d61ec06f143aed2a075548818010ccd7fd3e3dd6172f072d4dec19c8956c735bdd34b4aea809ff6be
Signed by: 0x15f2f3e0f2d74ea7b185fc12f24cb4f402cc96d0
Nonce: 0x01
To: 0xe0defb92145fef3c3a945637705fafd3aa74a241
Value: 1000000000000000000 (1 ETH)
Data: 0x00
Gas limit: 21000
Gas price: 20000000000 (20 Gwei)
Potential total transaction cost: 0.00042 ETH
Minimum required account balance: 1.00042 ETH
╭─kumavis@xyzs-MBP  ~/dev/helpeth ‹node-v4.2.3›  (master*) 
╰─$ helpeth parseTx 0xf86c018504a817c80082520894e0defb92145fef3c3a945637705fafd3aa74a241880de0b6b3a7640000001ba01893f2731799dc436da31e092f75bece7bfbdb4942b60b106d61ec06f143aed2a075548818010ccd7fd3e3dd6172f072d4dec19c8956c735bdd34b4aea809ff6be 
Signed by: 0x15f2f3e0f2d74ea7b185fc12f24cb4f402cc96d0
Nonce: 0x01
To: 0xe0defb92145fef3c3a945637705fafd3aa74a241
Value: 1000000000000000000 (1 ETH)
Data: 0x00
Gas limit: 21000
Gas price: 20000000000 (20 Gwei)
Potential total transaction cost: 0.00042 ETH
Minimum required account balance: 1.00042 ETH

@kumavis
Copy link
Member Author

kumavis commented Jul 28, 2016

seems to be parsing the arg as a number, but only when I globally install... weird

╭─kumavis@xyzs-MacBook-Pro  ~/dev/metamask-landing ‹node-v4.2.3›  (master) 
╰─$ helpeth parseTx 0xf86c018504a817c80082520894e0defb92145fef3c3a945637705fafd3aa74a241880de0b6b3a7640000001ba01893f2731799dc436da31e092f75bece7bfbdb4942b60b106d61ec06f143aed2a075548818010ccd7fd3e3dd6172f072d4dec19c8956c735bdd34b4aea809ff6be 
argv.tx: 7.822509421508722e+264
/Users/kumavis/.nvm/versions/node/v4.2.3/lib/node_modules/helpeth/node_modules/ethereumjs-util/index.js:698
      throw new Error('invalid data')
      ^

Error: invalid data
    at Object.exports.defineProperties (/Users/kumavis/.nvm/versions/node/v4.2.3/lib/node_modules/helpeth/node_modules/ethereumjs-util/index.js:698:13)
    at FakeTransaction.module.exports (/Users/kumavis/.nvm/versions/node/v4.2.3/lib/node_modules/helpeth/node_modules/ethereumjs-tx/index.js:92:11)
    at new FakeTransaction (/Users/kumavis/.nvm/versions/node/v4.2.3/lib/node_modules/helpeth/node_modules/ethereumjs-tx/fake.js:40:26)
    at Object.<anonymous> (/Users/kumavis/.nvm/versions/node/v4.2.3/lib/node_modules/helpeth/helpeth:334:14)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Function.Module.runMain (module.js:467:10)
    at startup (node.js:136:18)

@kumavis kumavis changed the title parseTx example doesnt work globally installed helpeth interprets hex as number Jul 28, 2016
@axic
Copy link
Member

axic commented Jul 28, 2016

This is probably caused by yargs weird way of disabling that processing: it is by adding that special field to package.json.

  "yargs": {
    "parse-numbers": false
   }

This is what they suggest in their official documentation, not sure how to do it in another way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants