Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/regenesis-surgery/test/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class TestEnv {
console.log('Initializing pre GenesisJsonProvider...')
// Convert the genesis dump into a genesis file format
const genesis = { ...this.surgeryDataSources.genesis }
for (const account of this.surgeryDataSources.genesisDump) {
for (const account of this.surgeryDataSources.dump) {
let nonce = account.nonce
if (typeof nonce === 'string') {
nonce = BigNumber.from(nonce).toNumber()
Expand Down
40 changes: 17 additions & 23 deletions packages/regenesis-surgery/test/uniswap.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,6 @@ describe('uniswap contracts', () => {
})

it('should have the same code as on mainnet', async () => {
if (!env.hasLiveProviders()) {
console.log('Cannot run factory tests without live provider')
return
}

const l2Code = await env.postL2Provider.getCode(
postUniswapV3Factory.address
)
Expand All @@ -92,11 +87,6 @@ describe('uniswap contracts', () => {

describe('V3 NFPM', () => {
it('should have the same code as on mainnet', async () => {
if (!env.hasLiveProviders()) {
console.log('Cannot run factory tests without live provider')
return
}

let l2Code = await env.postL2Provider.getCode(UNISWAP_V3_NFPM_ADDRESS)
const l1Code = await env.surgeryDataSources.l1Provider.getCode(
UNISWAP_V3_NFPM_ADDRESS
Expand All @@ -110,9 +100,24 @@ describe('uniswap contracts', () => {
})

describe('V3 pools', () => {
it('Pools', () => {
it('Pools code', () => {
for (const pool of env.surgeryDataSources.pools) {
describe(`pool at address ${pool.newAddress}`, () => {
it('should have the same code as on testnet', async () => {
const l2Code = await env.postL2Provider.getCode(pool.newAddress)
const l1Code = await env.surgeryDataSources.l1Provider.getCode(
pool.newAddress
)
expect(l2Code).to.not.equal('0x')
expect(l2Code).to.equal(l1Code)
})
})
}
})

it('Pools contract', () => {
if (!env.hasLiveProviders()) {
console.log('Cannot run factory tests without live provider')
console.log('Cannot run pool contract tests without live provider')
return
}
for (const pool of env.surgeryDataSources.pools) {
Expand All @@ -132,17 +137,6 @@ describe('uniswap contracts', () => {
)
})

it('should have the same code as on testnet', async () => {
const l2Code = await env.postL2Provider.getCode(
postPoolContract.address
)
const l1Code = await env.surgeryDataSources.l1Provider.getCode(
postPoolContract.address
)
expect(l2Code).to.not.equal('0x')
expect(l2Code).to.equal(l1Code)
})

it('should have the same storage values', async () => {
const varsToCheck = [
'slot0',
Expand Down