mina_tree/generators/mod.rs
1use crate::scan_state::currency::Fee;
2
3pub mod user_command;
4pub mod zkapp_command;
5pub mod zkapp_command_builder;
6
7/// <https://github.com/MinaProtocol/mina/blob/3753a8593cc1577bcf4da16620daf9946d88e8e5/src/lib/mina_generators/zkapp_command_generators.ml#L20>
8#[derive(Clone, Debug)]
9pub enum Role {
10 FeePayer,
11 NewAccount,
12 OrdinaryParticipant,
13 NewTokenAccount,
14}
15
16/// <https://github.com/MinaProtocol/mina/blob/3753a8593cc1577bcf4da16620daf9946d88e8e5/src/lib/mina_generators/zkapp_command_generators.ml#L7>
17#[derive(Clone, Debug)]
18pub enum NotPermitedOf {
19 Delegate,
20 AppState,
21 VotingFor,
22 VerificationKey,
23 ZkappUri,
24 TokenSymbol,
25 Send,
26 Receive,
27}
28
29/// <https://github.com/MinaProtocol/mina/blob/3753a8593cc1577bcf4da16620daf9946d88e8e5/src/lib/mina_generators/zkapp_command_generators.ml#L7>
30#[derive(Clone, Debug)]
31pub enum Failure {
32 InvalidAccountPrecondition,
33 InvalidProtocolStatePrecondition,
34 UpdateNotPermitted(NotPermitedOf),
35}
36
37/// keep max_account_updates small, so zkApp integration tests don't need lots
38/// of block producers
39/// because the other zkapp_command are split into a permissions-setter
40/// and another account_update, the actual number of other zkapp_command is
41/// twice this value, plus one, for the "balancing" account_update
42/// when we have separate transaction accounts in integration tests
43/// this number can be increased
44///
45/// <https://github.com/MinaProtocol/mina/blob/3753a8593cc1577bcf4da16620daf9946d88e8e5/src/lib/mina_generators/zkapp_command_generators.ml#L1111>
46const MAX_ACCOUNT_UPDATES: usize = 2;
47
48/// <https://github.com/MinaProtocol/mina/blob/3753a8593cc1577bcf4da16620daf9946d88e8e5/src/lib/mina_generators/zkapp_command_generators.ml#L1113>
49const MAX_TOKEN_UPDATES: usize = 2;
50
51/// Value when we run `dune runtest src/lib/staged_ledger -f`
52const ACCOUNT_CREATION_FEE: Fee = Fee::from_u64(1000000000);
53
54const MINIMUM_USER_COMMAND_FEE: Fee = Fee::from_u64(1000000);
55
56/// Value of `ledger_depth` when we run `dune runtest src/lib/staged_ledger -f`
57///
58/// <https://github.com/MinaProtocol/mina/blob/3753a8593cc1577bcf4da16620daf9946d88e8e5/src/lib/mina_generators/user_command_generators.ml#L15>
59const LEDGER_DEPTH: usize = 35;