|
|
@ -20,9 +20,9 @@ func (l Log) MarshalJSON() ([]byte, error) { |
|
|
|
Data hexutil.Bytes `json:"data" gencodec:"required"` |
|
|
|
Data hexutil.Bytes `json:"data" gencodec:"required"` |
|
|
|
BlockNumber hexutil.Uint64 `json:"blockNumber"` |
|
|
|
BlockNumber hexutil.Uint64 `json:"blockNumber"` |
|
|
|
TxHash common.Hash `json:"transactionHash" gencodec:"required"` |
|
|
|
TxHash common.Hash `json:"transactionHash" gencodec:"required"` |
|
|
|
TxIndex hexutil.Uint `json:"transactionIndex" gencodec:"required"` |
|
|
|
TxIndex hexutil.Uint `json:"transactionIndex"` |
|
|
|
BlockHash common.Hash `json:"blockHash"` |
|
|
|
BlockHash common.Hash `json:"blockHash"` |
|
|
|
Index hexutil.Uint `json:"logIndex" gencodec:"required"` |
|
|
|
Index hexutil.Uint `json:"logIndex"` |
|
|
|
Removed bool `json:"removed"` |
|
|
|
Removed bool `json:"removed"` |
|
|
|
} |
|
|
|
} |
|
|
|
var enc Log |
|
|
|
var enc Log |
|
|
@ -46,9 +46,9 @@ func (l *Log) UnmarshalJSON(input []byte) error { |
|
|
|
Data *hexutil.Bytes `json:"data" gencodec:"required"` |
|
|
|
Data *hexutil.Bytes `json:"data" gencodec:"required"` |
|
|
|
BlockNumber *hexutil.Uint64 `json:"blockNumber"` |
|
|
|
BlockNumber *hexutil.Uint64 `json:"blockNumber"` |
|
|
|
TxHash *common.Hash `json:"transactionHash" gencodec:"required"` |
|
|
|
TxHash *common.Hash `json:"transactionHash" gencodec:"required"` |
|
|
|
TxIndex *hexutil.Uint `json:"transactionIndex" gencodec:"required"` |
|
|
|
TxIndex *hexutil.Uint `json:"transactionIndex"` |
|
|
|
BlockHash *common.Hash `json:"blockHash"` |
|
|
|
BlockHash *common.Hash `json:"blockHash"` |
|
|
|
Index *hexutil.Uint `json:"logIndex" gencodec:"required"` |
|
|
|
Index *hexutil.Uint `json:"logIndex"` |
|
|
|
Removed *bool `json:"removed"` |
|
|
|
Removed *bool `json:"removed"` |
|
|
|
} |
|
|
|
} |
|
|
|
var dec Log |
|
|
|
var dec Log |
|
|
@ -74,17 +74,15 @@ func (l *Log) UnmarshalJSON(input []byte) error { |
|
|
|
return errors.New("missing required field 'transactionHash' for Log") |
|
|
|
return errors.New("missing required field 'transactionHash' for Log") |
|
|
|
} |
|
|
|
} |
|
|
|
l.TxHash = *dec.TxHash |
|
|
|
l.TxHash = *dec.TxHash |
|
|
|
if dec.TxIndex == nil { |
|
|
|
if dec.TxIndex != nil { |
|
|
|
return errors.New("missing required field 'transactionIndex' for Log") |
|
|
|
l.TxIndex = uint(*dec.TxIndex) |
|
|
|
} |
|
|
|
} |
|
|
|
l.TxIndex = uint(*dec.TxIndex) |
|
|
|
|
|
|
|
if dec.BlockHash != nil { |
|
|
|
if dec.BlockHash != nil { |
|
|
|
l.BlockHash = *dec.BlockHash |
|
|
|
l.BlockHash = *dec.BlockHash |
|
|
|
} |
|
|
|
} |
|
|
|
if dec.Index == nil { |
|
|
|
if dec.Index != nil { |
|
|
|
return errors.New("missing required field 'logIndex' for Log") |
|
|
|
l.Index = uint(*dec.Index) |
|
|
|
} |
|
|
|
} |
|
|
|
l.Index = uint(*dec.Index) |
|
|
|
|
|
|
|
if dec.Removed != nil { |
|
|
|
if dec.Removed != nil { |
|
|
|
l.Removed = *dec.Removed |
|
|
|
l.Removed = *dec.Removed |
|
|
|
} |
|
|
|
} |
|
|
|