From 602c2b84db8db18dc493e94038e41f9d54b8e4e8 Mon Sep 17 00:00:00 2001 From: Andrea Franz Date: Fri, 22 May 2020 12:33:23 +0200 Subject: [PATCH] put gas estimation back --- src/actions/redeem.ts | 4 ++-- src/utils.ts | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/actions/redeem.ts b/src/actions/redeem.ts index 8f94a81..dfd0cd4 100644 --- a/src/actions/redeem.ts +++ b/src/actions/redeem.ts @@ -130,10 +130,10 @@ export const redeem = (bucketAddress: string, recipientAddress: string, cleanCod } const redeem = bucket.methods.redeem(message, sig); - // const gas = await redeem.estimateGas(); + const gas = await redeem.estimateGas(); redeem.send({ from: account, - // gas + gas }).then((resp: any) => { dispatch(redeemDone(resp.transactionHash)); }).catch((err: any) => { diff --git a/src/utils.ts b/src/utils.ts index 7fe0435..e7af7eb 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -29,3 +29,7 @@ export const toBaseUnit = (fullAmount: string, decimalsSize: number, roundDecima export const isTokenERC20 = (token: Token): token is TokenERC20 => { return (token as TokenERC20).decimals !== undefined; } + +export const compressAddress = (a: string, padding: number = 4) => { + return `${a.slice(0, padding + 2)}...${a.slice(a.length - padding)}`; +}