Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!(iota): remove MultiSigCombinePartialSigLegacy #1767

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading