diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-06-06 18:48:00 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-06-06 18:48:00 +0800 |
commit | 67e2208a1822732ea125af0c4cd757b9f735ce86 (patch) | |
tree | 0582c6a5ce6170ae568bbadbfbec043ba9c26ef5 | |
parent | 279790117be882186685c04099e3d46ec68991b6 (diff) | |
download | dexon-sol-tools-67e2208a1822732ea125af0c4cd757b9f735ce86.tar dexon-sol-tools-67e2208a1822732ea125af0c4cd757b9f735ce86.tar.gz dexon-sol-tools-67e2208a1822732ea125af0c4cd757b9f735ce86.tar.bz2 dexon-sol-tools-67e2208a1822732ea125af0c4cd757b9f735ce86.tar.lz dexon-sol-tools-67e2208a1822732ea125af0c4cd757b9f735ce86.tar.xz dexon-sol-tools-67e2208a1822732ea125af0c4cd757b9f735ce86.tar.zst dexon-sol-tools-67e2208a1822732ea125af0c4cd757b9f735ce86.zip |
Rename accounts to addreses
-rw-r--r-- | src/0x.js.ts | 8 | ||||
-rw-r--r-- | src/utils/assert.ts | 4 | ||||
-rw-r--r-- | src/web3_wrapper.ts | 8 | ||||
-rw-r--r-- | test/0x.js_test.ts | 2 | ||||
-rw-r--r-- | test/assert_test.ts | 2 | ||||
-rw-r--r-- | test/utils/fill_scenarios.ts | 2 |
6 files changed, 13 insertions, 13 deletions
diff --git a/src/0x.js.ts b/src/0x.js.ts index 0d8e30d8c..84362bd9a 100644 --- a/src/0x.js.ts +++ b/src/0x.js.ts @@ -122,11 +122,11 @@ export class ZeroEx { this.token.invalidateContractInstances(); } /** - * Get accounts via the supplied web3 instance available for sending transactions. + * Get addresses via the supplied web3 instance available for sending transactions. */ - public async getAvailableAccountsAsync(): Promise<string[]> { - const availableAccounts = await this.web3Wrapper.getAvailableAccountsAsync(); - return availableAccounts; + public async getAvailableAddressesAsync(): Promise<string[]> { + const availableAddresses = await this.web3Wrapper.getAvailableAddressesAsync(); + return availableAddresses; } /** * Computes the orderHash for a given order and returns it as a hex encoded string. diff --git a/src/utils/assert.ts b/src/utils/assert.ts index 6e10c5d40..5b4a6fca6 100644 --- a/src/utils/assert.ts +++ b/src/utils/assert.ts @@ -29,9 +29,9 @@ export const assert = { async isSenderAddressHexAsync(variableName: string, senderAddress: string, web3Wrapper: Web3Wrapper): Promise<void> { assert.isETHAddressHex(variableName, senderAddress); - await assert.isSenderAccountAvailableAsync(web3Wrapper, senderAddress); + await assert.isSenderAddressAvailableAsync(web3Wrapper, senderAddress); }, - async isSenderAccountAvailableAsync(web3Wrapper: Web3Wrapper, senderAddress: string): Promise<void> { + async isSenderAddressAvailableAsync(web3Wrapper: Web3Wrapper, senderAddress: string): Promise<void> { const isSenderAddressAvailable = await web3Wrapper.isSenderAddressAvailableAsync(senderAddress); assert.assert(isSenderAddressAvailable, `Specified sender account ${senderAddress} isn't available through the \ supplied web3 instance`); diff --git a/src/web3_wrapper.ts b/src/web3_wrapper.ts index 2508c5116..e1bb29f85 100644 --- a/src/web3_wrapper.ts +++ b/src/web3_wrapper.ts @@ -17,14 +17,14 @@ export class Web3Wrapper { public isAddress(address: string): boolean { return this.web3.isAddress(address); } - public getDefaultAccount(): string { + public getDefaultAddress(): string { return this.web3.eth.defaultAccount; } - public setDefaultAccount(address: string): void { + public setDefaultAddress(address: string): void { this.web3.eth.defaultAccount = address; } public async isSenderAddressAvailableAsync(senderAddress: string): Promise<boolean> { - const addresses = await this.getAvailableAccountsAsync(); + const addresses = await this.getAvailableAddressesAsync(); return _.includes(addresses, senderAddress); } public async getNodeVersionAsync(): Promise<string> { @@ -61,7 +61,7 @@ export class Web3Wrapper { const {timestamp} = await promisify(this.web3.eth.getBlock)(blockHash); return timestamp; } - public async getAvailableAccountsAsync(): Promise<string[]> { + public async getAvailableAddressesAsync(): Promise<string[]> { const addresses: string[] = await promisify(this.web3.eth.getAccounts)(); return addresses; } diff --git a/test/0x.js_test.ts b/test/0x.js_test.ts index 061e0cbf4..edc2a3493 100644 --- a/test/0x.js_test.ts +++ b/test/0x.js_test.ts @@ -195,7 +195,7 @@ describe('ZeroEx library', () => { const web3 = web3Factory.create(); const zeroEx = new ZeroEx(web3); before(async () => { - const availableAccounts = await zeroEx.getAvailableAccountsAsync(); + const availableAccounts = await zeroEx.getAvailableAddressesAsync(); makerAccount = availableAccounts[0]; }); afterEach(() => { diff --git a/test/assert_test.ts b/test/assert_test.ts index f72956eb3..c8f698730 100644 --- a/test/assert_test.ts +++ b/test/assert_test.ts @@ -24,7 +24,7 @@ describe('Assertion library', () => { isn't available through the supplied web3 instance`); }); it('doesn\'t throw if account is available', async () => { - const availableAccount = (await zeroEx.getAvailableAccountsAsync())[0]; + const availableAccount = (await zeroEx.getAvailableAddressesAsync())[0]; const varName = 'account'; return expect(assert.isSenderAddressHexAsync(varName, availableAccount, (zeroEx as any).web3Wrapper)) .to.become(undefined); diff --git a/test/utils/fill_scenarios.ts b/test/utils/fill_scenarios.ts index 075906eaa..f2daac623 100644 --- a/test/utils/fill_scenarios.ts +++ b/test/utils/fill_scenarios.ts @@ -54,7 +54,7 @@ export class FillScenarios { public async createPartiallyFilledSignedOrderAsync(makerTokenAddress: string, takerTokenAddress: string, takerAddress: string, fillableAmount: BigNumber.BigNumber, partialFillAmount: BigNumber.BigNumber) { - const prevSenderAccount = await this.zeroEx.getAvailableAccountsAsync(); + const prevSenderAccount = await this.zeroEx.getAvailableAddressesAsync(); const [makerAddress] = this.userAddresses; const signedOrder = await this.createAsymmetricFillableSignedOrderAsync( makerTokenAddress, takerTokenAddress, makerAddress, takerAddress, |