Skip to content

Commit

Permalink
inherit version and options from inner transaction when building rela…
Browse files Browse the repository at this point in the history
…yedV2 tx
  • Loading branch information
popenta committed Mar 13, 2024
1 parent ea7809e commit 1be27c2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/relayedTransactionV2Builder.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ describe("test relayed v2 transaction builder", function () {
gasLimit: 0,
chainID: networkConfig.ChainID,
data: new TransactionPayload("getContractConfig"),
version: 2,
});

await bob.signer.sign(innerTx);
Expand All @@ -84,9 +85,10 @@ describe("test relayed v2 transaction builder", function () {
await alice.signer.sign(relayedTxV2);

assert.equal(relayedTxV2.getNonce().valueOf(), 37);
assert.equal(relayedTxV2.getVersion().valueOf(), 2);
assert.equal(
relayedTxV2.getData().toString(),
"relayedTxV2@000000000000000000010000000000000000000000000000000000000002ffff@0f@676574436f6e7472616374436f6e666967@b6c5262d9837853e2201de357c1cc4c9803988a42d7049d26b7785dd0ac2bd4c6a8804b6fd9cf845fe2c2a622774b1a2dbd0a417c9a0bc3f0563a85bd15e710a");
"relayedTxV2@000000000000000000010000000000000000000000000000000000000002ffff@0f@676574436f6e7472616374436f6e666967@fc3ed87a51ee659f937c1a1ed11c1ae677e99629fae9cc289461f033e6514d1a8cfad1144ae9c1b70f28554d196bd6ba1604240c1c1dc19c959e96c1c3b62d0c");
});
});

Expand Down
2 changes: 2 additions & 0 deletions src/relayedTransactionV2Builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ export class RelayedTransactionV2Builder {
this.innerTransactionGasLimit.valueOf() + this.netConfig.MinGasLimit + this.netConfig.GasPerDataByte * payload.length(),
data: payload,
chainID: this.netConfig.ChainID,
version: this.innerTransaction.getVersion(),
options: this.innerTransaction.getOptions()
});

if (this.relayerNonce) {
Expand Down

0 comments on commit 1be27c2

Please sign in to comment.