diff --git a/chain/types/ethtypes/eth_types.go b/chain/types/ethtypes/eth_types.go index 1539a638b60..d24c5256357 100644 --- a/chain/types/ethtypes/eth_types.go +++ b/chain/types/ethtypes/eth_types.go @@ -478,7 +478,7 @@ type EthFeeHistory struct { type EthFilterID EthHash func (h EthFilterID) MarshalJSON() ([]byte, error) { - return (EthHash)(h).MarshalJSON() + return json.Marshal(h.String()) } func (h *EthFilterID) UnmarshalJSON(b []byte) error { @@ -486,7 +486,7 @@ func (h *EthFilterID) UnmarshalJSON(b []byte) error { } func (h EthFilterID) String() string { - return (EthHash)(h).String() + return "0x" + strings.TrimLeft(hex.EncodeToString(h[:]), "0") } // An opaque identifier generated by the Lotus node to refer to an active subscription. diff --git a/chain/types/ethtypes/eth_types_test.go b/chain/types/ethtypes/eth_types_test.go index 118fbc90160..0bb15d68f2a 100644 --- a/chain/types/ethtypes/eth_types_test.go +++ b/chain/types/ethtypes/eth_types_test.go @@ -108,7 +108,7 @@ func TestEthHash(t *testing.T) { func TestEthFilterID(t *testing.T) { testcases := []string{ - `"0x013dbb9442ca9667baccc6230fcd5c1c4b2d4d2870f4bd20681d4d47cfd15184"`, + `"0x13dbb9442ca9667baccc6230fcd5c1c4b2d4d2870f4bd20681d4d47cfd15184"`, `"0xab8653edf9f51785664a643b47605a7ba3d917b5339a0724e7642c114d0e4738"`, }