Skip to content

Commit 0c0ae84

Browse files
author
lukacan
committed
🔥 Update to the latest rc
1 parent 388ceaa commit 0c0ae84

44 files changed

Lines changed: 1725 additions & 1204 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/trident-fuzz.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
env:
1111
CARGO_TERM_COLOR: always
1212
SOLANA_VERSION: "v3.1.9"
13-
TRIDENT_VERSION: "0.13.0-rc.2"
13+
TRIDENT_VERSION: "0.13.0-rc.3"
1414

1515
jobs:
1616
build:

‎trident-tests/Cargo.lock‎

Lines changed: 52 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎trident-tests/Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ borsh = "1.5.3"
1414
squads-multisig = { git = "https://github.com/Squads-Protocol/v4", rev = "05f23726a094b6a5a0d97eaccf22af72373ac9c6" }
1515

1616
[dependencies.trident-fuzz]
17-
version = "0.13.0-rc.2"
17+
version = "0.13.0-rc.3"
1818
features = ["token"]
1919

2020
[lib]

‎trident-tests/common/conditional_vault.rs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub fn initialize_question(
3636

3737
let res = trident.process_transaction(&[init_question], message);
3838

39-
assert!(res.is_success());
39+
invariant!(res.is_success());
4040

4141
question
4242
}
@@ -87,7 +87,7 @@ pub fn initialize_conditional_vault(
8787

8888
let res = trident.process_transaction(&[init_cond_vault], message);
8989

90-
assert!(res.is_success());
90+
invariant!(res.is_success());
9191

9292
vault
9393
}
@@ -144,7 +144,7 @@ pub fn split_tokens(
144144

145145
let res = trident.process_transaction(&[split_ix], message);
146146

147-
assert!(res.is_success());
147+
invariant!(res.is_success());
148148
}
149149

