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