@@ -185,6 +185,43 @@ func TestCall_TypedTx_RoutesToContainer(t *testing.T) {
185185 require .Equal (t , uint64 (50000 ), decoded .Gas ())
186186}
187187
188+ // TestCall_TypedTx_ActionCoreFieldsPreserved confirms that signContainer does
189+ // not strip non-ChainID fields from ActionCore (Bug 2 regression guard).
190+ func TestCall_TypedTx_ActionCoreFieldsPreserved (t * testing.T ) {
191+ ctrl := gomock .NewController (t )
192+
193+ acc , err := account .HexStringToAccount (_rlpTestKey )
194+ require .NoError (t , err )
195+ to , err := address .FromString (_rlpTestTo )
196+ require .NoError (t , err )
197+
198+ api := mock_iotexapi .NewMockAPIServiceClient (ctrl )
199+ var captured * iotextypes.Action
200+ api .EXPECT ().
201+ SendAction (gomock .Any (), gomock .Any ()).
202+ DoAndReturn (func (_ context.Context , req * iotexapi.SendActionRequest , _ ... grpc.CallOption ) (* iotexapi.SendActionResponse , error ) {
203+ captured = req .GetAction ()
204+ return & iotexapi.SendActionResponse {ActionHash : strings .Repeat ("0" , 64 )}, nil
205+ })
206+
207+ c := NewAuthedClient (api , _rlpTestChainID , acc )
208+ _ , err = c .Transfer (to , big .NewInt (1 )).
209+ SetNonce (7 ).
210+ SetTxType (dynamicFeeTxType ).
211+ SetGasTipCap (big .NewInt (500000000 )).
212+ SetGasFeeCap (big .NewInt (1500000000 )).
213+ SetGasLimit (42000 ).
214+ Call (context .Background ())
215+ require .NoError (t , err )
216+
217+ core := captured .GetCore ()
218+ require .Equal (t , uint64 (7 ), core .GetNonce ())
219+ require .Equal (t , uint64 (42000 ), core .GetGasLimit ())
220+ require .Equal (t , "500000000" , core .GetGasTipCap ())
221+ require .Equal (t , "1500000000" , core .GetGasFeeCap ())
222+ require .Equal (t , _rlpTestChainID , core .GetChainID ())
223+ }
224+
188225// TestSetAccessList_DefensiveCopy confirms mutating the caller's slice after
189226// the setter does not change what the SDK will send.
190227func TestSetAccessList_DefensiveCopy (t * testing.T ) {
0 commit comments