I'm writing an Anchor program and would like to include a couple functions that modify certain values during tests in a way that would be tedious to do with the real program interface. I don't want to keep this for my production code. What is the standard way of doing this in Anchor?
1 Answer
You should be able to use conditional compiling like this:
#[cfg(feature = "is-test")]
pub fn increase_counter_function(mut count: u64) -> u64 {
count += 1;
count
}
and then you set the value in the cargo.toml
[features]
is-test = []