From fe74412ed27b6ee391e3fbb6456981c2c6bd5f91 Mon Sep 17 00:00:00 2001 From: friedger Date: Wed, 27 Mar 2024 10:42:47 +0100 Subject: [PATCH 1/2] fix: allow requirements for contracts deployed with multisig --- components/clarinet-deployments/src/requirements.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/clarinet-deployments/src/requirements.rs b/components/clarinet-deployments/src/requirements.rs index 337ce96d5..f6edc0935 100644 --- a/components/clarinet-deployments/src/requirements.rs +++ b/components/clarinet-deployments/src/requirements.rs @@ -57,7 +57,7 @@ pub async fn retrieve_contract( )); } - let is_mainnet = contract_deployer.starts_with("SP"); + let is_mainnet = contract_deployer.starts_with("SP") || contract_deployer.starts_with("SM"); let stacks_node_addr = if is_mainnet { "https://api.hiro.so".to_string() } else { From 6eafcce73e9f58cb0752d61a271f800983ca2b0d Mon Sep 17 00:00:00 2001 From: friedger Date: Wed, 27 Mar 2024 10:58:20 +0100 Subject: [PATCH 2/2] fix: use StacksAddress.is_mainnet --- components/clarinet-deployments/src/requirements.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/components/clarinet-deployments/src/requirements.rs b/components/clarinet-deployments/src/requirements.rs index f6edc0935..3b3613084 100644 --- a/components/clarinet-deployments/src/requirements.rs +++ b/components/clarinet-deployments/src/requirements.rs @@ -1,6 +1,9 @@ use clarinet_files::{FileAccessor, FileLocation}; use clarity_repl::{ - clarity::{vm::types::QualifiedContractIdentifier, ClarityVersion, StacksEpochId}, + clarity::{ + chainstate::StacksAddress, vm::types::QualifiedContractIdentifier, Address, ClarityVersion, + StacksEpochId, + }, repl::{DEFAULT_CLARITY_VERSION, DEFAULT_EPOCH}, }; use reqwest; @@ -57,7 +60,9 @@ pub async fn retrieve_contract( )); } - let is_mainnet = contract_deployer.starts_with("SP") || contract_deployer.starts_with("SM"); + let is_mainnet = StacksAddress::from_string(&contract_deployer) + .unwrap() + .is_mainnet(); let stacks_node_addr = if is_mainnet { "https://api.hiro.so".to_string() } else {