From 7a11a2e82adf028653ac49a900a710711f9c789d Mon Sep 17 00:00:00 2001 From: Spring Chiu Date: Mon, 24 Jun 2024 03:06:04 +0800 Subject: [PATCH] feat: pub set_sandbox_genesis and fix test_manually_spawned_deploy --- workspaces/src/network/config.rs | 2 +- workspaces/src/network/mod.rs | 1 + workspaces/tests/deploy.rs | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/workspaces/src/network/config.rs b/workspaces/src/network/config.rs index 5eb3720f..c4509d89 100644 --- a/workspaces/src/network/config.rs +++ b/workspaces/src/network/config.rs @@ -142,7 +142,7 @@ fn overwrite_genesis(home_dir: impl AsRef) -> Result<()> { Ok(()) } -pub(crate) fn set_sandbox_genesis(home_dir: impl AsRef) -> Result<()> { +pub fn set_sandbox_genesis(home_dir: impl AsRef) -> Result<()> { overwrite_genesis(&home_dir)?; let registrar_key = r#"{"account_id":"registrar","public_key":"ed25519:5BGSaf6YjVm7565VzWQHNxoyEjwr3jUpRJSGjREvU9dB","private_key":"ed25519:3tgdk2wPraJzT4nsTuf86UX41xgPNk3MHnq8epARMdBNs29AFEztAuaQ7iHddDfXG9F2RzV1XNQYgJyAyoW51UBB"}"#; let mut registrar_wallet = File::create(home_dir.as_ref().join("registrar.json")) diff --git a/workspaces/src/network/mod.rs b/workspaces/src/network/mod.rs index 147a0802..c03a5995 100644 --- a/workspaces/src/network/mod.rs +++ b/workspaces/src/network/mod.rs @@ -27,3 +27,4 @@ pub use self::testnet::Testnet; pub use self::variants::{ AllowDevAccountCreation, NetworkClient, NetworkInfo, TopLevelAccountCreator, }; +pub use config::set_sandbox_genesis; diff --git a/workspaces/tests/deploy.rs b/workspaces/tests/deploy.rs index bf5806f5..b6df67dc 100644 --- a/workspaces/tests/deploy.rs +++ b/workspaces/tests/deploy.rs @@ -70,6 +70,7 @@ async fn test_manually_spawned_deploy() -> anyhow::Result<()> { .await .unwrap(); tracing::info!(target: "workspaces-test", "sandbox-init: {:?}", output); + near_workspaces::network::set_sandbox_genesis(&home_dir)?; let mut child = near_sandbox_utils::run(&home_dir, rpc_port, net_port)?;