File tree Expand file tree Collapse file tree 2 files changed +18
-5
lines changed
venus-devtool/state-type-gen
venus-shared/actors/types Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -125,8 +125,9 @@ var stateTypesOpt = option{
125125// venus-shared/actors/types
126126var sharedTypesOpt = option {
127127 skipStructs : map [string ]struct {}{
128- "ActorV5" : {},
129- "TempEthCall" : {},
128+ "ActorV5" : {},
129+ "EthCallDecode" : {},
130+ "EthCallRaw" : {},
130131 },
131132 skipAllVar : false ,
132133 skipVars : []string {"Eip155ChainID" },
Original file line number Diff line number Diff line change @@ -308,13 +308,25 @@ func (c *EthCall) ToFilecoinMessage() (*Message, error) {
308308}
309309
310310func (c * EthCall ) UnmarshalJSON (b []byte ) error {
311- type TempEthCall EthCall
312- var params TempEthCall
311+ type EthCallRaw EthCall // Avoid a recursive call.
312+ type EthCallDecode struct {
313+ // The field should be "input" by spec, but many clients use "data" so we support
314+ // both, but prefer "input".
315+ Input * EthBytes `json:"input"`
316+ EthCallRaw
317+ }
313318
319+ var params EthCallDecode
314320 if err := json .Unmarshal (b , & params ); err != nil {
315321 return err
316322 }
317- * c = EthCall (params )
323+
324+ // If input is specified, prefer it.
325+ if params .Input != nil {
326+ params .Data = * params .Input
327+ }
328+
329+ * c = EthCall (params .EthCallRaw )
318330 return nil
319331}
320332
You can’t perform that action at this time.
0 commit comments