diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-02-06 23:40:25 +0800 |
---|---|---|
committer | Amir Bandeali <abandeali1@gmail.com> | 2018-02-07 09:27:47 +0800 |
commit | 4cc5bbaf19d2388b0be0669a6249bf92f60c712c (patch) | |
tree | 2151ea75dd433d027d35cd12798405c63886f163 /packages/contracts/util/multi_sig_wrapper.ts | |
parent | a264c36a48d224a55c2ef883f207692752ca74c7 (diff) | |
download | dexon-sol-tools-4cc5bbaf19d2388b0be0669a6249bf92f60c712c.tar.gz dexon-sol-tools-4cc5bbaf19d2388b0be0669a6249bf92f60c712c.tar.zst dexon-sol-tools-4cc5bbaf19d2388b0be0669a6249bf92f60c712c.zip |
Change utils
Diffstat (limited to 'packages/contracts/util/multi_sig_wrapper.ts')
-rw-r--r-- | packages/contracts/util/multi_sig_wrapper.ts | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/packages/contracts/util/multi_sig_wrapper.ts b/packages/contracts/util/multi_sig_wrapper.ts index 0a066df53..3b83ccb7b 100644 --- a/packages/contracts/util/multi_sig_wrapper.ts +++ b/packages/contracts/util/multi_sig_wrapper.ts @@ -1,12 +1,15 @@ +import { BigNumber } from '@0xproject/utils'; import ABI = require('ethereumjs-abi'); import ethUtil = require('ethereumjs-util'); import * as _ from 'lodash'; import * as Web3 from 'web3'; +import { MultiSigWalletContract } from '../src/contract_wrappers/generated/multi_sig_wallet'; + import { TransactionDataParams } from './types'; export class MultiSigWrapper { - private _multiSig: Web3.ContractInstance; + private _multiSig: MultiSigWalletContract; public static encodeFnArgs(name: string, abi: Web3.AbiDefinition[], args: any[]) { const abiEntity = _.find(abi, { name }) as Web3.MethodAbi; if (_.isUndefined(abiEntity)) { @@ -21,18 +24,18 @@ export class MultiSigWrapper { }); return funcSig + argsData.join(''); } - constructor(multiSigContractInstance: Web3.ContractInstance) { - this._multiSig = multiSigContractInstance; + constructor(multiSigContract: MultiSigWalletContract) { + this._multiSig = multiSigContract; } public async submitTransactionAsync( destination: string, from: string, dataParams: TransactionDataParams, - value: number = 0, + value: BigNumber = new BigNumber(0), ) { const { name, abi, args = [] } = dataParams; const encoded = MultiSigWrapper.encodeFnArgs(name, abi, args); - return this._multiSig.submitTransaction(destination, value, encoded, { + return this._multiSig.submitTransaction.sendTransactionAsync(destination, value, encoded, { from, }); } |