go-ethereum/ethclient/gethclient/gen_calllog_json.go
Ragnar 15a9e92bbd
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
ethclient/gethclient: callTracer methods (#31510)
Added methods `TraceCallWithCallTracer` and `TraceTransactionWithCallTracer`.

Fixes #28182

---------

Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2026-02-10 17:54:37 +01:00

61 lines
1.4 KiB
Go

// Code generated by github.com/fjl/gencodec. DO NOT EDIT.
package gethclient
import (
"encoding/json"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
)
var _ = (*callLogMarshaling)(nil)
// MarshalJSON marshals as JSON.
func (c CallLog) MarshalJSON() ([]byte, error) {
type CallLog struct {
Address common.Address `json:"address"`
Topics []common.Hash `json:"topics"`
Data hexutil.Bytes `json:"data"`
Index hexutil.Uint `json:"index"`
Position hexutil.Uint `json:"position"`
}
var enc CallLog
enc.Address = c.Address
enc.Topics = c.Topics
enc.Data = c.Data
enc.Index = hexutil.Uint(c.Index)
enc.Position = hexutil.Uint(c.Position)
return json.Marshal(&enc)
}
// UnmarshalJSON unmarshals from JSON.
func (c *CallLog) UnmarshalJSON(input []byte) error {
type CallLog struct {
Address *common.Address `json:"address"`
Topics []common.Hash `json:"topics"`
Data *hexutil.Bytes `json:"data"`
Index *hexutil.Uint `json:"index"`
Position *hexutil.Uint `json:"position"`
}
var dec CallLog
if err := json.Unmarshal(input, &dec); err != nil {
return err
}
if dec.Address != nil {
c.Address = *dec.Address
}
if dec.Topics != nil {
c.Topics = dec.Topics
}
if dec.Data != nil {
c.Data = *dec.Data
}
if dec.Index != nil {
c.Index = uint(*dec.Index)
}
if dec.Position != nil {
c.Position = uint(*dec.Position)
}
return nil
}