[Katana] Unit tests for hash computations
Write unit tests for all the hash computation functions in this module like so:
https://github.com/dojoengine/dojo/blob/5a7ecd8624a235c2b4e365d73612a952c0611716/crates/katana/primitives/src/utils/transaction.rs#L318-L323
The tests should use actual values from the live network (eg mainnet).
We need unit tests for:
- DeployAccount v3
- Declare v1,v2,v3
- Invoke v1,v3
- L1Handler v1
- L1 message hash
Will like to take care of this one!
Will like to take care of this one!
assigned!
@kariy @glihm (or anybody who knows) I need help with this... how can I find real transactions on Voyager that match the criteria for every test? Deploy account, Declare and Invoke transactions, for v1, v2 and v3 for each... I'm I supposed to create those transactions?
@kariy @glihm (or anybody who knows) I need help with this... how can I find real transactions on Voyager that match the criteria for every test?
Deploy account, Declare and Invoke transactions, for v1, v2 and v3 for each... I'm I supposed to create those transactions?
You can just pick any txs (of each type) on Voyager then take their hash and the tx data that are used as inputs for the tx hash computation.
For example, to compute a invoke tx hash you'd need these data:
https://github.com/dojoengine/dojo/blob/5a7ecd8624a235c2b4e365d73612a952c0611716/crates/katana/primitives/src/utils/transaction.rs#L187-L194
starknet docs for extra reference: https://docs.starknet.io/documentation/architecture_and_concepts/Network_Architecture/transactions/
hi @glihm, I would love to work on this
hey @Jonatan-Chaverri because there hasn't been any progress so far, i will be assigning this to @g4titanx instead.
@kariy Sure, sorry, have been busy these months with hackathons and other stuff. You can go ahead @g4titanx
okay, thanks
hi @kariy do you know of a faster way to search for versions of txs on voyager? i am having zero-luck finding a v3 declare type. i mean, since it's a v3 it should be among the latest txs. but even the latest txs dont use v3
hi @kariy do you know of a faster way to search for versions of txs on voyager? i am having zero-luck finding a v3 declare type. i mean, since it's a v3 it should be among the latest txs. but even the latest txs dont use v3
good question, tbh im also not sure. both starkscan and voyager doesn't seem to allow filtering by tx version.
i looked around the pathfinder repo for this, and maybe we can just copy the tx data for declare v3 from them https://github.com/eqlabs/pathfinder/blob/a133f157bda062187d99129367a0b18182476470/crates/common/src/transaction.rs#L1083.
hi @kariy do you know of a faster way to search for versions of txs on voyager? i am having zero-luck finding a v3 declare type. i mean, since it's a v3 it should be among the latest txs. but even the latest txs dont use v3
good question, tbh im also not sure. both starkscan and voyager doesn't seem to allow filtering by tx version.
i looked around the pathfinder repo for this, and maybe we can just copy the tx data for declare v3 from them https://github.com/eqlabs/pathfinder/blob/a133f157bda062187d99129367a0b18182476470/crates/common/src/transaction.rs#L1083.
yeah, we could. i entered the hash on voyager, there is no record of it tho. does it make sense to use that same hash?
hi @kariy do you know of a faster way to search for versions of txs on voyager? i am having zero-luck finding a v3 declare type. i mean, since it's a v3 it should be among the latest txs. but even the latest txs dont use v3
good question, tbh im also not sure. both starkscan and voyager doesn't seem to allow filtering by tx version. i looked around the pathfinder repo for this, and maybe we can just copy the tx data for declare v3 from them https://github.com/eqlabs/pathfinder/blob/a133f157bda062187d99129367a0b18182476470/crates/common/src/transaction.rs#L1083.
yeah, we could. i entered the hash on voyager, there is no record of it tho.
based on the test cases, it seems to be a tx from SN_GOERLI chain (which is now deprecated). lets just use that one.
does it make sense to use that same hash?
we just need to use chain id for SN_GOERLI when we compute the hash
alright then
we just need to use chain id for SN_GOERLI when we compute the hash
how do i reference the SN_GOERLI tho, it's not part of the chain id enum here
we just need to use chain id for SN_GOERLI when we compute the hash
how do i reference the SN_GOERLI tho, it's not part of the chain id enum here
replied on the PR, basically lets use Katana's own type for chain id, instead of starknet-rs's.
okay.
completed #2216