-
Notifications
You must be signed in to change notification settings - Fork 203
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
test: Add CCTP synpress config #1861
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
params: Parameters<typeof cy.confirmMetamaskPermissionToSpend>[0] | ||
) { | ||
cy.confirmMetamaskPermissionToSpend(params) | ||
cy.confirmMetamaskPermissionToSpend(params) |
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 is this being called twice? typo? 🤔
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 wish, but no, it's actually the reasonning behind this command
cy.confirmSpending({ spendLimit: '1' }) | ||
cy.wait(10_000) | ||
cy.confirmMetamaskTransaction(undefined) |
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 is this changed and changed to a different way from the cctp approval?
if (!process.env.PRIVATE_KEY_CCTP) { | ||
throw new Error('PRIVATE_KEY_CCTP variable missing.') | ||
} |
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.
this is checked twice, see L42-44
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.
they are different keys, but the checks should be grouped together.
sourceWallet: Wallet | ||
amount?: BigNumber | ||
}) { | ||
console.log(`Funding ETH to user wallet ${address}...`) |
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.
Needs networkType
in this function. We should add it again.
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 would probably move the log outside then, it feels weird to pass a parameter only to log it
sourceWallet: Wallet | ||
networkType: NetworkType | ||
}) { | ||
console.log('Funding USDC to user wallet...') |
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.
Needs networkType
in log
cy.confirmMetamaskPermissionToSpend('1') | ||
cy.confirmSpending('5') | ||
cy.wait(10_000) | ||
cy.rejectMetamaskTransaction() |
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 do we want to reject the transaction? We can assert by confirming the next metamask transaction too, right? That way we wouldn't need to wait and it'd be cleaner too!
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.
We need to wait whether we reject or confirm
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 understand the wait, but why are we rejecting the tx +1?
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.
Rejecting is more likely to succeed than confirming. I don't mind accepting it though
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.
based on our slack discussion, this is a hack that works best among all hacky options (checking for a UI element / try to confirm on the popup again / try to reject on the popup)
can we also add a comment here for our future selves and other teammates?
if (!process.env.PRIVATE_KEY_CCTP) { | ||
throw new Error('PRIVATE_KEY_CCTP variable missing.') | ||
} |
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.
they are different keys, but the checks should be grouped together.
Summary
Steps to test