Skip to content

Commit

Permalink
✅ Update examples , update changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
lukacan committed Jul 20, 2024
1 parent 762d4cc commit 0c8e18a
Show file tree
Hide file tree
Showing 28 changed files with 8,950 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
- 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))
- feat/create AccountsSnapshots derive macro for Snapshots creation ([#177](https://github.com/Ackee-Blockchain/trident/pull/177))
Expand Down
2 changes: 1 addition & 1 deletion crates/client/src/templates/trident-tests/test_fuzz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fn main() {
// Specify programs you want to include in genesis
// Programs without an `entry_fn`` will be searched for within `trident-genesis` folder.
// `entry_fn`` example: processor!(convert_entry!(program_entry))
let fuzzing_program1 = FuzzingProgram::new(todo!(),todo!(),todo!());
let fuzzing_program1 = FuzzingProgram::new(todo!(),todo!(),processor!(convert_entry!(todo!())));

let mut client =
ProgramTestClientBlocking::new(&[todo!()])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ use arbitrary_custom_types_4::entry as entry_arbitrary_custom_types_4;
use arbitrary_custom_types_4::ID as PROGRAM_ID_ARBITRARY_CUSTOM_TYPES_4;
const PROGRAM_NAME_ARBITRARY_CUSTOM_TYPES_4: &str = "arbitrary_custom_types_4";
use fuzz_instructions::arbitrary_custom_types_4_fuzz_instructions::FuzzInstruction as FuzzInstruction_arbitrary_custom_types_4;
use fuzz_instructions::arbitrary_custom_types_4_fuzz_instructions::Initialize;
use fuzz_instructions::arbitrary_custom_types_4_fuzz_instructions::Update;
use trident_client::fuzzing::*;
mod fuzz_instructions;

Expand All @@ -11,7 +13,15 @@ mod accounts_snapshots;

struct MyFuzzData;

impl FuzzDataBuilder<FuzzInstruction_arbitrary_custom_types_4> for MyFuzzData {}
impl FuzzDataBuilder<FuzzInstruction_arbitrary_custom_types_4> for MyFuzzData {
fn pre_ixs(
u: &mut arbitrary::Unstructured,
) -> arbitrary::Result<Vec<FuzzInstruction_arbitrary_custom_types_4>> {
let init = FuzzInstruction_arbitrary_custom_types_4::Initialize(Initialize::arbitrary(u)?);
let update = FuzzInstruction_arbitrary_custom_types_4::Update(Update::arbitrary(u)?);
Ok(vec![init, update])
}
}

fn main() {
loop {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use arbitrary_limit_inputs_5::entry as entry_arbitrary_limit_inputs_5;
use arbitrary_limit_inputs_5::ID as PROGRAM_ID_ARBITRARY_LIMIT_INPUTS_5;
const PROGRAM_NAME_ARBITRARY_LIMIT_INPUTS_5: &str = "arbitrary_limit_inputs_5";
use fuzz_instructions::arbitrary_limit_inputs_5_fuzz_instructions::FuzzInstruction as FuzzInstruction_arbitrary_limit_inputs_5;
use fuzz_instructions::arbitrary_limit_inputs_5_fuzz_instructions::InitVesting;
use trident_client::fuzzing::*;
mod fuzz_instructions;

Expand All @@ -11,7 +12,16 @@ mod fuzz_instructions;

struct MyFuzzData;

impl FuzzDataBuilder<FuzzInstruction_arbitrary_limit_inputs_5> for MyFuzzData {}
impl FuzzDataBuilder<FuzzInstruction_arbitrary_limit_inputs_5> for MyFuzzData {
fn pre_ixs(
u: &mut arbitrary::Unstructured,
) -> arbitrary::Result<Vec<FuzzInstruction_arbitrary_limit_inputs_5>> {
let init_ix =
FuzzInstruction_arbitrary_limit_inputs_5::InitVesting(InitVesting::arbitrary(u)?);

Ok(vec![init_ix])
}
}

fn main() {
loop {
Expand Down
8 changes: 8 additions & 0 deletions examples/fuzz-tests/cpi-metaplex-7/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.anchor
.DS_Store
target
**/*.rs.bk
node_modules
test-ledger
.yarn
trident-tests/fuzz_tests/fuzzing/hfuzz_target
7 changes: 7 additions & 0 deletions examples/fuzz-tests/cpi-metaplex-7/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.anchor
.DS_Store
target
node_modules
dist
build
test-ledger
24 changes: 24 additions & 0 deletions examples/fuzz-tests/cpi-metaplex-7/Anchor.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[toolchain]

[features]
resolution = true
skip-lint = false

[programs.localnet]
cpi_metaplex_7 = "3XtULmXDGS867VbBXiPkjYr4EMjytGW8X12F6BS23Zcw"

[registry]
url = "https://api.apr.dev"

[provider]
cluster = "Localnet"
wallet = "~/.config/solana/id.json"

[scripts]
test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"


# include metadata program in genesis
[[test.genesis]]
address = "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"
program = "trident-genesis/metaplex-token-metadata.so"
Loading

0 comments on commit 0c8e18a

Please sign in to comment.