Skip to content

Commit

Permalink
develop merge fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tynes committed Jun 2, 2021
1 parent 1d91ac6 commit c54de60
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
2 changes: 1 addition & 1 deletion integration-tests/test/native-eth.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe('Native ETH Integration Tests', async () => {
it('Should estimate gas for ETH withdraw', async () => {
const amount = utils.parseEther('0.5')
const gas = await env.ovmEth.estimateGas.withdraw(amount, 0, '0xFFFF')
expect(gas).to.be.deep.eq(BigNumber.from(6140049))
expect(gas).to.be.deep.eq(BigNumber.from(6580050))
})
})

Expand Down
5 changes: 4 additions & 1 deletion packages/contracts/bin/take-dump.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ import { RollupDeployConfig } from '../src/contract-deployment'
ovmGlobalContext: {
ovmCHAINID: parseInt(CHAIN_ID, 10),
},
gasPriceOracleOwner: GAS_PRICE_ORACLE_OWNER
gasPriceOracleConfig: {
owner: GAS_PRICE_ORACLE_OWNER,
initialGasPrice: 0,
}
}

const dump = await makeStateDump(config as RollupDeployConfig)
Expand Down
15 changes: 13 additions & 2 deletions packages/contracts/src/contract-deployment/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ export interface RollupDeployConfig {
owner: string | Signer
allowArbitraryContractDeployment: boolean
}
gasPriceOracleOwner: string
gasPriceOracleConfig: {
owner: string | Signer
initialGasPrice: number
}
addressManager?: string
dependencies?: string[]
deployOverrides: Overrides
Expand Down Expand Up @@ -262,7 +265,15 @@ export const makeContractDeployConfig = async (
},
OVM_GasPriceOracle: {
factory: getContractFactory('OVM_GasPriceOracle'),
params: [config.gasPriceOracleOwner],
params: [
(() => {
if (typeof config.gasPriceOracleConfig.owner !== 'string') {
return config.gasPriceOracleConfig.owner.getAddress()
}
return config.gasPriceOracleConfig.owner
})(),
config.gasPriceOracleConfig.initialGasPrice,
],
},
}
}
5 changes: 4 additions & 1 deletion packages/contracts/src/state-dump/make-dump.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,10 @@ export const makeStateDump = async (cfg: RollupDeployConfig): Promise<any> => {
],
deployOverrides: {},
waitForReceipts: false,
gasPriceOracleOwner: cfg.gasPriceOracleOwner,
gasPriceOracleConfig: {
owner: signer,
initialGasPrice: 0,
},
}

config = { ...config, ...cfg }
Expand Down

0 comments on commit c54de60

Please sign in to comment.