-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor
consensus.rs
error mapping (#382)
I have created a `tx_err` macro to succinctly build a `TransactionError`. This has the benefit of skipping the `BlockValidationErrors::` enum prefix when specifying the error, and flexibly taking a third argument for the inner variant value. The validation methods now directly return `TransactionError` and use a lazily evaluated closure to compute the `txid` if there's an error. The `pub mod error` line is now before `pub mod consensus` to make the macro available. Finally changed the "Invalid coinbase txid" error message to "Invalid Coinbase PrevOut".
- Loading branch information
Showing
3 changed files
with
66 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters