blockchain v0.1.5 Blockchain.Transaction.Receipt
This module specifies functions to create and interact with the transaction receipt, defined in Section 4.4.1 of the Yellow Paper.
Transaction receipts track incremental state changes after each transaction (e.g. how much gas has been expended).
Link to this section Summary
Functions
Decodes a transaction receipt based on the serialization format
defined in Eq.(20). This is the inverse of serialize/1
Encodes a transaction receipt such that it can be RLP encoded. This is defined in Eq.(20) of the Yellow Paper
Link to this section Types
t() :: %Blockchain.Transaction.Receipt{bloom_filter: binary, cumulative_gas: EVM.Gas.t, logs: EVM.SubState.logs, state: EVM.trie_root}
Link to this section Functions
Decodes a transaction receipt based on the serialization format
defined in Eq.(20). This is the inverse of serialize/1
.
Examples
iex> Blockchain.Transaction.Receipt.deserialize([<<1,2,3>>, <<5>>, <<2,3,4>>, “hi mom”]) %Blockchain.Transaction.Receipt{state: <<1,2,3>>, cumulative_gas: 5, bloom_filter: <<2,3,4>>, logs: “hi mom”}
iex> Blockchain.Transaction.Receipt.deserialize([<<>>, <<0>>, <<>>, <<>>]) %Blockchain.Transaction.Receipt{}
Encodes a transaction receipt such that it can be RLP encoded. This is defined in Eq.(20) of the Yellow Paper.
Examples
iex> Blockchain.Transaction.Receipt.serialize(%Blockchain.Transaction.Receipt{})
[<<>>, 0, <<>>, <<>>]
iex> Blockchain.Transaction.Receipt.serialize(%Blockchain.Transaction.Receipt{state: <<1,2,3>>, cumulative_gas: 5, bloom_filter: <<2,3,4>>, logs: "hi mom"})
[<<1,2,3>>, 5, <<2,3,4>>, "hi mom"]