From 5687ad535b828123742bd1c511a988f45aacf9ef Mon Sep 17 00:00:00 2001 From: abhayks1 Date: Wed, 20 Feb 2019 20:55:47 +0530 Subject: [PATCH] ProxyFactory address doesn't need to be passed in createCompanyWallet method --- lib/helper/User.js | 16 +++------------- test/integration/DirectTransfer.js | 3 +-- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/lib/helper/User.js b/lib/helper/User.js index 2f1ba63..e805a8e 100644 --- a/lib/helper/User.js +++ b/lib/helper/User.js @@ -312,7 +312,6 @@ class User { * Method for creation and configuration of token holder proxy contract for company * with hardware wallet as it's owner. * - * @param proxyFactory proxyFactory contract address. * @param owner TokenHolder proxy owner address. It could be hardware wallet address. * @param sessionKeys Session key addresses to authorize. * @param sessionKeysSpendingLimits Session key's spending limits. @@ -320,18 +319,10 @@ class User { * * @returns Promise object. */ - async createCompanyWallet( - proxyFactory, - owner, - sessionKeys, - sessionKeysSpendingLimits, - sessionKeysExpirationHeights, - txOptions - ) { + async createCompanyWallet(owner, sessionKeys, sessionKeysSpendingLimits, sessionKeysExpirationHeights, txOptions) { const oThis = this; const txObject = oThis._createCompanyWalletRawTx( - proxyFactory, owner, sessionKeys, sessionKeysSpendingLimits, @@ -399,7 +390,6 @@ class User { * Private method used for creation and configuration of token holder proxy contract for company * with hardware wallet as it's owner. * - * @param proxyFactory proxyFactory contract address. * @param owner TokenHolder proxy owner address. It could be hardware wallet address. * @param sessionKeys Session key addresses to authorize. * @param sessionKeysSpendingLimits Session key's spending limits. @@ -407,7 +397,7 @@ class User { * * @returns Promise object. */ - _createCompanyWalletRawTx(proxyFactory, owner, sessionKeys, sessionKeysSpendingLimits, sessionKeysExpirationHeights) { + _createCompanyWalletRawTx(owner, sessionKeys, sessionKeysSpendingLimits, sessionKeysExpirationHeights) { const oThis = this; const thSetupExecutableData = oThis.getTokenHolderSetupExecutableData( @@ -419,7 +409,7 @@ class User { const jsonInterface = oThis.abiBinProvider.getABI(ProxyFactoryContractName); - const contract = new oThis.auxiliaryWeb3.eth.Contract(jsonInterface, proxyFactory); + const contract = new oThis.auxiliaryWeb3.eth.Contract(jsonInterface, oThis.proxyFactory); return contract.methods.createProxy(oThis.tokenHolderMasterCopy, thSetupExecutableData); } diff --git a/test/integration/DirectTransfer.js b/test/integration/DirectTransfer.js index b469bd1..78ae56f 100644 --- a/test/integration/DirectTransfer.js +++ b/test/integration/DirectTransfer.js @@ -311,7 +311,7 @@ describe('Direct transfers between TH contracts', async function() { mockToken, tokenRulesAddress, userWalletFactoryAddress, - null, // proxy factory address + proxyFactoryAddress, // proxy factory address auxiliaryWeb3 ); @@ -321,7 +321,6 @@ describe('Direct transfers between TH contracts', async function() { const sessionKeys = [sessionKey]; const response = await userInstance.createCompanyWallet( - proxyFactoryAddress, thMasterCopyAddress, sessionKeys, [config.sessionKeySpendingLimit],