diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-12-11 06:37:48 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-12-11 06:44:49 +0800 |
commit | 9f5eeed30930eea59e9922569a15cb5d689f3eeb (patch) | |
tree | 74dac8603dae440bcaa28245fd5af49815284840 /contracts/core/test/utils/asset_proxy_owner_wrapper.ts | |
parent | 14ea4ee1d3fd1a34c1747b928d9b463787e603e7 (diff) | |
download | dexon-0x-contracts-9f5eeed30930eea59e9922569a15cb5d689f3eeb.tar dexon-0x-contracts-9f5eeed30930eea59e9922569a15cb5d689f3eeb.tar.gz dexon-0x-contracts-9f5eeed30930eea59e9922569a15cb5d689f3eeb.tar.bz2 dexon-0x-contracts-9f5eeed30930eea59e9922569a15cb5d689f3eeb.tar.lz dexon-0x-contracts-9f5eeed30930eea59e9922569a15cb5d689f3eeb.tar.xz dexon-0x-contracts-9f5eeed30930eea59e9922569a15cb5d689f3eeb.tar.zst dexon-0x-contracts-9f5eeed30930eea59e9922569a15cb5d689f3eeb.zip |
Rename core package to protocol
Diffstat (limited to 'contracts/core/test/utils/asset_proxy_owner_wrapper.ts')
-rw-r--r-- | contracts/core/test/utils/asset_proxy_owner_wrapper.ts | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/contracts/core/test/utils/asset_proxy_owner_wrapper.ts b/contracts/core/test/utils/asset_proxy_owner_wrapper.ts deleted file mode 100644 index df23658d8..000000000 --- a/contracts/core/test/utils/asset_proxy_owner_wrapper.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { LogDecoder } from '@0x/contracts-test-utils'; -import { artifacts as tokensArtifacts } from '@0x/contracts-tokens'; -import { BigNumber } from '@0x/utils'; -import { Web3Wrapper } from '@0x/web3-wrapper'; -import { Provider, TransactionReceiptWithDecodedLogs } from 'ethereum-types'; -import * as _ from 'lodash'; - -import { AssetProxyOwnerContract } from '../../generated-wrappers/asset_proxy_owner'; -import { artifacts } from '../../src/artifacts'; - -export class AssetProxyOwnerWrapper { - private readonly _assetProxyOwner: AssetProxyOwnerContract; - private readonly _web3Wrapper: Web3Wrapper; - private readonly _logDecoder: LogDecoder; - constructor(assetproxyOwnerContract: AssetProxyOwnerContract, provider: Provider) { - this._assetProxyOwner = assetproxyOwnerContract; - this._web3Wrapper = new Web3Wrapper(provider); - this._logDecoder = new LogDecoder(this._web3Wrapper, { ...artifacts, ...tokensArtifacts }); - } - public async submitTransactionAsync( - destination: string, - data: string, - from: string, - opts: { value?: BigNumber } = {}, - ): Promise<TransactionReceiptWithDecodedLogs> { - const value = _.isUndefined(opts.value) ? new BigNumber(0) : opts.value; - const txHash = await this._assetProxyOwner.submitTransaction.sendTransactionAsync(destination, value, data, { - from, - }); - const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash); - return tx; - } - public async confirmTransactionAsync(txId: BigNumber, from: string): Promise<TransactionReceiptWithDecodedLogs> { - const txHash = await this._assetProxyOwner.confirmTransaction.sendTransactionAsync(txId, { from }); - const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash); - return tx; - } - public async revokeConfirmationAsync(txId: BigNumber, from: string): Promise<TransactionReceiptWithDecodedLogs> { - const txHash = await this._assetProxyOwner.revokeConfirmation.sendTransactionAsync(txId, { from }); - const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash); - return tx; - } - public async executeTransactionAsync( - txId: BigNumber, - from: string, - opts: { gas?: number } = {}, - ): Promise<TransactionReceiptWithDecodedLogs> { - const txHash = await this._assetProxyOwner.executeTransaction.sendTransactionAsync(txId, { - from, - gas: opts.gas, - }); - const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash); - return tx; - } - public async executeRemoveAuthorizedAddressAtIndexAsync( - txId: BigNumber, - from: string, - ): Promise<TransactionReceiptWithDecodedLogs> { - // tslint:disable-next-line:no-unnecessary-type-assertion - const txHash = await (this - ._assetProxyOwner as AssetProxyOwnerContract).executeRemoveAuthorizedAddressAtIndex.sendTransactionAsync( - txId, - { - from, - }, - ); - const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash); - return tx; - } -} |