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

fix: Handle 0 safeTxGas when passed to createTransaction call #309

Merged
merged 2 commits into from
Dec 14, 2022

Conversation

usame-algan
Copy link
Member

@usame-algan usame-algan commented Dec 11, 2022

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 a safeTxGas of 0 is caught by it.

@github-actions
Copy link

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
Copy link
Member

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")

Copy link
Member

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

Copy link
Member Author

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.

@mmv08
Copy link
Member

mmv08 commented Dec 12, 2022

wait for a review from @germartinez cos he's the code owner :)

@germartinez germartinez changed the base branch from main to development December 14, 2022 11:44
@germartinez germartinez merged commit 920dfeb into development Dec 14, 2022
@germartinez germartinez deleted the fix-safetxgas branch December 14, 2022 11:45
@github-actions github-actions bot locked and limited conversation to collaborators Dec 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Transaction execution failed in several 1.1.1 Safes on the new UI
3 participants