Skip to content

Commit aaf5302

Browse files
authored
Merge pull request #3 from Ackee-Blockchain/add/ppv2-fuzz-tests
Add/ppv2 fuzz tests
2 parents 172a036 + 8a4f3cf commit aaf5302

16 files changed

Lines changed: 3100 additions & 0 deletions

trident-tests/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ path = "fuzz_launchpad/test_fuzz.rs"
4444
name = "fuzz_pbpp"
4545
path = "fuzz_pbpp/test_fuzz.rs"
4646

47+
[[bin]]
48+
name = "fuzz_ppv2"
49+
path = "fuzz_ppv2/test_fuzz.rs"
50+
4751
[[bin]]
4852
name = "fuzz_mint_governor"
4953
path = "fuzz_mint_governor/test_fuzz.rs"

trident-tests/Trident.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ program = "../target/deploy/price_based_performance_package.so"
2727
address = "gvnr27cVeyW3AVf3acL7VCJ5WjGAphytnsgcK1feHyH"
2828
program = "../target/deploy/mint_governor.so"
2929

30+
[[fuzz.programs]]
31+
address = "pPV2pfrxnmstSb9j7kEeCLny5BGj6SNwCWGd6xbGGzz"
32+
program = "../target/deploy/performance_package_v2.so"
33+
3034

3135
# ==============================
3236
# External Programs

trident-tests/common/pda.rs

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ use super::types::bid_wall;
33
use super::types::conditional_vault;
44
use super::types::futarchy;
55
use super::types::launchpad_v_7;
6+
use super::types::mint_governor;
7+
use super::types::performance_package_v_2;
68
use super::types::price_based_performance_package;
79

810
use trident_fuzz::fuzzing::*;
@@ -45,6 +47,60 @@ pub fn get_change_request_pda(
4547
.0
4648
}
4749

50+
pub fn get_performance_package_pda_v2(trident: &mut Trident, create_key: Pubkey) -> Pubkey {
51+
trident
52+
.find_program_address(
53+
&[PERFORMANCE_PACKAGE_SEED_PREFIX, create_key.as_ref()],
54+
&performance_package_v_2::program_id(),
55+
)
56+
.0
57+
}
58+
59+
pub fn get_change_request_pda_v2(
60+
trident: &mut Trident,
61+
performance_package: Pubkey,
62+
proposer: Pubkey,
63+
pda_nonce: u32,
64+
) -> Pubkey {
65+
trident
66+
.find_program_address(
67+
&[
68+
CHANGE_REQUEST_SEED_PREFIX,
69+
performance_package.as_ref(),
70+
proposer.as_ref(),
71+
pda_nonce.to_le_bytes().as_ref(),
72+
],
73+
&performance_package_v_2::program_id(),
74+
)
75+
.0
76+
}
77+
78+
pub fn get_mint_governor_pda(trident: &mut Trident, mint: Pubkey, create_key: Pubkey) -> Pubkey {
79+
trident
80+
.find_program_address(
81+
&[b"mint_governor", mint.as_ref(), create_key.as_ref()],
82+
&mint_governor::program_id(),
83+
)
84+
.0
85+
}
86+
87+
pub fn get_mint_authority_pda(
88+
trident: &mut Trident,
89+
mint_governor: Pubkey,
90+
authorized_minter: Pubkey,
91+
) -> Pubkey {
92+
trident
93+
.find_program_address(
94+
&[
95+
b"mint_authority",
96+
mint_governor.as_ref(),
97+
authorized_minter.as_ref(),
98+
],
99+
&mint_governor::program_id(),
100+
)
101+
.0
102+
}
103+
48104
pub fn get_launchpad_pda(trident: &mut Trident, base_mint: Pubkey) -> Pubkey {
49105
trident
50106
.find_program_address(

0 commit comments

Comments
 (0)