Skip to content

Commit

Permalink
use mut self
Browse files Browse the repository at this point in the history
  • Loading branch information
steelgeek091 committed Apr 12, 2024
1 parent 6328d50 commit 2e989e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crates/rooch-store/src/transaction_store/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ impl TransactionDBStore {
}
}

pub fn save_transaction(&mut self, transaction: LedgerTransaction) -> Result<()> {
pub fn save_transaction(&mut self, mut transaction: LedgerTransaction) -> Result<()> {
let tx_hash = transaction.tx_hash()?;
let tx_order = transaction.sequence_info.tx_order;
self.tx_store.kv_put(tx_hash, transaction)?;
Expand Down
6 changes: 3 additions & 3 deletions crates/rooch-types/src/transaction/ledger_transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ pub enum LedgerTxData {
}

impl LedgerTxData {
pub fn tx_hash(&self) -> Result<H256> {
pub fn tx_hash(&mut self) -> Result<H256> {
match self {
LedgerTxData::L1Block(block) => block.tx_hash(),
LedgerTxData::L2Tx(tx) => tx.tx_hash(),
LedgerTxData::L2Tx(ref mut tx) => tx.tx_hash(),
}
}
}
Expand Down Expand Up @@ -91,7 +91,7 @@ impl LedgerTransaction {
}
}

pub fn tx_hash(&self) -> Result<H256> {
pub fn tx_hash(&mut self) -> Result<H256> {
self.data.tx_hash()
}

Expand Down

0 comments on commit 2e989e0

Please sign in to comment.