-
Notifications
You must be signed in to change notification settings - Fork 231
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: Handle 0 safeTxGas when passed to createTransaction call #309
Conversation
CLA Assistant Lite All Contributors have signed the CLA. |
@@ -147,7 +147,7 @@ describe('Transactions creation', () => { | |||
safeAddress: safe.address, | |||
contractNetworks | |||
}) | |||
const safeTxGas = 111 | |||
const safeTxGas = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change? For this test it should be irrelevant if it's 0 or 111 ("should return a transaction with defined safeTxGas if safeVersion<1.3.0")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I get it but i'd a add a separate test for handling falsy values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I was thinking its the edge value that caused the issue so rather have a test for it but I will add another.
9a96005
to
3bf0f55
Compare
wait for a review from @germartinez cos he's the code owner :) |
What it solves
Resolves #1343
If a transaction is created with 0 safeTxGas in the web-core UI and another owner tries to sign it, the
createTransaction
call from the SDK will return a non 0 safeTxGas which causes issues with the existing txData (such as gasLimit estimation failing).How this PR fixes it
Narrow the condition to check for
undefined
so that asafeTxGas
of 0 is caught by it.