Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ProxyFactory address refactoring from createCompanyWallet method #113

Merged
merged 1 commit into from
Feb 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 3 additions & 13 deletions lib/helper/User.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,26 +312,17 @@ 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.
* @param sessionKeysExpirationHeights Session key's expiration heights.
*
* @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,
Expand Down Expand Up @@ -399,15 +390,14 @@ 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.
* @param sessionKeysExpirationHeights Session key's expiration heights.
*
* @returns Promise object.
*/
_createCompanyWalletRawTx(proxyFactory, owner, sessionKeys, sessionKeysSpendingLimits, sessionKeysExpirationHeights) {
_createCompanyWalletRawTx(owner, sessionKeys, sessionKeysSpendingLimits, sessionKeysExpirationHeights) {
const oThis = this;

const thSetupExecutableData = oThis.getTokenHolderSetupExecutableData(
Expand All @@ -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);
}
Expand Down
3 changes: 1 addition & 2 deletions test/integration/DirectTransfer.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ describe('Direct transfers between TH contracts', async function() {
mockToken,
tokenRulesAddress,
userWalletFactoryAddress,
null, // proxy factory address
proxyFactoryAddress, // proxy factory address
auxiliaryWeb3
);

Expand All @@ -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],
Expand Down