eth / org.apache.tuweni.eth / TransactionReceipt

TransactionReceipt

class TransactionReceipt (source)

A transaction receipt, containing information pertaining a transaction execution.

Transaction receipts have two different formats: state root-encoded and status-encoded. The difference between these two formats is that the state root-encoded transaction receipt contains the state root for world state after the transaction has been processed (e.g. not invalid) and the status-encoded transaction receipt instead has contains the status of the transaction (e.g. 1 for success and 0 for failure). The other transaction receipt fields are the same for both formats: logs, logs bloom, and cumulative gas used in the block. The TransactionReceiptType attribute is the best way to check which format has been used.

Constructors

<init>

TransactionReceipt(stateRoot: Bytes32, cumulativeGasUsed: Long, bloomFilter: LogsBloomFilter, logs: MutableList<Log>)

Creates an instance of a state root-encoded transaction receipt.

TransactionReceipt(status: Int, cumulativeGasUsed: Long, bloomFilter: LogsBloomFilter, logs: MutableList<Log>)

Creates an instance of a status-encoded transaction receipt.

Functions

bloomFilter

fun bloomFilter(): LogsBloomFilter

Returns the logs bloom filter for the logs generated by the transaction

cumulativeGasUsed

fun cumulativeGasUsed(): Long

Returns the total amount of gas consumed in the block after the transaction has been processed.

equals

fun equals(other: Any?): Boolean

fromBytes

static fun fromBytes(bytes: Bytes): TransactionReceipt

Read a transaction receipt from its RLP serialized representation

hashCode

fun hashCode(): Int

isValid

fun isValid(): Boolean

Computes the logs bloom filters of the current receipt and compares it to the bloom filter stored.

logs

fun logs(): MutableList<Log>

Returns the logs generated by the transaction.

readFrom

static fun readFrom(reader: RLPReader): TransactionReceipt

Creates a transaction receipt for the given RLP

stateRoot

fun stateRoot(): Bytes32

Returns the state root for a state root-encoded transaction receipt

status

fun status(): Int

Returns the status code for the status-encoded transaction receipt

toBytes

fun toBytes(): Bytes

Writes the transaction receipt into a serialized RLP form.

toString

fun toString(): String

writeTo

fun writeTo(writer: RLPWriter): Unit

Write an RLP representation.