diff --git a/CHANGELOG.md b/CHANGELOG.md index f972fa76..8d621cf9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 incremented upon a breaking change and the patch version will be incremented for features. ## [dev] - Unreleased +- impr/ add feature flag to the AccountsSnapshots macro ([183](https://github.com/Ackee-Blockchain/trident/pull/183)) - feat/ add Support for CPI ([182](https://github.com/Ackee-Blockchain/trident/pull/182)) - feat/ add option to initialize Trident with Macro/File (for Snapshots) option based on preference ([179](https://github.com/Ackee-Blockchain/trident/pull/179)) - del/remove localnet subcommand ([178](https://github.com/Ackee-Blockchain/trident/pull/178)) diff --git a/examples/fuzz-tests/cpi-metaplex-7/Cargo.lock b/examples/fuzz-tests/cpi-metaplex-7/Cargo.lock index bc62e2d2..c32d1099 100644 --- a/examples/fuzz-tests/cpi-metaplex-7/Cargo.lock +++ b/examples/fuzz-tests/cpi-metaplex-7/Cargo.lock @@ -1203,7 +1203,8 @@ dependencies = [ "anchor-lang", "anchor-spl", "mpl-token-metadata", - "trident-client", + "trident-derive-accounts-snapshots", + "trident-fuzz", ] [[package]] @@ -6343,10 +6344,10 @@ dependencies = [ name = "trident-derive-accounts-snapshots" version = "0.0.1" dependencies = [ + "anchor-syn", "proc-macro2", "quote", "syn 1.0.109", - "trident-fuzz", ] [[package]] diff --git a/examples/fuzz-tests/cpi-metaplex-7/programs/cpi-metaplex-7/Cargo.toml b/examples/fuzz-tests/cpi-metaplex-7/programs/cpi-metaplex-7/Cargo.toml index 53fd2667..ad878cfa 100644 --- a/examples/fuzz-tests/cpi-metaplex-7/programs/cpi-metaplex-7/Cargo.toml +++ b/examples/fuzz-tests/cpi-metaplex-7/programs/cpi-metaplex-7/Cargo.toml @@ -15,9 +15,12 @@ no-entrypoint = [] no-idl = [] no-log-ix-name = [] idl-build = ["anchor-lang/idl-build", "anchor-spl/idl-build"] +trident-fuzzing = ["dep:trident-fuzz"] + [dependencies] anchor-lang = "0.30.1" anchor-spl = "0.30.1" mpl-token-metadata = "4.1.2" -trident-client = { path = "../../../../../crates/client" } +trident-derive-accounts-snapshots = { path = "../../../../../crates/fuzz/derive/accounts_snapshots" } +trident-fuzz = { path = "../../../../../crates/fuzz", optional = true } diff --git a/examples/fuzz-tests/cpi-metaplex-7/programs/cpi-metaplex-7/src/lib.rs b/examples/fuzz-tests/cpi-metaplex-7/programs/cpi-metaplex-7/src/lib.rs index cc3a5eac..82334497 100644 --- a/examples/fuzz-tests/cpi-metaplex-7/programs/cpi-metaplex-7/src/lib.rs +++ b/examples/fuzz-tests/cpi-metaplex-7/programs/cpi-metaplex-7/src/lib.rs @@ -9,7 +9,7 @@ use mpl_token_metadata::{ ID as MPL_METADATA_PROGRAM, }; -use trident_client::fuzzing::AccountsSnapshots; +use trident_derive_accounts_snapshots::AccountsSnapshots; declare_id!("3XtULmXDGS867VbBXiPkjYr4EMjytGW8X12F6BS23Zcw"); @@ -47,7 +47,7 @@ pub struct Initialize<'info> { )] pub mint: Account<'info, Mint>, - // CHECK: Will be initialized + /// CHECK: Will be initialized #[account(mut)] pub metadata_account: UncheckedAccount<'info>, pub mpl_token_metadata: Program<'info, MplTokenMetadataProgram>, diff --git a/examples/fuzz-tests/cpi-metaplex-7/trident-tests/fuzz_tests/Cargo.toml b/examples/fuzz-tests/cpi-metaplex-7/trident-tests/fuzz_tests/Cargo.toml index 021e69b0..57ce3b7d 100644 --- a/examples/fuzz-tests/cpi-metaplex-7/trident-tests/fuzz_tests/Cargo.toml +++ b/examples/fuzz-tests/cpi-metaplex-7/trident-tests/fuzz_tests/Cargo.toml @@ -20,3 +20,4 @@ path = "../../../../../crates/client" [dependencies.cpi-metaplex-7] path = "../../programs/cpi-metaplex-7" +features = ["trident-fuzzing"] diff --git a/examples/fuzz-tests/cpi-metaplex-7/trident-tests/fuzz_tests/fuzz_0/fuzz_instructions.rs b/examples/fuzz-tests/cpi-metaplex-7/trident-tests/fuzz_tests/fuzz_0/fuzz_instructions.rs index 4ad8ffae..639366db 100644 --- a/examples/fuzz-tests/cpi-metaplex-7/trident-tests/fuzz_tests/fuzz_0/fuzz_instructions.rs +++ b/examples/fuzz-tests/cpi-metaplex-7/trident-tests/fuzz_tests/fuzz_0/fuzz_instructions.rs @@ -1,5 +1,5 @@ pub mod cpi_metaplex_7_fuzz_instructions { - use cpi_metaplex_7::trident_fuzz_initialize_snapshot::InitializeSnapshot; + use cpi_metaplex_7::trident_fuzz_Initialize_snapshot::InitializeSnapshot; use solana_sdk::native_token::LAMPORTS_PER_SOL; use trident_client::fuzzing::*; #[derive(Arbitrary, DisplayIx, FuzzTestExecutor, FuzzDeserialize)] diff --git a/examples/fuzz-tests/simple-cpi-6/Cargo.lock b/examples/fuzz-tests/simple-cpi-6/Cargo.lock index c60fc311..033dbfb0 100644 --- a/examples/fuzz-tests/simple-cpi-6/Cargo.lock +++ b/examples/fuzz-tests/simple-cpi-6/Cargo.lock @@ -955,7 +955,8 @@ version = "0.1.0" dependencies = [ "anchor-lang", "callee", - "trident-client", + "trident-derive-accounts-snapshots", + "trident-fuzz", ] [[package]] @@ -6138,10 +6139,10 @@ dependencies = [ name = "trident-derive-accounts-snapshots" version = "0.0.1" dependencies = [ + "anchor-syn", "proc-macro2", "quote", "syn 1.0.109", - "trident-fuzz", ] [[package]] diff --git a/examples/fuzz-tests/simple-cpi-6/programs/caller/Cargo.toml b/examples/fuzz-tests/simple-cpi-6/programs/caller/Cargo.toml index fc850231..8d0069e4 100644 --- a/examples/fuzz-tests/simple-cpi-6/programs/caller/Cargo.toml +++ b/examples/fuzz-tests/simple-cpi-6/programs/caller/Cargo.toml @@ -15,8 +15,10 @@ no-entrypoint = [] no-idl = [] no-log-ix-name = [] idl-build = ["anchor-lang/idl-build"] +trident-fuzzing = ["dep:trident-fuzz"] [dependencies] anchor-lang = "0.30.1" callee = { path = "../callee", features = ["cpi"] } -trident-client = { path = "../../../../../crates/client" } +trident-derive-accounts-snapshots = { path = "../../../../../crates/fuzz/derive/accounts_snapshots" } +trident-fuzz = { path = "../../../../../crates/fuzz", optional = true } diff --git a/examples/fuzz-tests/simple-cpi-6/programs/caller/src/lib.rs b/examples/fuzz-tests/simple-cpi-6/programs/caller/src/lib.rs index eb2dc232..1cc5f5d2 100644 --- a/examples/fuzz-tests/simple-cpi-6/programs/caller/src/lib.rs +++ b/examples/fuzz-tests/simple-cpi-6/programs/caller/src/lib.rs @@ -1,6 +1,6 @@ use anchor_lang::prelude::*; use callee::program::Callee; -use trident_client::fuzzing::AccountsSnapshots; +use trident_derive_accounts_snapshots::AccountsSnapshots; declare_id!("FWtSodrkUnovFPnNRCxneP6VWh6JH6jtQZ4PHoP8Ejuz"); diff --git a/examples/fuzz-tests/simple-cpi-6/trident-tests/fuzz_tests/Cargo.toml b/examples/fuzz-tests/simple-cpi-6/trident-tests/fuzz_tests/Cargo.toml index 2009814c..e93ae379 100644 --- a/examples/fuzz-tests/simple-cpi-6/trident-tests/fuzz_tests/Cargo.toml +++ b/examples/fuzz-tests/simple-cpi-6/trident-tests/fuzz_tests/Cargo.toml @@ -21,3 +21,4 @@ path = "../../programs/callee" [dependencies.caller] path = "../../programs/caller" +features = ["trident-fuzzing"] diff --git a/examples/fuzz-tests/simple-cpi-6/trident-tests/fuzz_tests/fuzz_0/fuzz_instructions.rs b/examples/fuzz-tests/simple-cpi-6/trident-tests/fuzz_tests/fuzz_0/fuzz_instructions.rs index 58f1ab5d..eba67958 100644 --- a/examples/fuzz-tests/simple-cpi-6/trident-tests/fuzz_tests/fuzz_0/fuzz_instructions.rs +++ b/examples/fuzz-tests/simple-cpi-6/trident-tests/fuzz_tests/fuzz_0/fuzz_instructions.rs @@ -49,7 +49,7 @@ // } pub mod caller_fuzz_instructions { - use caller::trident_fuzz_initialize_caller_snapshot::InitializeCallerSnapshot; + use caller::trident_fuzz_InitializeCaller_snapshot::InitializeCallerSnapshot; use trident_client::fuzzing::*; #[derive(Arbitrary, DisplayIx, FuzzTestExecutor, FuzzDeserialize)] pub enum FuzzInstruction {