Rename AssetProxyOwner to ZeroExGovernor throughout all contracts packages

This commit is contained in:
Amir Bandeali
2019-10-17 17:19:44 -07:00
parent 5ddc35fdf2
commit c50cbd7a75
11 changed files with 130 additions and 127 deletions

View File

@@ -1,2 +1,2 @@
export * from './multi_sig_wrapper';
export * from './asset_proxy_owner_wrapper';
export * from './zero_ex_governor_wrapper';

View File

@@ -3,13 +3,13 @@ import { AbiEncoder, BigNumber } from '@0x/utils';
import { LogWithDecodedArgs, TransactionReceiptWithDecodedLogs } from 'ethereum-types';
import * as _ from 'lodash';
import { AssetProxyOwnerContract, AssetProxyOwnerSubmissionEventArgs, TestAssetProxyOwnerContract } from '../../src';
import { TestZeroExGovernorContract, ZeroExGovernorContract, ZeroExGovernorSubmissionEventArgs } from '../../src';
// tslint:disable: no-unnecessary-type-assertion
export class AssetProxyOwnerWrapper {
private readonly _assetProxyOwner: AssetProxyOwnerContract | TestAssetProxyOwnerContract;
constructor(assetproxyOwnerContract: AssetProxyOwnerContract | TestAssetProxyOwnerContract) {
this._assetProxyOwner = assetproxyOwnerContract;
export class ZeroExGovernorWrapper {
private readonly _governor: ZeroExGovernorContract | TestZeroExGovernorContract;
constructor(assetproxyOwnerContract: ZeroExGovernorContract | TestZeroExGovernorContract) {
this._governor = assetproxyOwnerContract;
}
public async submitTransactionAsync(
data: string[],
@@ -20,13 +20,13 @@ export class AssetProxyOwnerWrapper {
const values = opts.values === undefined ? data.map(() => constants.ZERO_AMOUNT) : opts.values;
const batchTransactionEncoder = AbiEncoder.create('(bytes[],address[],uint256[])');
const batchTransactionData = batchTransactionEncoder.encode([data, destinations, values]);
const txReceipt = await this._assetProxyOwner.submitTransaction.awaitTransactionSuccessAsync(
const txReceipt = await this._governor.submitTransaction.awaitTransactionSuccessAsync(
hexRandom(20), // submitTransaction will fail if this is a null address
constants.ZERO_AMOUNT,
batchTransactionData,
{ from },
);
const txId = (txReceipt.logs[0] as LogWithDecodedArgs<AssetProxyOwnerSubmissionEventArgs>).args.transactionId;
const txId = (txReceipt.logs[0] as LogWithDecodedArgs<ZeroExGovernorSubmissionEventArgs>).args.transactionId;
return { txReceipt, txId };
}
public async submitConfirmAndExecuteTransactionAsync(
@@ -39,12 +39,12 @@ export class AssetProxyOwnerWrapper {
const submitResults = await this.submitTransactionAsync(data, destinations, signerAddresses[0], opts);
const requiredSignatures = opts.requiredSignatures === undefined ? 2 : opts.requiredSignatures;
for (const index of _.range(1, requiredSignatures)) {
await this._assetProxyOwner.confirmTransaction.awaitTransactionSuccessAsync(submitResults.txId, {
await this._governor.confirmTransaction.awaitTransactionSuccessAsync(submitResults.txId, {
from: signerAddresses[index],
});
}
await increaseTimeAndMineBlockAsync(increaseTimeSeconds);
const executionTxReceipt = await this._assetProxyOwner.executeTransaction.awaitTransactionSuccessAsync(
const executionTxReceipt = await this._governor.executeTransaction.awaitTransactionSuccessAsync(
submitResults.txId,
{ from: opts.executeFromAddress === undefined ? signerAddresses[0] : opts.executeFromAddress },
);