Skip to content

Commit

Permalink
Chain: Test oversized scripts (#387)
Browse files Browse the repository at this point in the history
* consensus: refactor verify_block_transactions

This commit moves transaction-specific validation to a dedicated
function. This will be used to test our transaction validation logic,
and to verify mempool transactions in the future.

A new function, `verify_transaction` was created. It takes the UTXOs
map, a transaction, some flags and returns the input/output amounts or
an error, if any. It'll check the following:

  - The transaction doesn't spend more coins than it claims in the inputs
  - The transaction doesn't create more coins than allowed
  - The transaction has valid scripts
  - The transaction doesn't have duplicate inputs

* consensus: test over sized scripts

This commit adds some tests with huge scripts to see our validation is
working as expected. Those test cases were tested against core and we
check if floresta outputs the same thing as the former.
  • Loading branch information
Davidson-Souza authored Mar 6, 2025
1 parent 63c2d63 commit 005189e
Showing 1 changed file with 192 additions and 36 deletions.
Loading

0 comments on commit 005189e

Please sign in to comment.