aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-03-11 05:38:31 +0800
committerFabio Berger <me@fabioberger.com>2018-03-11 05:38:31 +0800
commit4ac6b6828c30f2ec78bbea66b324c505641f24c3 (patch)
tree5ef9072c89f594b0165d533e69d3b481764e5c62 /packages
parentc050186014e4bc060ccbfb3e15ea39d86e59f0c4 (diff)
downloaddexon-sol-tools-4ac6b6828c30f2ec78bbea66b324c505641f24c3.tar
dexon-sol-tools-4ac6b6828c30f2ec78bbea66b324c505641f24c3.tar.gz
dexon-sol-tools-4ac6b6828c30f2ec78bbea66b324c505641f24c3.tar.bz2
dexon-sol-tools-4ac6b6828c30f2ec78bbea66b324c505641f24c3.tar.lz
dexon-sol-tools-4ac6b6828c30f2ec78bbea66b324c505641f24c3.tar.xz
dexon-sol-tools-4ac6b6828c30f2ec78bbea66b324c505641f24c3.tar.zst
dexon-sol-tools-4ac6b6828c30f2ec78bbea66b324c505641f24c3.zip
Get rid of getFirstAccountIfExistsAsync since no longer needed
Diffstat (limited to 'packages')
-rw-r--r--packages/website/ts/blockchain.ts13
1 files changed, 4 insertions, 9 deletions
diff --git a/packages/website/ts/blockchain.ts b/packages/website/ts/blockchain.ts
index 30adf680e..0cb36230b 100644
--- a/packages/website/ts/blockchain.ts
+++ b/packages/website/ts/blockchain.ts
@@ -243,7 +243,8 @@ export class Blockchain {
shouldPollUserAddress,
);
- this._userAddressIfExists = await this.getFirstAccountIfExistsAsync();
+ const userAddresses = await this._web3Wrapper.getAvailableAddressesAsync();
+ this._userAddressIfExists = userAddresses[0];
this._zeroEx.setProvider(provider, this.networkId);
@@ -579,13 +580,6 @@ export class Blockchain {
this._dispatcher.updateBlockchainIsLoaded(true);
}
- public async getFirstAccountIfExistsAsync() {
- const addresses = await this._web3Wrapper.getAvailableAddressesAsync();
- if (_.isEmpty(addresses)) {
- return undefined;
- }
- return addresses[0];
- }
private async _showEtherScanLinkAndAwaitTransactionMinedAsync(
txHash: string,
): Promise<TransactionReceiptWithDecodedLogs> {
@@ -794,7 +788,8 @@ export class Blockchain {
shouldPollUserAddress,
);
- this._userAddressIfExists = await this.getFirstAccountIfExistsAsync();
+ const userAddresses = await this._web3Wrapper.getAvailableAddressesAsync();
+ this._userAddressIfExists = userAddresses[0];
this._dispatcher.updateUserAddress(this._userAddressIfExists);
await this.fetchTokenInformationAsync();
this._blockchainWatcher.startEmittingNetworkConnectionAndUserBalanceState();