150150
pub fn merge_tokens(
@@ -198,5 +198,5 @@ pub fn merge_tokens(
198198

199199
let res = trident.process_transaction(&[merge_ix], message);
200200

201-
assert!(res.is_success());
201+
invariant!(res.is_success());
202202
}

‎trident-tests/common/futarchy.rs‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ use super::types::futarchy::StakeToProposalInstructionAccounts;
44
use super::types::futarchy::StakeToProposalInstructionData;
55
use super::types::*;
66

7+
use trident_fuzz::fuzzing::prelude::TridentTransactionResult;
78
use trident_fuzz::fuzzing::*;
8-
use trident_fuzz::trident::transaction_result::TransactionResult;
99

1010
use super::constants::*;
1111
use super::types::futarchy::InitializeDaoParams;
@@ -65,7 +65,7 @@ pub fn initialize_dao(
6565

6666
let res = trident.process_transaction(&[init_dao], message);
6767

68-
assert!(res.is_success());
68+
invariant!(res.is_success());
6969

7070
(dao, squads_multisig)
7171
}
@@ -108,7 +108,7 @@ pub fn initialize_proposal(
108108

109109
let res = trident.process_transaction(&[init_prop], message);
110110

111-
assert!(res.is_success());
111+
invariant!(res.is_success());
112112

113113
proposal
114114
}
@@ -155,7 +155,7 @@ pub fn stake_to_proposal(
155155

156156
let res = trident.process_transaction(&[stake_to_proposal_ix], message);
157157

158-
assert!(res.is_success());
158+
invariant!(res.is_success());
159159
}
160160

161161
#[allow(clippy::too_many_arguments)]
@@ -222,7 +222,7 @@ pub fn launch_proposal(
222222

223223
let res = trident.process_transaction(&[launch_ix], message);
224224

225-
assert!(res.is_success());
225+
invariant!(res.is_success());
226226
}
227227

228228
pub fn spot_swap(
@@ -231,7 +231,7 @@ pub fn spot_swap(
231231
user: Pubkey,
232232
params: futarchy::SpotSwapParams,
233233
message: Option<&str>,
234-
) -> TransactionResult {
234+
) -> TridentTransactionResult {
235235
let dao_data = trident
236236
.get_account_with_type::<futarchy::Dao>(&dao, None)
237237
.expect("Dao not found");
@@ -273,7 +273,7 @@ pub fn add_liqidity(
273273
liquidity_provider: Pubkey,
274274
params: futarchy::ProvideLiquidityParams,
275275
message: Option<&str>,
276-
) -> TransactionResult {
276+
) -> TridentTransactionResult {
277277
let dao_data = trident
278278
.get_account_with_type::<futarchy::Dao>(&dao, None)
279279
.expect("Dao not found");
@@ -328,7 +328,7 @@ pub fn withdraw_liquidity(
328328
liquidity_provider: Pubkey,
329329
params: futarchy::WithdrawLiquidityParams,
330330
message: Option<&str>,
331-
) -> TransactionResult {
331+
) -> TridentTransactionResult {
332332
let dao_data = trident
333333
.get_account_with_type::<futarchy::Dao>(&dao, None)
334334
.expect("Dao not found");
@@ -395,7 +395,7 @@ pub fn conditional_swap(
395395
quote_vault: Pubkey,
396396
params: futarchy::ConditionalSwapParams,
397397
message: Option<&str>,
398-
) -> TransactionResult {
398+
) -> TridentTransactionResult {
399399
let dao_data = trident
400400
.get_account_with_type::<futarchy::Dao>(&dao, None)
401401
.expect("Dao not found");
@@ -488,7 +488,7 @@ pub fn finalize_proposal(
488488
base_vault: Pubkey,
489489
quote_vault: Pubkey,
490490
message: Option<&str>,
491-
) -> TransactionResult {
491+
) -> TridentTransactionResult {
492492
let dao_data = trident
493493
.get_account_with_type::<futarchy::Dao>(&dao, None)
494494
.expect("Dao not found");

‎trident-tests/common/squads.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub fn initialize_vault_transaction(
3434

3535
let res = trident.process_transaction(&[vault_tx_create], message);
3636

37-
assert!(res.is_success());
37+
invariant!(res.is_success());
3838
}
3939

4040
pub fn initialize_squads_proposal(
@@ -66,7 +66,7 @@ pub fn initialize_squads_proposal(
6666

6767
let res = trident.process_transaction(&[create_proposal], message);
6868

69-
assert!(res.is_success());
69+
invariant!(res.is_success());
7070

7171
squads_proposal
7272
}

‎trident-tests/common/token.rs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub fn initialize_mint(
1414
) {
1515
let ix = trident.initialize_mint(&payer, &mint, decimals, &owner, freeze_authority);
1616
let res = trident.process_transaction(&ix, message);
17-
assert!(res.is_success());
17+
invariant!(res.is_success());
1818
}
1919

2020
pub fn initialize_associated_token_account(
@@ -33,7 +33,7 @@ pub fn initialize_associated_token_account(
3333
let ix = trident.initialize_associated_token_account(&payer, &mint, &owner);
3434
let res = trident.process_transaction(&[ix], None);
3535

36-
assert!(res.is_success());
36+
invariant!(res.is_success());
3737
}
3838
}
3939

@@ -56,7 +56,7 @@ pub fn mint_to(
5656

5757
let res = trident.process_transaction(&[mint], None);
5858

59-
assert!(res.is_success());
59+
invariant!(res.is_success());
6060
}
6161

6262
pub fn get_or_initialize_associated_token_account(
@@ -70,7 +70,7 @@ pub fn get_or_initialize_associated_token_account(
7070
if trident.get_token_account(ata).is_err() {
7171
let ix = trident.initialize_associated_token_account(&payer, &mint, &owner);
7272
let res = trident.process_transaction(&[ix], None);
73-
assert!(res.is_success());
73+
invariant!(res.is_success());
7474
}
7575

7676
ata

0 commit comments

Comments
 (0)