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

gas counter in test sums deploy cost to first transaction #2219

Open
3esmit opened this issue Jan 26, 2020 · 3 comments
Open

gas counter in test sums deploy cost to first transaction #2219

3esmit opened this issue Jan 26, 2020 · 3 comments

Comments

@3esmit
Copy link
Contributor

3esmit commented Jan 26, 2020

The gas is counted incorrect in the first time .send() is invoked, because it also sums the cost of deploy the transaction.

I had to do a workaround (see status-im/account-contracts@291fd9b#diff-8ae90872f0505462a211bc1fa2f5f03eR28 ) to show proper gas, which is a transaction to anywhere before doing the other transactions I want to test.

@jrainville
Copy link
Collaborator

Just to be sure, you mean the gas counted in the little parenthesizes next to the test name?
eg: verifyMultiProof > deploy cost (12345 Wei Gas)

So 12345 is wrong because it adds the cost of deploying the contracts?

@3esmit
Copy link
Contributor Author

3esmit commented Jan 27, 2020

Yes! Exactly. So I am developing something and I got scared that I screw it up because it was too expansive! So I was refactoring until figure out that the problem was with the gas counter, not with my logic.

I would expect that this counter only shows the gas cost into the transactions that occurred within, not what happened before (such as deploying through Embark config):
https://github.com/status-im/account-contracts/blob/40d0d6c8f745299b7ea569cd9f64384d59ac570b/test/multimerkleproof.spec.js#L7-L10

This cost is added to the first case of the tests.

@jrainville
Copy link
Collaborator

Yeah you are totally right, it's a mistake on our part.

We'll fix it soon:tm:

Thanks for reporting it!

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