From 94a0d3c66123c2d1333f716b072fec2715723c54 Mon Sep 17 00:00:00 2001 From: Feliciss <10203-feliciss@users.noreply.0xacab.org> Date: Tue, 17 Sep 2024 19:58:28 +0900 Subject: [PATCH] [gh-2589] remove count and add signatory suffix to file. --- crates/rooch-types/src/transaction/rooch.rs | 2 +- crates/rooch/src/commands/transaction/commands/mod.rs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/rooch-types/src/transaction/rooch.rs b/crates/rooch-types/src/transaction/rooch.rs index 60c79977fc..5ea51c78a8 100644 --- a/crates/rooch-types/src/transaction/rooch.rs +++ b/crates/rooch-types/src/transaction/rooch.rs @@ -118,7 +118,7 @@ impl PartiallySignedRoochTransaction { self.data.sender } - pub fn signators(&self) -> usize { + pub fn signatories(&self) -> usize { self.authenticators.len() } diff --git a/crates/rooch/src/commands/transaction/commands/mod.rs b/crates/rooch/src/commands/transaction/commands/mod.rs index 02b34d9165..b1fbb5af2e 100644 --- a/crates/rooch/src/commands/transaction/commands/mod.rs +++ b/crates/rooch/src/commands/transaction/commands/mod.rs @@ -31,11 +31,11 @@ impl FileOutputData { } } - pub fn file_count_suffix(&self) -> usize { + pub fn file_signatory_suffix(&self) -> String { match self { - FileOutputData::RoochTransactionData(_) => 1, - FileOutputData::SignedRoochTransaction(_) => 1, - FileOutputData::PartiallySignedRoochTransaction(data) => data.signators(), + FileOutputData::RoochTransactionData(data) => data.sender.to_bech32(), + FileOutputData::SignedRoochTransaction(data) => data.sender().to_bech32(), + FileOutputData::PartiallySignedRoochTransaction(data) => data.signatories().to_string(), } } @@ -61,7 +61,7 @@ impl FileOutputData { let file_name = format!( "{}.{}.{}", hex::encode(&tx_hash[..8]), - self.file_count_suffix(), + self.file_signatory_suffix(), self.file_suffix() ); Ok(temp_dir.join(file_name))