Skip to main content

hash_transaction

Function hash_transaction 

Source
pub fn hash_transaction(
    header: &TransactionHeader,
    read_slots: &[TransactionSlot],
    write_slots: &[TransactionSlot],
    payload: &[u128],
    nonce: u64,
) -> Option<[u8; 32]>
Expand description

Create transaction hash used for signing with sign().

The hash input is the serialized transaction (see Transaction::try_from_bytes()) with a Seal containing nonce, without the signature at the end of the seal.

hash_and_sign() helper function exists that combines this method with sign().

Returns None if there are more slots or payload bytes than [SerializedTransactionLengths] can describe, in which case it is not a transaction.