diff --git a/crates/core/transaction/tests/generate_transaction_signing_test_vectors.rs b/crates/core/transaction/tests/generate_transaction_signing_test_vectors.rs index 0fa797c2ae..3000cd8057 100644 --- a/crates/core/transaction/tests/generate_transaction_signing_test_vectors.rs +++ b/crates/core/transaction/tests/generate_transaction_signing_test_vectors.rs @@ -16,6 +16,7 @@ use penumbra_dex::{ BatchSwapOutputData, TradingPair, }; use penumbra_fee::Fee; +use penumbra_governance::{Proposal, ProposalPayload, ProposalSubmit, ProposalWithdraw}; use penumbra_ibc::IbcRelay; use penumbra_keys::keys::{Bip44Path, SeedPhrase, SpendKey}; use penumbra_keys::{Address, FullViewingKey}; @@ -318,6 +319,33 @@ fn ibc_action_strategy() -> impl Strategy { }) } +fn proposal_strategy() -> impl Strategy { + ( + prop::string::string_regex(r"[a-z]+-[0-9]+").unwrap(), + prop::string::string_regex(r"[a-z]+-[0-9]+").unwrap(), + ) + .prop_map(|(title, description)| Proposal { + id: 0u64, + title, + description, + payload: ProposalPayload::Signaling { commit: None }, + }) +} + +fn proposal_submit_strategy() -> impl Strategy { + (proposal_strategy(), amount_strategy()).prop_map(|(proposal, deposit_amount)| ProposalSubmit { + proposal, + deposit_amount, + }) +} + +fn proposal_withdraw_strategy() -> impl Strategy { + (0u64..1000000000u64).prop_map(|proposal| ProposalWithdraw { + proposal, + reason: String::default(), + }) +} + fn action_plan_strategy(fvk: &FullViewingKey) -> impl Strategy { prop_oneof![ spend_plan_strategy(fvk).prop_map(ActionPlan::Spend), @@ -328,6 +356,8 @@ fn action_plan_strategy(fvk: &FullViewingKey) -> impl Strategy