Skip to content

Commit

Permalink
fix gas computation for relayed v2
Browse files Browse the repository at this point in the history
  • Loading branch information
popenta committed Jan 8, 2024
1 parent febe2cf commit 0b92e85
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ describe("test relayed v1 transaction builder", function () {

assert.equal(relayedTransaction.version, 2);
assert.equal(relayedTransaction.options, 0);
assert.equal(relayedTransaction.gasLimit.toString(), "60414500");
assert.equal(
Buffer.from(relayedTransaction.data).toString(),
"relayedTxV2@000000000000000000010000000000000000000000000000000000000002ffff@0f@676574436f6e7472616374436f6e666967@fc3ed87a51ee659f937c1a1ed11c1ae677e99629fae9cc289461f033e6514d1a8cfad1144ae9c1b70f28554d196bd6ba1604240c1c1dc19c959e96c1c3b62d0c"
Expand Down
2 changes: 1 addition & 1 deletion src/transactionsFactories/relayedTransactionsFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export class RelayedTransactionsFactory {
const additionalGasForDataLength = new BigNumber(this.config.gasLimitPerByte).multipliedBy(
new BigNumber(data.length)
);
const gasLimit = new BigNumber(options.innerTransaction.gasLimit)
const gasLimit = new BigNumber(options.innerTransactionGasLimit)
.plus(new BigNumber(this.config.minGasLimit))
.plus(additionalGasForDataLength);

Expand Down

0 comments on commit 0b92e85

Please sign in to comment.