Skip to content

Commit

Permalink
[gh-2589] remove count and add signatory suffix to file.
Browse files Browse the repository at this point in the history
  • Loading branch information
Feliciss committed Sep 17, 2024
1 parent 5e5b048 commit 94a0d3c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion crates/rooch-types/src/transaction/rooch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ impl PartiallySignedRoochTransaction {
self.data.sender
}

pub fn signators(&self) -> usize {
pub fn signatories(&self) -> usize {
self.authenticators.len()
}

Expand Down
10 changes: 5 additions & 5 deletions crates/rooch/src/commands/transaction/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
}
}

Expand All @@ -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))
Expand Down

0 comments on commit 94a0d3c

Please sign in to comment.