Skip to content

Commit

Permalink
chore: add debug impls
Browse files Browse the repository at this point in the history
  • Loading branch information
OliverNChalk committed Sep 20, 2024
1 parent 9d25bb5 commit 2cbb44f
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 11 deletions.
12 changes: 8 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ members = ["crates/*", "programs/*"]
[workspace.dependencies]
faucet = { path = "./programs/faucet" }
litesvm = { git = "https://github.com/OliverNChalk/litesvm" }
solana-account-decoder = "1.18"
solana-client = "1.18"
solana-logger = "1.18"
solana-program = "1.18"
solana-sdk = "1.18"
solana-account-decoder = "1.18.0"
solana-client = "1.18.0"
solana-logger = "1.18.0"
solana-program = "1.18.0"
solana-sdk = "1.18.0"
spl-token = { version = "4.0.0", features = ["no-entrypoint"] }
3 changes: 2 additions & 1 deletion crates/svm-test/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "svm-test"
version = "0.1.0"
version = "0.1.1"
edition = "2021"

[features]
Expand All @@ -10,6 +10,7 @@ spl-token = ["dep:spl-token", "dep:spl-associated-token-account"]
[dependencies]
async-trait = "0.1.81"
dashmap = "6.0.1"
derivative = "2.2.0"
flate2 = "1.0.32"
futures = "0.3.30"
itertools = "0.13.0"
Expand Down
3 changes: 2 additions & 1 deletion crates/svm-test/src/harness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ impl Harness {
if std::env::var("TEST_DEBUG").is_ok() {
#[rustfmt::skip]
solana_logger::setup_with_default(
"mimicry=debug,\
"svm_test=debug,\
solana_rbpf::vm=debug,\
solana_runtime::message_processor=debug,\
solana_runtime::system_instruction_processor=trace",
Expand Down Expand Up @@ -74,6 +74,7 @@ impl Harness {
}
}

#[derive(Debug)]
pub struct Scenario {
runtime: &'static tokio::runtime::Runtime,
rpc: TestRpc,
Expand Down
4 changes: 4 additions & 0 deletions crates/svm-test/src/test_rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use std::ops::{Deref, DerefMut};
use std::path::PathBuf;
use std::sync::{OnceLock, RwLock};

use derivative::Derivative;
use serde::{Deserialize, Serialize};
use serde_with::serde_as;
use solana_account_decoder::UiAccountEncoding;
Expand Down Expand Up @@ -45,10 +46,13 @@ pub fn get_static_cache() -> &'static RpcCache {
STATIC_CACHE.get_or_init(|| read_json(&test_static_data_path()))
}

#[derive(Derivative)]
#[derivative(Debug)]
pub struct TestRpc {
static_cache: &'static RpcCache,
cache: RwLock<WriteOnDrop<RpcCache>>,
/// If the RPC is set the cache file will be ignored & overwritten.
#[derivative(Debug = "ignore")]
rpc: Option<RpcClient>,
}

Expand Down

0 comments on commit 2cbb44f

Please sign in to comment.