Skip to content

Commit

Permalink
fix: sign-txs multisig support full address
Browse files Browse the repository at this point in the history
  • Loading branch information
jjyr committed Mar 27, 2024
1 parent 1ea0732 commit b6c3c67
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/subcommands/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -811,17 +811,9 @@ impl TryFrom<ReprMultisigConfig> 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::<Result<Vec<_>, String>>()?;
MultisigConfig::new_with(sighash_addresses, repr.require_first_n, repr.threshold)
Expand Down

0 comments on commit b6c3c67

Please sign in to comment.