Skip to content

Commit

Permalink
feat!(iota): remove MultiSigCombinePartialSigLegacy (#1767)
Browse files Browse the repository at this point in the history
* feat!(iota): remove MultiSigCombinePartialSigLegacy

* Remove unused imports

---------

Co-authored-by: Thibault Martinez <[email protected]>
  • Loading branch information
Thoralf-M and thibault-martinez authored Aug 13, 2024
1 parent fbb9a5a commit 4daa3ca
Showing 1 changed file with 0 additions and 43 deletions.
43 changes: 0 additions & 43 deletions crates/iota/src/keytool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ use iota_types::{
},
error::IotaResult,
multisig::{MultiSig, MultiSigPublicKey, ThresholdUnit, WeightUnit},
multisig_legacy::{MultiSigLegacy, MultiSigPublicKeyLegacy},
signature::{AuthenticatorTrait, GenericSignature, VerifyParams},
transaction::{TransactionData, TransactionDataAPI},
};
Expand Down Expand Up @@ -180,16 +179,6 @@ pub enum KeyToolCommand {
#[clap(long)]
threshold: ThresholdUnit,
},
MultiSigCombinePartialSigLegacy {
#[clap(long, num_args(1..))]
sigs: Vec<GenericSignature>,
#[clap(long, num_args(1..))]
pks: Vec<PublicKey>,
#[clap(long, num_args(1..))]
weights: Vec<WeightUnit>,
#[clap(long)]
threshold: ThresholdUnit,
},

/// Read the content at the provided file path. The accepted format can be
/// [enum IotaKeyPair] (Base64 encoded of 33-byte `flag || privkey`) or
Expand Down Expand Up @@ -384,14 +373,6 @@ pub struct MultiSigCombinePartialSig {
multisig_serialized: String,
}

#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
pub struct MultiSigCombinePartialSigLegacyOutput {
multisig_address: IotaAddress,
multisig_legacy_parsed: GenericSignature,
multisig_legacy_serialized: String,
}

#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
pub struct MultiSigOutput {
Expand Down Expand Up @@ -476,7 +457,6 @@ pub enum CommandOutput {
LoadKeypair(KeypairData),
MultiSigAddress(MultiSigAddress),
MultiSigCombinePartialSig(MultiSigCombinePartialSig),
MultiSigCombinePartialSigLegacy(MultiSigCombinePartialSigLegacyOutput),
PrivateKeyBase64(PrivateKeyBase64),
Show(Key),
Sign(SignData),
Expand Down Expand Up @@ -751,29 +731,6 @@ impl KeyToolCommand {
})
}

KeyToolCommand::MultiSigCombinePartialSigLegacy {
sigs,
pks,
weights,
threshold,
} => {
let multisig_pk_legacy =
MultiSigPublicKeyLegacy::new(pks.clone(), weights.clone(), threshold)?;
let multisig_pk = MultiSigPublicKey::new(pks, weights, threshold)?;
let address: IotaAddress = (&multisig_pk).into();
let multisig = MultiSigLegacy::combine(sigs, multisig_pk_legacy)?;
let generic_sig: GenericSignature = multisig.into();
let multisig_legacy_serialized = generic_sig.encode_base64();

CommandOutput::MultiSigCombinePartialSigLegacy(
MultiSigCombinePartialSigLegacyOutput {
multisig_address: address,
multisig_legacy_parsed: generic_sig,
multisig_legacy_serialized,
},
)
}

KeyToolCommand::Show { file } => {
let res = read_keypair_from_file(&file);
match res {
Expand Down

0 comments on commit 4daa3ca

Please sign in to comment.