Skip to content

Commit

Permalink
fix: Unit tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
jbencin committed Apr 30, 2024
1 parent cfdc8f1 commit f910e6d
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion stackslib/src/chainstate/stacks/miner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2580,9 +2580,11 @@ impl BlockBuilder for StacksBlockBuilder {
}

// preemptively skip problematic transactions
let epoch_id = clarity_tx.get_epoch();

if let Err(e) = Relayer::static_check_problematic_relayed_tx(
clarity_tx.config.mainnet,
clarity_tx.get_epoch(),
epoch_id,
&tx,
ast_rules,
) {
Expand All @@ -2592,6 +2594,19 @@ impl BlockBuilder for StacksBlockBuilder {
);
return TransactionResult::problematic(&tx, Error::NetError(e));
}

if !StacksBlock::validate_transactions_static_epoch(&[tx.clone()], epoch_id) {
let msg = format!(
"Invalid transaction {}: target epoch is not activated",
tx.txid()
);
warn!("{msg}");
return TransactionResult::skipped_due_to_error(
tx,
Error::InvalidStacksTransaction(msg, false),
);
}

let (fee, receipt) = match StacksChainState::process_transaction(
clarity_tx, tx, quiet, ast_rules,
) {
Expand Down

0 comments on commit f910e6d

Please sign in to comment.