Skip to content

Commit

Permalink
Use async/await in ERC20 class methods
Browse files Browse the repository at this point in the history
  • Loading branch information
r-czajkowski committed Nov 28, 2022
1 parent 4f7cf47 commit 4220a1b
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/threshold-ts/tokens/erc20/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,24 @@ export class BaseERC20Token implements IERC20 {
config.account
)
}
balanceOf = (account: string): Promise<BigNumber> => {
return this._contract.balanceOf(account)

balanceOf = async (account: string): Promise<BigNumber> => {
return await this._contract.balanceOf(account)
}

allowance = (owner: string, spender: string): Promise<BigNumber> => {
return this._contract.allowance(owner, spender)
allowance = async (owner: string, spender: string): Promise<BigNumber> => {
return await this._contract.allowance(owner, spender)
}

totalSupply = (): Promise<BigNumber> => {
return this._contract.totalSupply()
totalSupply = async (): Promise<BigNumber> => {
return await this._contract.totalSupply()
}

approve = (spender: string, amount: string): Promise<ContractTransaction> => {
return this._contract.approve(spender, amount)
approve = async (
spender: string,
amount: string
): Promise<ContractTransaction> => {
return await this._contract.approve(spender, amount)
}

get contract() {
Expand Down

0 comments on commit 4220a1b

Please sign in to comment.