From 37253230c50e6959df1d7b4c002bfb5732c374f4 Mon Sep 17 00:00:00 2001 From: Nodar Ambroladze Date: Wed, 6 Mar 2024 13:54:17 +0100 Subject: [PATCH] Include chainID in Tx to signtx args conversion --- arbnode/dataposter/externalsigner/externalsigner.go | 1 + arbnode/dataposter/externalsigner/externalsigner_test.go | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/arbnode/dataposter/externalsigner/externalsigner.go b/arbnode/dataposter/externalsigner/externalsigner.go index c01ce268a5..10d9754cdf 100644 --- a/arbnode/dataposter/externalsigner/externalsigner.go +++ b/arbnode/dataposter/externalsigner/externalsigner.go @@ -60,6 +60,7 @@ func (a *SignTxArgs) ToTransaction() *types.Transaction { Commitments: a.Commitments, Proofs: a.Proofs, }, + ChainID: uint256.NewInt(a.ChainID.ToInt().Uint64()), }) } diff --git a/arbnode/dataposter/externalsigner/externalsigner_test.go b/arbnode/dataposter/externalsigner/externalsigner_test.go index 4cd18769fe..abd5acedcf 100644 --- a/arbnode/dataposter/externalsigner/externalsigner_test.go +++ b/arbnode/dataposter/externalsigner/externalsigner_test.go @@ -30,6 +30,7 @@ var ( ) dynamicFeeTx = types.NewTx( &types.DynamicFeeTx{ + ChainID: big.NewInt(1337), Nonce: 13, GasTipCap: big.NewInt(1), GasFeeCap: big.NewInt(1), @@ -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) }