Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fullblocktests: Decouple from blockchain. #2951

Merged
merged 5 commits into from
May 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 15 additions & 19 deletions blockchain/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const (
// to a newer version.
ErrBlockVersionTooOld = ErrorKind("ErrBlockVersionTooOld")

// ErrBadStakeVersionindicates the block version is too old and is no
// ErrBadStakeVersion indicates the block version is too old and is no
// longer accepted since the majority of the network has upgraded to a
// newer version.
ErrBadStakeVersion = ErrorKind("ErrBadStakeVersion")
Expand All @@ -76,10 +76,6 @@ const (
// the current time.
ErrTimeTooNew = ErrorKind("ErrTimeTooNew")

// ErrDifficultyTooLow indicates the difficulty for the block is lower
// than the difficulty required by the most recent checkpoint.
ErrDifficultyTooLow = ErrorKind("ErrDifficultyTooLow")

// ErrUnexpectedDifficulty indicates specified bits do not align with
// the expected value either because it doesn't match the calculated
// value based on difficulty regarding the rules or it is out of the
Expand All @@ -102,9 +98,8 @@ const (
// before the fork rejection checkpoint.
ErrForkTooOld = ErrorKind("ErrForkTooOld")

// ErrNoTransactions indicates the block does not have a least one
// transaction. A valid block must have at least the coinbase
// transaction.
// ErrNoTransactions indicates the block does not have at least one
// transaction. A valid block must have at least the coinbase transaction.
ErrNoTransactions = ErrorKind("ErrNoTransactions")

// ErrNoTxInputs indicates a transaction does not have any inputs. A
Expand Down Expand Up @@ -231,10 +226,10 @@ const (
// length or fail to parse.
ErrScriptMalformed = ErrorKind("ErrScriptMalformed")

// ErrScriptValidation indicates the result of executing transaction
// ErrScriptValidation indicates the result of executing a transaction
// script failed. The error covers any failure when executing scripts
// such signature verification failures and execution past the end of
// the stack.
// such as signature verification failures and execution past the end
// of the stack.
ErrScriptValidation = ErrorKind("ErrScriptValidation")

// ErrNotEnoughStake indicates that there was for some SStx in a given block,
Expand Down Expand Up @@ -274,8 +269,8 @@ const (
// that could not be found.
ErrTicketUnavailable = ErrorKind("ErrTicketUnavailable")

// ErrVotesOnWrongBlock indicates that an SSGen voted on a block not the
// block's parent, and so was ineligible for inclusion into that block.
// ErrVotesOnWrongBlock indicates that an SSGen voted on a block that is not
// the block's parent, and so was ineligible for inclusion into that block.
ErrVotesOnWrongBlock = ErrorKind("ErrVotesOnWrongBlock")

// ErrVotesMismatch indicates that the number of SSGen in the block was not
Expand Down Expand Up @@ -392,21 +387,22 @@ const (
// was different from where it was actually embedded in the block chain.
ErrBadBlockHeight = ErrorKind("ErrBadBlockHeight")

// ErrBlockOneTx indicates that block height 1 failed to correct generate
// ErrBlockOneTx indicates that block height 1 failed to correctly generate
// the block one initial payout transaction.
ErrBlockOneTx = ErrorKind("ErrBlockOneTx")

// ErrBlockOneTx indicates that block height 1 coinbase transaction in
// zero was incorrect in some way.
// ErrBlockOneInputs indicates that block height 1 coinbase transaction
// input zero was incorrect in some way.
ErrBlockOneInputs = ErrorKind("ErrBlockOneInputs")

// ErrBlockOneOutputs indicates that block height 1 failed to incorporate
// the ledger addresses correctly into the transaction's outputs.
ErrBlockOneOutputs = ErrorKind("ErrBlockOneOutputs")

// ErrNoTax indicates that there was no tax present in the coinbase of a
// block after height 1.
ErrNoTax = ErrorKind("ErrNoTax")
// ErrNoTreasury indicates that there was no treasury payout present in the
// coinbase of a block after height 1 and prior to the activation of the
// decentralized treasury.
ErrNoTreasury = ErrorKind("ErrNoTreasury")

// ErrExpiredTx indicates that the transaction is currently expired.
ErrExpiredTx = ErrorKind("ErrExpiredTx")
Expand Down
3 changes: 1 addition & 2 deletions blockchain/error_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ func TestErrorKindStringer(t *testing.T) {
{ErrInvalidTime, "ErrInvalidTime"},
{ErrTimeTooOld, "ErrTimeTooOld"},
{ErrTimeTooNew, "ErrTimeTooNew"},
{ErrDifficultyTooLow, "ErrDifficultyTooLow"},
{ErrUnexpectedDifficulty, "ErrUnexpectedDifficulty"},
{ErrHighHash, "ErrHighHash"},
{ErrBadMerkleRoot, "ErrBadMerkleRoot"},
Expand Down Expand Up @@ -105,7 +104,7 @@ func TestErrorKindStringer(t *testing.T) {
{ErrBlockOneTx, "ErrBlockOneTx"},
{ErrBlockOneInputs, "ErrBlockOneInputs"},
{ErrBlockOneOutputs, "ErrBlockOneOutputs"},
{ErrNoTax, "ErrNoTax"},
{ErrNoTreasury, "ErrNoTreasury"},
{ErrExpiredTx, "ErrExpiredTx"},
{ErrExpiryTxSpentEarly, "ErrExpiryTxSpentEarly"},
{ErrFraudAmountIn, "ErrFraudAmountIn"},
Expand Down
Loading