From 1ea0732ffb4a9de1c239a9118991e11655047340 Mon Sep 17 00:00:00 2001 From: jjy Date: Fri, 22 Mar 2024 15:29:58 +0800 Subject: [PATCH 1/2] feat: support force redeploy cells --- src/subcommands/deploy/deployment.rs | 2 ++ src/subcommands/deploy/mod.rs | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/subcommands/deploy/deployment.rs b/src/subcommands/deploy/deployment.rs index bd15e8de..49916f4c 100644 --- a/src/subcommands/deploy/deployment.rs +++ b/src/subcommands/deploy/deployment.rs @@ -27,6 +27,8 @@ pub struct Cell { pub name: String, pub location: CellLocation, pub enable_type_id: bool, + #[serde(default)] + pub force_redeploy: bool, } #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)] diff --git a/src/subcommands/deploy/mod.rs b/src/subcommands/deploy/mod.rs index f8f1eaba..5aa8fc3b 100644 --- a/src/subcommands/deploy/mod.rs +++ b/src/subcommands/deploy/mod.rs @@ -738,7 +738,8 @@ fn load_cells( let lock_script_unchanged = lock_script.as_slice() == old_lock_script.as_slice(); let type_id_unchanged = old_recipe.type_id.is_some() == config.enable_type_id; // NOTE: we trust `old_recipe.data_hash` here - if data_unchanged && lock_script_unchanged && type_id_unchanged { + if data_unchanged && lock_script_unchanged && type_id_unchanged && !cell.force_redeploy + { StateChange::Unchanged { data, data_hash, From b6c3c67683cded4c70d41dfed5d05fbbe8aab0f7 Mon Sep 17 00:00:00 2001 From: jjy Date: Tue, 26 Mar 2024 22:27:53 +0800 Subject: [PATCH 2/2] fix: sign-txs multisig support full address --- src/subcommands/tx.rs | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/subcommands/tx.rs b/src/subcommands/tx.rs index e827edf3..42f07a72 100644 --- a/src/subcommands/tx.rs +++ b/src/subcommands/tx.rs @@ -811,17 +811,9 @@ impl TryFrom for MultisigConfig { .sighash_addresses .into_iter() .map(|address_string| { - if let AddressPayload::Short { index, hash } = - Address::from_str(&address_string).map(|addr| addr.payload().clone())? - { - if index == CodeHashIndex::Sighash { - Ok(hash) - } else { - Err(format!("invalid address: {}", address_string)) - } - } else { - Err(format!("invalid address: {}", address_string)) - } + Address::from_str(&address_string) + .map(|addr| H160::from_slice(addr.payload().args().as_ref()))? + .map_err(|err| format!("invalid address: {address_string} error: {err:?}")) }) .collect::, String>>()?; MultisigConfig::new_with(sighash_addresses, repr.require_first_n, repr.threshold)