Skip to content

add a method to compute transaction hashes #200

@tdelabro

Description

@tdelabro

Blockifier transaction types are build ontop of starknet API ones and require you to provide the transaction hash.
The tx hash can be computed based on the tx if you add the chain_id and boolean signaling if you need to offset the version number. You also can make it generic over a hashing function.

This logic should be implemented as a trait on every transaction type

trait ComputeTransactionHash {
  fn compute_hash<H: HasherT>(&self, chain_id: Starkfelt, offset_version: bool) -> TransactionHash;
}

This would avoid every lib consumer to reimplement this logic themselves everytime

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions