Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
maciejka committed Oct 31, 2024
1 parent 566f9cf commit 9c616af
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
10 changes: 8 additions & 2 deletions packages/consensus/src/validation/block.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -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<Transaction>, block_height: u32, block_time: u32, median_time_past: u32, ref utxo_set: UtxoSet
txs: Span<Transaction>,
block_height: u32,
block_time: u32,
median_time_past: u32,
ref utxo_set: UtxoSet
) -> Result<(u64, Digest, Digest), ByteArray> {
let mut txids: Array<Digest> = array![];
let mut wtxids: Array<Digest> = array![];
Expand Down Expand Up @@ -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);
Expand Down
7 changes: 6 additions & 1 deletion packages/consensus/src/validation/transaction.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -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<u64, ByteArray> {
if (*tx.inputs).is_empty() {
return Result::Err("transaction inputs are empty");
Expand Down

0 comments on commit 9c616af

Please sign in to comment.