Commit 115c6550 authored by Jordan Frankfurt's avatar Jordan Frankfurt Committed by GitHub

feat: mining mode switch to disable auto-mine (#6450)

* feat: mining mode switch to update so we can make assertions about pending transaction state

* update test to use explicit mining

* Update hardhat.config.js
Co-authored-by: default avatarZach Pomerantz <zzmp@uniswap.org>

---------
Co-authored-by: default avatarZach Pomerantz <zzmp@uniswap.org>
parent 3d8d29fd
...@@ -96,16 +96,19 @@ describe('Swap', () => { ...@@ -96,16 +96,19 @@ describe('Swap', () => {
cy.get('#swap-button').click() cy.get('#swap-button').click()
cy.get('#confirm-swap-or-send').click() cy.get('#confirm-swap-or-send').click()
cy.get(getTestSelector('dismiss-tx-confirmation')).click() cy.get(getTestSelector('dismiss-tx-confirmation')).click()
// ui check
cy.get('#swap-currency-output [data-testid="balance-text"]').should( cy.then(() => hardhat.send('hardhat_mine', ['0x1', '0xc'])).then(() => {
'have.text', // ui check
`Balance: ${initialBalance + BALANCE_INCREMENT}` cy.get('#swap-currency-output [data-testid="balance-text"]').should(
) 'have.text',
`Balance: ${initialBalance + BALANCE_INCREMENT}`
// chain state check )
cy.then(() => hardhat.utils.getBalance(hardhat.wallet.address, USDC_MAINNET))
.then((balance) => Number(balance.toFixed(1))) // chain state check
.should('eq', initialBalance + BALANCE_INCREMENT) cy.then(() => hardhat.utils.getBalance(hardhat.wallet.address, USDC_MAINNET))
.then((balance) => Number(balance.toFixed(1)))
.should('eq', initialBalance + BALANCE_INCREMENT)
})
}) })
}) })
......
...@@ -21,6 +21,11 @@ module.exports = { ...@@ -21,6 +21,11 @@ module.exports = {
accounts: { accounts: {
count: 1, count: 1,
}, },
// Disable auto-mining so that e2e tests can explicitly test pending states.
mining: {
auto: false,
interval: 0,
},
}, },
}, },
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment