View Source Signet.Receipt.Log (Signet v1.3.8)

Summary

Functions

Deserializes a transaction receipt as serialized by an Ethereum JSON-RPC response.

Types

@type t() :: %Signet.Receipt.Log{
  address: <<_::160>>,
  block_hash: <<_::256>>,
  block_number: integer(),
  data: binary(),
  log_index: integer(),
  topics: [<<_::256>>],
  transaction_hash: <<_::256>>,
  transaction_index: integer()
}

Functions

@spec deserialize(map()) :: t() | no_return()

Deserializes a transaction receipt as serialized by an Ethereum JSON-RPC response.

See also https://ethereum.org/en/developers/docs/apis/json-rpc#eth_gettransactionreceipt

Examples

iex> use Signet.Hex
iex> %{
...>   "logIndex" => "0x1",
...>   "blockNumber" => "0x1b4",
...>   "blockHash" => "0xa957d47df264a31badc3ae823e10ac1d444b098d9b73d204c40426e57f47e8c3",
...>   "transactionHash" =>  "0xaadf829c5a142f1fccd7d8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcf",
...>   "transactionIndex" => "0x0",
...>   "address" => "0x16c5785ac562ff41e2dcfdf829c5a142f1fccd7d",
...>   "data" => "0x0000000000000000000000000000000000000000000000000000000000000000",
...>   "topics" => [
...>     "0x59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a5"
...>   ]
...> }
...> |> Signet.Receipt.Log.deserialize()
%Signet.Receipt.Log{
  log_index: 1,
  block_number: 0x01b4,
  block_hash: ~h[0xa957d47df264a31badc3ae823e10ac1d444b098d9b73d204c40426e57f47e8c3],
  transaction_hash: ~h[0xaadf829c5a142f1fccd7d8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcf],
  transaction_index: 0,
  address: ~h[0x16c5785ac562ff41e2dcfdf829c5a142f1fccd7d],
  data: ~h[0x0000000000000000000000000000000000000000000000000000000000000000],
  topics: [
    ~h[0x59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a5]
  ]
}