Skip to content

Commit

Permalink
Merge pull request #2171 from OffchainLabs/external-signer-4844
Browse files Browse the repository at this point in the history
Include chainID in Tx to signtx args conversion
  • Loading branch information
anodar authored Mar 6, 2024
2 parents 22e80a4 + 1dc241c commit 56654aa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions arbnode/dataposter/externalsigner/externalsigner.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func (a *SignTxArgs) ToTransaction() *types.Transaction {
Commitments: a.Commitments,
Proofs: a.Proofs,
},
ChainID: uint256.NewInt(a.ChainID.ToInt().Uint64()),
})
}

Expand Down
3 changes: 2 additions & 1 deletion arbnode/dataposter/externalsigner/externalsigner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ var (
)
dynamicFeeTx = types.NewTx(
&types.DynamicFeeTx{
ChainID: big.NewInt(1337),
Nonce: 13,
GasTipCap: big.NewInt(1),
GasFeeCap: big.NewInt(1),
Expand Down Expand Up @@ -63,7 +64,7 @@ func TestToTranssaction(t *testing.T) {
t.Fatalf("TxToSignTxArgs() unexpected error: %v", err)
}
got := signTxArgs.ToTransaction()
hasher := types.LatestSignerForChainID(tc.tx.ChainId())
hasher := types.LatestSignerForChainID(nil)
if h, g := hasher.Hash(tc.tx), hasher.Hash(got); h != g {
t.Errorf("ToTransaction() got hash: %v want: %v", g, h)
}
Expand Down

0 comments on commit 56654aa

Please sign in to comment.