diff --git a/packages/iov-ethereum/src/ethereumconnection.spec.ts b/packages/iov-ethereum/src/ethereumconnection.spec.ts index 587bcc44c..50d0d123e 100644 --- a/packages/iov-ethereum/src/ethereumconnection.spec.ts +++ b/packages/iov-ethereum/src/ethereumconnection.spec.ts @@ -2066,11 +2066,11 @@ describe("EthereumConnection", () => { expect(result.tokens).toBeUndefined(); expect(result.gasPrice).toEqual({ // 20 gwei - quantity: "20000000000", + quantity: "10000000000", fractionalDigits: 18, tokenTicker: "ETH" as TokenTicker, }); - expect(result.gasLimit).toEqual("2100000"); + expect(result.gasLimit).toEqual("21000"); connection.disconnect(); }); diff --git a/packages/iov-ethereum/src/ethereumconnection.ts b/packages/iov-ethereum/src/ethereumconnection.ts index 1a6670473..2eb5736a7 100644 --- a/packages/iov-ethereum/src/ethereumconnection.ts +++ b/packages/iov-ethereum/src/ethereumconnection.ts @@ -917,10 +917,19 @@ export class EthereumConnection implements AtomicSwapConnection { public async getFeeQuote(transaction: UnsignedTransaction): Promise { switch (transaction.kind) { + case "bcp/send": + return { + gasPrice: { + // TODO: calculate dynamically from previous blocks or external API + quantity: "10000000000", // 10 gwei + fractionalDigits: constants.primaryTokenFractionalDigits, + tokenTicker: constants.primaryTokenTicker, + }, + gasLimit: "21000", + }; case "smartcontract/escrow_open": case "smartcontract/escrow_abort": case "smartcontract/escrow_claim": - case "bcp/send": case "bcp/swap_offer": case "bcp/swap_claim": case "bcp/swap_abort": @@ -928,11 +937,11 @@ export class EthereumConnection implements AtomicSwapConnection { return { gasPrice: { // TODO: calculate dynamically from previous blocks or external API - quantity: "20000000000", // 20 gwei + quantity: "10000000000", // 10 gwei fractionalDigits: constants.primaryTokenFractionalDigits, tokenTicker: constants.primaryTokenTicker, }, - gasLimit: "2100000", + gasLimit: "210000", }; default: throw new Error("Received transaction of unsupported kind.");