Update development/Kovan updater (#44)

* Add dev/set-updater script

* Fix

* Fix development verification info

* Ready to go

* Wait longer
pull/52/head
Asa Oines 3 years ago committed by GitHub
parent e84eaef24f
commit 1ff01db998
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      typescript/optics-deploy/config/testnets/kovan.ts
  2. 38
      typescript/optics-deploy/scripts/dev/set-updater.ts
  3. 2
      typescript/optics-deploy/src/core/govern.ts
  4. 2
      typescript/optics-provider/src/optics/govern/index.ts

@ -24,7 +24,7 @@ export const chain = toChain(chainJson);
export const devConfig: CoreConfig = {
environment: 'dev',
updater: '0x91631845fab02614e53e5F5A68dFBB0E2f1a9B6d',
updater: '0xb890606a63Ef3b9d9Cd1E42e740672C84DC319A6',
optimisticSeconds: 10,
watchers: ['0x3019Bf39Df97942F2C53EFc6e831b82D158593CF'],
recoveryTimelock: 180,

@ -0,0 +1,38 @@
import { devCommunity } from 'optics-multi-provider-community';
import { ethers } from 'ethers';
import { configPath, networks } from './agentConfig';
import { ViolationType } from '../../src/checks';
import { CoreInvariantChecker } from '../../src/core/checks';
import { makeCoreDeploys } from '../../src/core/CoreDeploy';
import { expectCalls, GovernanceCallBatchBuilder } from '../../src/core/govern';
const deploys = makeCoreDeploys(
configPath,
networks,
(_) => _.chain,
(_) => _.devConfig,
);
async function main() {
devCommunity.registerRpcProvider('alfajores', process.env.ALFAJORES_RPC!)
devCommunity.registerRpcProvider('gorli', process.env.GORLI_RPC!)
devCommunity.registerRpcProvider('kovan', process.env.KOVAN_RPC!)
devCommunity.registerRpcProvider('mumbai', process.env.MUMBAI_RPC!)
devCommunity.registerRpcProvider('fuji', process.env.FUJI_RPC!)
devCommunity.registerSigner('alfajores', new ethers.Wallet(process.env.ALFAJORES_DEPLOYER_KEY!))
const checker = new CoreInvariantChecker(deploys);
await checker.checkDeploys();
checker.expectViolations([ViolationType.ReplicaUpdater, ViolationType.HomeUpdater ], [4, 1])
const builder = new GovernanceCallBatchBuilder(deploys, devCommunity, checker.violations);
const batch = await builder.build()
await batch.build()
const domains = deploys.map((deploy) => deploy.chain.domain)
// For each domain, expect one call to set the updater.
expectCalls(batch, domains, new Array(5).fill(1))
// Change to `batch.execute` in order to run.
const receipts = await batch.estimateGas()
console.log(receipts)
}
main().then(console.log).catch(console.error)

@ -23,7 +23,7 @@ export class GovernanceCallBatchBuilder {
async build(): Promise<CallBatch> {
const governorCore = await this._context.governorCore()
const batch = await governorCore.newGovernanceBatch()
const txs = await Promise.all(this._violations.map(this.handleViolation))
const txs = await Promise.all(this._violations.map((v) => this.handleViolation(v)))
txs.map((call) => batch.push(call.domain, call.call))
return batch
}

@ -65,7 +65,7 @@ export class CallBatch {
const receipts = []
for (const tx of transactions) {
const response = await signer.sendTransaction(tx)
receipts.push(await response.wait())
receipts.push(await response.wait(5))
}
return receipts
}

Loading…
Cancel
Save