func (l *Log) MarshalJSON() ([]byte, error) {
	jslog := &jsonLog{
		Address: &l.Address,
		Topics:  &l.Topics,
		Data:    (*hexutil.Bytes)(&l.Data),
		TxIndex: (*hexutil.Uint)(&l.TxIndex),
		TxHash:  &l.TxHash,
		Index:   (*hexutil.Uint)(&l.Index),
		Removed: l.Removed,
	}
	if (l.BlockHash != common.Hash{}) {
		jslog.BlockHash = &l.BlockHash
		jslog.BlockNumber = (*hexutil.Uint64)(&l.BlockNumber)
	}
	return json.Marshal(jslog)
}
MarshalJSON implements json.Marshaler.
package types
import (
	"encoding/json"
	"errors"
	"fmt"
	"io"
	"github.com/Baptist-Publication/chorus-module/lib/eth/common"
	"github.com/Baptist-Publication/chorus-module/lib/eth/common/hexutil"
	"github.com/Baptist-Publication/chorus-module/lib/eth/rlp"
)
var errMissingLogFields = errors.New("missing required JSON log fields")
type Log struct {
	Address common.Address  
	Topics  []common.Hash   
	Data    []byte          
	BlockNumber uint64       
	TxHash      common.Hash  
	TxIndex     uint         
	BlockHash   common.Hash  
	Index       uint         
	Removed bool
}
type rlpLog struct {
	Address common.Address
	Topics  []common.Hash
	Data    []byte
}
type rlpStorageLog struct {
	Address     common.Address
	Topics      []common.Hash
	Data        []byte
	BlockNumber uint64
	TxHash      common.Hash
	TxIndex     uint
	BlockHash   common.Hash
	Index       uint
}
type jsonLog struct {
	Address     *common.Address `json:"address"`
	Topics      *[]common.Hash  `json:"topics"`
	Data        *hexutil.Bytes  `json:"data"`
	BlockNumber *hexutil.Uint64 `json:"blockNumber"`
	TxIndex     *hexutil.Uint   `json:"transactionIndex"`
	TxHash      *common.Hash    `json:"transactionHash"`
	BlockHash   *common.Hash    `json:"blockHash"`
	Index       *hexutil.Uint   `json:"logIndex"`
	Removed     bool            `json:"removed"`
}
func (l *Log) EncodeRLP(w io.Writer) error {
	return rlp.Encode(w, rlpLog{Address: l.Address, Topics: l.Topics, Data: l.Data})
}
func (l *Log) DecodeRLP(s *rlp.Stream) error {
	var dec rlpLog
	err := s.Decode(&dec)
	if err == nil {
		l.Address, l.Topics, l.Data = dec.Address, dec.Topics, dec.Data
	}
	return err
}
func (l *Log) String() string {
	return fmt.Sprintf(`log: %x %x %x %x %d %x %d`, l.Address, l.Topics, l.Data, l.TxHash, l.TxIndex, l.BlockHash, l.Index)
}