Skip to content

Commit fd87f8f

Browse files
authored
Merge pull request #593 from jjyr/fix-deploy-with-multisig
Fix deploy with multisig
2 parents 6b793d2 + b6c3c67 commit fd87f8f

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

src/subcommands/deploy/deployment.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ pub struct Cell {
2727
pub name: String,
2828
pub location: CellLocation,
2929
pub enable_type_id: bool,
30+
#[serde(default)]
31+
pub force_redeploy: bool,
3032
}
3133

3234
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]

src/subcommands/deploy/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,8 @@ fn load_cells(
738738
let lock_script_unchanged = lock_script.as_slice() == old_lock_script.as_slice();
739739
let type_id_unchanged = old_recipe.type_id.is_some() == config.enable_type_id;
740740
// NOTE: we trust `old_recipe.data_hash` here
741-
if data_unchanged && lock_script_unchanged && type_id_unchanged {
741+
if data_unchanged && lock_script_unchanged && type_id_unchanged && !cell.force_redeploy
742+
{
742743
StateChange::Unchanged {
743744
data,
744745
data_hash,

src/subcommands/tx.rs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -811,17 +811,9 @@ impl TryFrom<ReprMultisigConfig> for MultisigConfig {
811811
.sighash_addresses
812812
.into_iter()
813813
.map(|address_string| {
814-
if let AddressPayload::Short { index, hash } =
815-
Address::from_str(&address_string).map(|addr| addr.payload().clone())?
816-
{
817-
if index == CodeHashIndex::Sighash {
818-
Ok(hash)
819-
} else {
820-
Err(format!("invalid address: {}", address_string))
821-
}
822-
} else {
823-
Err(format!("invalid address: {}", address_string))
824-
}
814+
Address::from_str(&address_string)
815+
.map(|addr| H160::from_slice(addr.payload().args().as_ref()))?
816+
.map_err(|err| format!("invalid address: {address_string} error: {err:?}"))
825817
})
826818
.collect::<Result<Vec<_>, String>>()?;
827819
MultisigConfig::new_with(sighash_addresses, repr.require_first_n, repr.threshold)

0 commit comments

Comments
 (0)