diff options
Diffstat (limited to 'core/types/receipt.go')
-rw-r--r-- | core/types/receipt.go | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/core/types/receipt.go b/core/types/receipt.go index 70c10d422..0a6a35e33 100644 --- a/core/types/receipt.go +++ b/core/types/receipt.go @@ -25,7 +25,6 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/vm" "github.com/ethereum/go-ethereum/rlp" ) @@ -40,7 +39,7 @@ type Receipt struct { PostState []byte CumulativeGasUsed *big.Int Bloom Bloom - Logs vm.Logs + Logs []*Log // Implementation fields (don't reorder!) TxHash common.Hash @@ -52,7 +51,7 @@ type jsonReceipt struct { PostState *common.Hash `json:"root"` CumulativeGasUsed *hexutil.Big `json:"cumulativeGasUsed"` Bloom *Bloom `json:"logsBloom"` - Logs *vm.Logs `json:"logs"` + Logs []*Log `json:"logs"` TxHash *common.Hash `json:"transactionHash"` ContractAddress *common.Address `json:"contractAddress"` GasUsed *hexutil.Big `json:"gasUsed"` @@ -76,7 +75,7 @@ func (r *Receipt) DecodeRLP(s *rlp.Stream) error { PostState []byte CumulativeGasUsed *big.Int Bloom Bloom - Logs vm.Logs + Logs []*Log } if err := s.Decode(&receipt); err != nil { return err @@ -93,7 +92,7 @@ func (r *Receipt) MarshalJSON() ([]byte, error) { PostState: &root, CumulativeGasUsed: (*hexutil.Big)(r.CumulativeGasUsed), Bloom: &r.Bloom, - Logs: &r.Logs, + Logs: r.Logs, TxHash: &r.TxHash, ContractAddress: &r.ContractAddress, GasUsed: (*hexutil.Big)(r.GasUsed), @@ -120,7 +119,7 @@ func (r *Receipt) UnmarshalJSON(input []byte) error { PostState: (*dec.PostState)[:], CumulativeGasUsed: (*big.Int)(dec.CumulativeGasUsed), Bloom: *dec.Bloom, - Logs: *dec.Logs, + Logs: dec.Logs, TxHash: *dec.TxHash, GasUsed: (*big.Int)(dec.GasUsed), } @@ -142,9 +141,9 @@ type ReceiptForStorage Receipt // EncodeRLP implements rlp.Encoder, and flattens all content fields of a receipt // into an RLP stream. func (r *ReceiptForStorage) EncodeRLP(w io.Writer) error { - logs := make([]*vm.LogForStorage, len(r.Logs)) + logs := make([]*LogForStorage, len(r.Logs)) for i, log := range r.Logs { - logs[i] = (*vm.LogForStorage)(log) + logs[i] = (*LogForStorage)(log) } return rlp.Encode(w, []interface{}{r.PostState, r.CumulativeGasUsed, r.Bloom, r.TxHash, r.ContractAddress, logs, r.GasUsed}) } @@ -158,7 +157,7 @@ func (r *ReceiptForStorage) DecodeRLP(s *rlp.Stream) error { Bloom Bloom TxHash common.Hash ContractAddress common.Address - Logs []*vm.LogForStorage + Logs []*LogForStorage GasUsed *big.Int } if err := s.Decode(&receipt); err != nil { @@ -166,9 +165,9 @@ func (r *ReceiptForStorage) DecodeRLP(s *rlp.Stream) error { } // Assign the consensus fields r.PostState, r.CumulativeGasUsed, r.Bloom = receipt.PostState, receipt.CumulativeGasUsed, receipt.Bloom - r.Logs = make(vm.Logs, len(receipt.Logs)) + r.Logs = make([]*Log, len(receipt.Logs)) for i, log := range receipt.Logs { - r.Logs[i] = (*vm.Log)(log) + r.Logs[i] = (*Log)(log) } // Assign the implementation fields r.TxHash, r.ContractAddress, r.GasUsed = receipt.TxHash, receipt.ContractAddress, receipt.GasUsed |