@ -26,6 +26,8 @@ func (r Receipt) MarshalJSON() ([]byte, error) {
ContractAddress common . Address ` json:"contractAddress" `
GasUsed hexutil . Uint64 ` json:"gasUsed" gencodec:"required" `
EffectiveGasPrice * hexutil . Big ` json:"effectiveGasPrice" `
DataGasUsed uint64 ` json:"dataGasUsed,omitempty" `
DataGasPrice * big . Int ` json:"dataGasPrice,omitempty" `
BlockHash common . Hash ` json:"blockHash,omitempty" `
BlockNumber * hexutil . Big ` json:"blockNumber,omitempty" `
TransactionIndex hexutil . Uint ` json:"transactionIndex" `
@ -41,6 +43,8 @@ func (r Receipt) MarshalJSON() ([]byte, error) {
enc . ContractAddress = r . ContractAddress
enc . GasUsed = hexutil . Uint64 ( r . GasUsed )
enc . EffectiveGasPrice = ( * hexutil . Big ) ( r . EffectiveGasPrice )
enc . DataGasUsed = r . DataGasUsed
enc . DataGasPrice = r . DataGasPrice
enc . BlockHash = r . BlockHash
enc . BlockNumber = ( * hexutil . Big ) ( r . BlockNumber )
enc . TransactionIndex = hexutil . Uint ( r . TransactionIndex )
@ -60,6 +64,8 @@ func (r *Receipt) UnmarshalJSON(input []byte) error {
ContractAddress * common . Address ` json:"contractAddress" `
GasUsed * hexutil . Uint64 ` json:"gasUsed" gencodec:"required" `
EffectiveGasPrice * hexutil . Big ` json:"effectiveGasPrice" `
DataGasUsed * uint64 ` json:"dataGasUsed,omitempty" `
DataGasPrice * big . Int ` json:"dataGasPrice,omitempty" `
BlockHash * common . Hash ` json:"blockHash,omitempty" `
BlockNumber * hexutil . Big ` json:"blockNumber,omitempty" `
TransactionIndex * hexutil . Uint ` json:"transactionIndex" `
@ -103,6 +109,12 @@ func (r *Receipt) UnmarshalJSON(input []byte) error {
if dec . EffectiveGasPrice != nil {
r . EffectiveGasPrice = ( * big . Int ) ( dec . EffectiveGasPrice )
}
if dec . DataGasUsed != nil {
r . DataGasUsed = * dec . DataGasUsed
}
if dec . DataGasPrice != nil {
r . DataGasPrice = dec . DataGasPrice
}
if dec . BlockHash != nil {
r . BlockHash = * dec . BlockHash
}