From 9c616af5134f9daf7b4d41ddc9f54024ee8c30ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Kami=C5=84ski?= Date: Thu, 31 Oct 2024 22:38:53 +0100 Subject: [PATCH] fmt --- packages/consensus/src/validation/block.cairo | 10 ++++++++-- packages/consensus/src/validation/transaction.cairo | 7 ++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/packages/consensus/src/validation/block.cairo b/packages/consensus/src/validation/block.cairo index 0e5777b8..71a134ae 100644 --- a/packages/consensus/src/validation/block.cairo +++ b/packages/consensus/src/validation/block.cairo @@ -30,7 +30,11 @@ pub fn validate_block_weight(weight: usize) -> Result<(), ByteArray> { /// - wTXID commitment (only for blocks after Segwit upgrade, otherwise return zero hash) /// - Block weight pub fn compute_and_validate_tx_data( - txs: Span, block_height: u32, block_time: u32, median_time_past: u32, ref utxo_set: UtxoSet + txs: Span, + block_height: u32, + block_time: u32, + median_time_past: u32, + ref utxo_set: UtxoSet ) -> Result<(u64, Digest, Digest), ByteArray> { let mut txids: Array = array![]; let mut wtxids: Array = array![]; @@ -92,7 +96,9 @@ pub fn compute_and_validate_tx_data( is_coinbase = false; } else { let fee = - match validate_transaction(tx, block_height, block_time, median_time_past, txid, ref utxo_set) { + match validate_transaction( + tx, block_height, block_time, median_time_past, txid, ref utxo_set + ) { Result::Ok(fee) => fee, Result::Err(err) => { inner_result = Result::Err(err); diff --git a/packages/consensus/src/validation/transaction.cairo b/packages/consensus/src/validation/transaction.cairo index 2fe9131a..391bfced 100644 --- a/packages/consensus/src/validation/transaction.cairo +++ b/packages/consensus/src/validation/transaction.cairo @@ -14,7 +14,12 @@ const MAX_SCRIPT_SIZE: u32 = 10000; /// /// This does not include script checks and outpoint inclusion verification. pub fn validate_transaction( - tx: @Transaction, block_height: u32, block_time: u32, median_time_past: u32, txid: Digest, ref utxo_set: UtxoSet + tx: @Transaction, + block_height: u32, + block_time: u32, + median_time_past: u32, + txid: Digest, + ref utxo_set: UtxoSet ) -> Result { if (*tx.inputs).is_empty() { return Result::Err("transaction inputs are empty");