From 910c6c69c768e04e1909bc71964fd8b18c99c4ec Mon Sep 17 00:00:00 2001 From: Yorke Rhodes Date: Mon, 18 Jul 2022 13:46:42 -0400 Subject: [PATCH] Apply gas buffer to kathy messages (#791) * Apply gas buffer to kathy messages * Use overrides for gas estimation * Add comment --- typescript/helloworld/src/app/app.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/typescript/helloworld/src/app/app.ts b/typescript/helloworld/src/app/app.ts index 8833370a7..cec079b31 100644 --- a/typescript/helloworld/src/app/app.ts +++ b/typescript/helloworld/src/app/app.ts @@ -24,11 +24,19 @@ export class HelloWorldApp< const sender = this.getContracts(from).router; const toDomain = ChainNameToDomainId[to]; const chainConnection = this.multiProvider.getChainConnection(from); - const tx = await sender.sendHelloWorld( + + // apply gas buffer due to https://github.com/abacus-network/abacus-monorepo/issues/634 + const estimated = await sender.estimateGas.sendHelloWorld( toDomain, message, chainConnection.overrides, ); + const gasLimit = estimated.mul(1.1).toNumber(); + + const tx = await sender.sendHelloWorld(toDomain, message, { + ...chainConnection.overrides, + gasLimit, + }); const receipt = await tx.wait(chainConnection.confirmations); if (receiveHandler) {