Skip to content

Commit

Permalink
Remove unnecessary awaits
Browse files Browse the repository at this point in the history
  • Loading branch information
ly0va committed Sep 21, 2020
1 parent ce1cd77 commit 54b0f89
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions sdk/zksync.js/src/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export class Wallet {

await this.setRequiredAccountIdFromServer("Transfer funds");

const tokenId = await this.provider.tokenSet.resolveTokenId(transfer.token);
const tokenId = this.provider.tokenSet.resolveTokenId(transfer.token);

const transactionData = {
accountId: this.accountId,
Expand All @@ -122,7 +122,7 @@ export class Wallet {

const stringAmount = this.provider.tokenSet.formatToken(transfer.token, transfer.amount);
const stringFee = this.provider.tokenSet.formatToken(transfer.token, transfer.fee);
const stringToken = await this.provider.tokenSet.resolveTokenSymbol(transfer.token);
const stringToken = this.provider.tokenSet.resolveTokenSymbol(transfer.token);
const humanReadableTxInfo =
`Transfer ${stringAmount} ${stringToken}\n` +
`To: ${transfer.to.toLowerCase()}\n` +
Expand Down Expand Up @@ -166,9 +166,7 @@ export class Wallet {
for (let i = 0; i < transfers.length; i++) {
const transfer = transfers[i];

const tokenId = await this.provider.tokenSet.resolveTokenId(
transfer.token
);
const tokenId = this.provider.tokenSet.resolveTokenId(transfer.token);
const nonce = nextNonce;
nextNonce += 1;

Expand Down Expand Up @@ -199,9 +197,7 @@ export class Wallet {
transfer.token,
transfer.fee
);
const stringToken = await this.provider.tokenSet.resolveTokenSymbol(
transfer.token
);
const stringToken = this.provider.tokenSet.resolveTokenSymbol(transfer.token);
const humanReadableTxInfo =
`Transfer ${stringAmount} ${stringToken}\n` +
`To: ${transfer.to.toLowerCase()}\n` +
Expand Down Expand Up @@ -260,7 +256,7 @@ export class Wallet {
}
await this.setRequiredAccountIdFromServer("Withdraw funds");

const tokenId = await this.provider.tokenSet.resolveTokenId(withdraw.token);
const tokenId = this.provider.tokenSet.resolveTokenId(withdraw.token);
const transactionData = {
accountId: this.accountId,
from: this.address(),
Expand All @@ -273,7 +269,7 @@ export class Wallet {

const stringAmount = this.provider.tokenSet.formatToken(withdraw.token, withdraw.amount);
const stringFee = this.provider.tokenSet.formatToken(withdraw.token, withdraw.fee);
const stringToken = await this.provider.tokenSet.resolveTokenSymbol(withdraw.token);
const stringToken = this.provider.tokenSet.resolveTokenSymbol(withdraw.token);
const humanReadableTxInfo =
`Withdraw ${stringAmount} ${stringToken}\n` +
`To: ${withdraw.ethAddress.toLowerCase()}\n` +
Expand Down

0 comments on commit 54b0f89

Please sign in to comment.