Skip to content

Commit

Permalink
Rename error code name to be similar to the corresponding input type
Browse files Browse the repository at this point in the history
  • Loading branch information
aivve committed Dec 21, 2021
1 parent 1a7afd1 commit 49968f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/CryptoNoteCore/Core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1802,7 +1802,7 @@ std::error_code Core::validateBlock(const CachedBlock& cachedBlock, IBlockchainC
}

if (block.baseTransaction.outputs[0].target.type() != typeid(KeyOutput)) {
return error::TransactionValidationError::BASE_TRANSACTION_OUTPUT_WRONG_TYPE;
return error::TransactionValidationError::OUTPUT_UNEXPECTED_TYPE;
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/CryptoNoteCore/TransactionValidationErrors.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ enum class TransactionValidationError {
INVALID_FEE,
SIZE_TOO_LARGE,
OUTPUTS_INVALID_COUNT,
BASE_TRANSACTION_OUTPUT_WRONG_TYPE
OUTPUT_UNEXPECTED_TYPE
};

// custom category:
Expand Down Expand Up @@ -111,7 +111,7 @@ class TransactionValidationErrorCategory : public std::error_category {
case TransactionValidationError::INVALID_FEE: return "Fee is too small and it's not a fusion transaction";
case TransactionValidationError::SIZE_TOO_LARGE: return "Transaction is too large (in bytes)";
case TransactionValidationError::OUTPUTS_INVALID_COUNT: return "Only 1 output in coinbase transaction allowed";
case TransactionValidationError::BASE_TRANSACTION_OUTPUT_WRONG_TYPE: return "Coinbase transaction output must be OutputKey type";
case TransactionValidationError::OUTPUT_UNEXPECTED_TYPE: return "Coinbase transaction output must be KeyOutput type";
default: return "Unknown error";
}
}
Expand Down

0 comments on commit 49968f2

Please sign in to comment.