-
Notifications
You must be signed in to change notification settings - Fork 92
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
fix: gas limit parameter for MetaMask #389
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/shapeshift/hdwallet/9HsThuFppYodyZh1oDu2ZAjpjsqW |
Please note I ran the test suite before any modification and after the fix, and the result is the following in both cases: Test Suites: 3 failed, 24 passed, 27 total
Tests: 20 failed, 302 passed, 322 total
Snapshots: 24 passed, 24 total
Time: 432.043 s |
Just fyi, there shouldn't be any failing tests -- something might be busted with your setup? |
I just did Documentation says:
I don't have a KeepKey (sorry ^^) and I don't know how startup an emulator. CI via Github have all checks passed, so I suppose this is the reason. |
Just noticed the ● argonBenchmark › argonBenchmark › should run correctly
TypeError: Cannot read property 'subtle' of undefined
13 | const realCrypto = require("crypto").webcrypto as Crypto;
14 | setCrypto({
> 15 | subtle: realCrypto.subtle,
| ^
16 | getRandomValues: await deterministicGetRandomValues(realCrypto),
17 | }); |
The problem was with my Test Suites: 27 passed, 27 total
Tests: 322 passed, 322 total
Snapshots: 52 passed, 52 total
Time: 25.198 s
Ran all test suites.
Done in 25.99s. |
That makes sense; hdwallet supports being used under older node versions but does require node 16 for tests. As far as the KK emulator goes, you can
to build/run it; I think the |
Fixed Metamask parameter for
gasLimit
.Metamask and other web3 libraries (i.e.
geth console
,web3.js
, etc.) usetransaction.gas
property for transaction's gas limit, instead of the canonicaltransaction.gasLimit
as mentioned in the yellow paper. This implies Metamask does not read any value for gas limit from the JSON object, and so it chooses one on its own. This behavior can lead to inconsistencies between clients and the wallet, for example when forecasting the transaction's cost (see shapeshift/web#526).