From 6e27ce1d3d0109bb43788e1a01d958db19385592 Mon Sep 17 00:00:00 2001 From: not4x217 <6069441+not4x217@users.noreply.github.com> Date: Wed, 30 Oct 2024 19:58:53 +0800 Subject: [PATCH] fix config path and anvil instance --- tripa/src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tripa/src/main.rs b/tripa/src/main.rs index 6f0a6f7..3e8a843 100644 --- a/tripa/src/main.rs +++ b/tripa/src/main.rs @@ -360,12 +360,13 @@ fn mock_state() -> WalletState { #[tokio::main] async fn main() { - let config_string = fs::read_to_string("config_default.toml").expect("failed to read config"); + let config_string = fs::read_to_string("config.toml").expect("failed to read config"); let mut config: Config = toml::from_str(&config_string).expect("failed to parse config"); // Create a provider with the HTTP transport using the `reqwest` crate. + let anvil: AnvilInstance; let (provider, signer) = if config.use_local_anvil { - let anvil = Anvil::new().try_spawn().expect("failed to start anvil"); + anvil = Anvil::new().try_spawn().expect("failed to start anvil"); let signer: PrivateKeySigner = anvil.keys()[0].clone().into(); let rpc_url: String = anvil.endpoint().parse().expect("failed to get anvil url"); config.base_url = rpc_url.clone();