Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a method to compute transaction hashes #200

Open
tdelabro opened this issue Mar 22, 2024 · 0 comments
Open

add a method to compute transaction hashes #200

tdelabro opened this issue Mar 22, 2024 · 0 comments

Comments

@tdelabro
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant