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

DeclareTransactionV0V1 make it impossible to create all encompasing ComputeTransactionHash #210

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

Comments

@tdelabro
Copy link
Contributor

This trait should exist and be implemented on each transaction type:

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

The problem is that in order to compute the hash of a transaction, we need to know its version. And with DeclareTransactionV0V1 we can't know what is the actual version without some external additional data, it could be 0 it could be 1, making it impossible to use the same trait as for the other transaction types.

I propose this type is removed, and split into two different structs.

Also, correct me if I'm wrong, but DeclareV0 has no nonce, so there is no reason to represent it with a type that contains a nonce field

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