Skip to content

Specify instruction data#

Trident fuzzer generates random instruction data for you.

Currently, it is however required, that you manually assign the random fuzzer data to the instruction data. It is done using the IxOps trait and its method get_data.

  • Go to the trident-tests/fuzz_tests/<FUZZ_TEST_NAME>/fuzz_instructions.rs file and complete the pre-generated get_data methods for each instruction such as:
fn get_data(
    &self,
    _client: &mut impl FuzzClient,
    _fuzz_accounts: &mut FuzzAccounts,
) -> Result<Self::IxData, FuzzingError> {
    let data = fuzz_example1::instruction::Invest {
        amount: self.data.amount,
    };
    Ok(data)
}