github.com/ethereum/go-ethereum@v1.16.1/eth/tracers/live/gen_supplyinfoburn.go (about) 1 // Code generated by github.com/fjl/gencodec. DO NOT EDIT. 2 3 package live 4 5 import ( 6 "encoding/json" 7 "math/big" 8 9 "github.com/ethereum/go-ethereum/common/hexutil" 10 ) 11 12 var _ = (*supplyInfoBurnMarshaling)(nil) 13 14 // MarshalJSON marshals as JSON. 15 func (s supplyInfoBurn) MarshalJSON() ([]byte, error) { 16 type supplyInfoBurn struct { 17 EIP1559 *hexutil.Big `json:"1559,omitempty"` 18 Blob *hexutil.Big `json:"blob,omitempty"` 19 Misc *hexutil.Big `json:"misc,omitempty"` 20 } 21 var enc supplyInfoBurn 22 enc.EIP1559 = (*hexutil.Big)(s.EIP1559) 23 enc.Blob = (*hexutil.Big)(s.Blob) 24 enc.Misc = (*hexutil.Big)(s.Misc) 25 return json.Marshal(&enc) 26 } 27 28 // UnmarshalJSON unmarshals from JSON. 29 func (s *supplyInfoBurn) UnmarshalJSON(input []byte) error { 30 type supplyInfoBurn struct { 31 EIP1559 *hexutil.Big `json:"1559,omitempty"` 32 Blob *hexutil.Big `json:"blob,omitempty"` 33 Misc *hexutil.Big `json:"misc,omitempty"` 34 } 35 var dec supplyInfoBurn 36 if err := json.Unmarshal(input, &dec); err != nil { 37 return err 38 } 39 if dec.EIP1559 != nil { 40 s.EIP1559 = (*big.Int)(dec.EIP1559) 41 } 42 if dec.Blob != nil { 43 s.Blob = (*big.Int)(dec.Blob) 44 } 45 if dec.Misc != nil { 46 s.Misc = (*big.Int)(dec.Misc) 47 } 48 return nil 49 }