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

Set safeTxGas=0 when safeVersion>=1.3.0 #121

Merged
merged 6 commits into from
Dec 10, 2021
Merged

Conversation

germartinez
Copy link
Member

What it solves

Resolves #100

@github-actions
Copy link

github-actions bot commented Dec 3, 2021

CLA Assistant Lite All Contributors have signed the CLA.

))
let safeTxGas: number
const safeVersion = await safeContract.getVersion()
if (semverSatisfies(safeVersion, '>=1.3.0')) {
Copy link
Member

@katspaugh katspaugh Dec 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe put '>=1.3.0' in some sort of config, similar to safe-react?
Or at least a constant.

Copy link
Member

@iamacook iamacook left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! I just have a couple of suggestions

))
let safeTxGas: number
const safeVersion = await safeContract.getVersion()
if (semverSatisfies(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.

Maybe it makes sense to create a lookup for the versions?


it('proposeTransaction', async () => {
const safeTxData: SafeTransactionDataPartial = {
to: '0xa33d2495760462018275994d85117600bd58221e',
data: '0x',
value: '123456789',
operation: 1,
safeTxGas: 123,
safeTxGas: 0,
baseGas: 0,
gasPrice: 0,
gasToken: '0x0000000000000000000000000000000000000000',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you use the a ZERO_ADDRESS often? Might be worthwhile creating a constant for it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is only used twice in this test file

Copy link
Member

@DiogoSoaress DiogoSoaress left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would just address the suggestion of using some kind of lookup for the safe version

Copy link
Member

@iamacook iamacook left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@germartinez germartinez merged commit 1a39ce2 into development Dec 10, 2021
@germartinez germartinez deleted the safeTxGas-0 branch December 10, 2021 08:02
@github-actions github-actions bot locked and limited conversation to collaborators Dec 10, 2021
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.

4 participants