fix: make eth_sendRawTransaction emit correct pre-nv20 messages.

This commit is contained in:
Raúl Kripalani
2023-02-14 13:57:46 +00:00
parent a46e57e3fc
commit d3a2a40b76
+7
View File
@@ -750,6 +750,13 @@ func (a *EthModule) EthSendRawTransaction(ctx context.Context, rawTx ethtypes.Et
return ethtypes.EmptyEthHash, err
}
// Prior to nv20, delegated signature messages with no parameters carried MethodSend.
// Reset the value so the signature will roundtrip.
nv := a.StateManager.GetNetworkVersion(ctx, a.Chain.GetHeaviestTipSet().Height())
if nv < network.Version20 && smsg.Message.Method == builtintypes.MethodsEVM.InvokeContract && len(smsg.Message.Params) == 0 {
smsg.Message.Method = builtintypes.MethodSend
}
_, err = a.MpoolAPI.MpoolPush(ctx, smsg)
if err != nil {
return ethtypes.EmptyEthHash, err