penumbra_governance/
state_key.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
use penumbra_sct::Nullifier;
use penumbra_stake::IdentityKey;

pub fn governance_params() -> &'static str {
    "governance/params"
}

pub fn next_proposal_id() -> &'static str {
    "governance/next_proposal_id"
}

pub fn proposal_definition(proposal_id: u64) -> String {
    format!("governance/proposal/{proposal_id:020}/data")
}

pub fn community_pool_transaction(proposal_id: u64) -> String {
    format!("governance/proposal/{proposal_id:020}/community_pool_transaction")
}

pub fn proposal_state(proposal_id: u64) -> String {
    format!("governance/proposal/{proposal_id:020}/state")
}

pub fn proposal_deposit_amount(proposal_id: u64) -> String {
    format!("governance/proposal/{proposal_id:020}/deposit_amount")
}

pub fn proposal_voting_start(proposal_id: u64) -> String {
    format!("governance/proposal/{proposal_id:020}/voting_start")
}

pub fn proposal_voting_start_position(proposal_id: u64) -> String {
    format!("governance/proposal/{proposal_id:020}/voting_start_position")
}

pub fn proposal_voting_end(proposal_id: u64) -> String {
    format!("governance/proposal/{proposal_id:020}/voting_end")
}

pub fn unfinished_proposal(proposal_id: u64) -> String {
    format!("governance/unfinished_proposals/{proposal_id:020}")
}

pub fn all_unfinished_proposals() -> &'static str {
    // Note: this has to be the prefix of the `unfinished_proposal` function above.
    "governance/unfinished_proposals/"
}

pub fn voted_nullifier_lookup_for_proposal(proposal_id: u64, nullifier: &Nullifier) -> String {
    format!("governance/proposal/{proposal_id:020}/voted_nullifiers/{nullifier}")
}

pub fn rate_data_at_proposal_start(proposal_id: u64, identity_key: IdentityKey) -> String {
    format!("governance/proposal/{proposal_id:020}/rate_data_at_start/{identity_key}")
}

pub fn all_rate_data_at_proposal_start(proposal_id: u64) -> String {
    // Note: this has to be the prefix of the `rate_data_at_proposal_start` function above.
    format!("governance/proposal/{proposal_id:020}/rate_data_at_start/")
}

pub fn voting_power_at_proposal_start(proposal_id: u64, identity_key: IdentityKey) -> String {
    format!("governance/proposal/{proposal_id:020}/voting_power_at_start/{identity_key}")
}

pub fn all_voting_power_at_proposal_start(proposal_id: u64) -> String {
    // Note: this has to be the prefix of the `voting_power_at_proposal_start` function above.
    format!("governance/proposal/{proposal_id:020}/voting_power_at_start/")
}

pub fn validator_vote(proposal_id: u64, identity_key: IdentityKey) -> String {
    format!("governance/validator_vote/{proposal_id:020}/{identity_key}")
}

pub fn validator_vote_reason(proposal_id: u64, identity_key: IdentityKey) -> String {
    format!("governance/validator_vote_reason/{proposal_id:020}/{identity_key}")
}

pub fn all_validator_votes_for_proposal(proposal_id: u64) -> String {
    // Note: this has to be the prefix of the `validator_vote` function above.
    format!("governance/validator_vote/{proposal_id:020}/")
}

pub fn tallied_delegator_votes(proposal_id: u64, identity_key: IdentityKey) -> String {
    format!("governance/tallied_delegator_votes/{proposal_id:020}/{identity_key}")
}

pub fn all_tallied_delegator_votes_for_proposal(proposal_id: u64) -> String {
    // Note: this has to be the prefix of the `tallied_delegator_votes` function above.
    format!("governance/tallied_delegator_votes/{proposal_id:020}/")
}

pub fn untallied_delegator_vote(
    proposal_id: u64,
    identity_key: IdentityKey,
    nullifier: &Nullifier,
) -> String {
    format!("governance/untallied_delegator_vote/{proposal_id:020}/{identity_key}/{nullifier}")
}

pub fn all_untallied_delegator_votes_for_proposal(proposal_id: u64) -> String {
    // Note: this has to be the prefix of the `untallied_delegator_vote` function above.
    format!("governance/untallied_delegator_vote/{proposal_id:020}/")
}

pub fn all_untallied_delegator_votes() -> &'static str {
    // Note: this has to be the prefix of the `untallied_delegator_vote` function above.
    "governance/untallied_delegator_vote/"
}

pub fn deliver_single_community_pool_transaction_at_height(
    block_height: u64,
    proposal_id: u64,
) -> String {
    format!("governance/deliver_community_pool_transactions/{block_height}/{proposal_id:020}")
}

pub fn deliver_community_pool_transactions_at_height(block_height: u64) -> String {
    // Note: this has to be the prefix of the `deliver_single_community_pool_transaction_at_height` function above.
    format!("governance/deliver_community_pool_transactions/{block_height}/")
}

pub fn param_changes_for_height(block_height: u64) -> String {
    format!("governance/param_changes/{block_height}/")
}

pub fn proposal_started() -> &'static str {
    "governance/proposal_started"
}

pub mod upgrades {
    pub fn next_upgrade() -> &'static str {
        "governance/upgrades/next_upgrade"
    }
}

pub mod persistent_flags {
    pub fn halt_bit() -> &'static str {
        "governance/persistent_flags/halt_bit"
    }
}