Skip to content

Commit

Permalink
[rooch-networkgh-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 20829f4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 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
12 changes: 6 additions & 6 deletions crates/rooch/src/commands/transaction/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

use anyhow::Result;
use moveos_types::h256::H256;
use moveos_types::h256::{H256, LENGTH};
use rooch_types::transaction::{
rooch::PartiallySignedRoochTransaction, RoochTransaction, RoochTransactionData,
};
Expand Down 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 20829f4

Please sign in to comment.