Skip to content

DeclareTransactionV0V1 make it impossible to create all encompasing ComputeTransactionHash #210

@tdelabro

Description

@tdelabro

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

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