github.com/deso-protocol/core@v1.2.9/lib/errors.go (about)

     1  package lib
     2  
     3  import "strings"
     4  
     5  // RuleError is an error type that specifies an error occurred during
     6  // block processing that is related to a consensus rule. By checking the
     7  // type of the error the caller can determine that the error was due to
     8  // a consensus rule and determine which consensus rule caused the issue.
     9  type RuleError string
    10  
    11  const (
    12  	RuleErrorDuplicateBlock                       RuleError = "RuleErrorDuplicateBlock"
    13  	RuleErrorDuplicateOrphan                      RuleError = "RuleErrorDuplicateOrphan"
    14  	RuleErrorMinDifficulty                        RuleError = "RuleErrorMinDifficulty"
    15  	RuleErrorBlockTooBig                          RuleError = "RuleErrorBlockTooBig"
    16  	RuleErrorNoTxns                               RuleError = "RuleErrorNoTxns"
    17  	RuleErrorFirstTxnMustBeBlockReward            RuleError = "RuleErrorFirstTxnMustBeBlockReward"
    18  	RuleErrorMoreThanOneBlockReward               RuleError = "RuleErrorMoreThanOneBlockReward"
    19  	RuleErrorPreviousBlockInvalid                 RuleError = "RuleErrorPreviousBlockInvalid"
    20  	RuleErrorPreviousBlockHeaderInvalid           RuleError = "RuleErrorPreviousBlockHeaderInvalid"
    21  	RuleErrorTxnMustHaveAtLeastOneInput           RuleError = "RuleErrorTxnMustHaveAtLeastOneInput"
    22  	RuleErrorTxnMustHaveAtLeastOneOutput          RuleError = "RuleErrorTxnMustHaveAtLeastOneOutput"
    23  	RuleErrorOutputExceedsMax                     RuleError = "RuleErrorOutputExceedsMax"
    24  	RuleErrorOutputOverflowsTotal                 RuleError = "RuleErrorOutputOverflowsTotal"
    25  	RuleErrorTotalOutputExceedsMax                RuleError = "RuleErrorTotalOutputExceedsMax"
    26  	RuleErrorDuplicateInputs                      RuleError = "RuleErrorDuplicateInputs"
    27  	RuleErrorInvalidTxnMerkleRoot                 RuleError = "RuleErrorInvalidTxnMerkleRoot"
    28  	RuleErrorDuplicateTxn                         RuleError = "RuleErrorDuplicateTxn"
    29  	RuleErrorInputSpendsNonexistentUtxo           RuleError = "RuleErrorInputSpendsNonexistentUtxo"
    30  	RuleErrorInputSpendsPreviouslySpentOutput     RuleError = "RuleErrorInputSpendsPreviouslySpentOutput"
    31  	RuleErrorInputSpendsImmatureBlockReward       RuleError = "RuleErrorInputSpendsImmatureBlockReward"
    32  	RuleErrorInputSpendsOutputWithInvalidAmount   RuleError = "RuleErrorInputSpendsOutputWithInvalidAmount"
    33  	RuleErrorTxnOutputWithInvalidAmount           RuleError = "RuleErrorTxnOutputWithInvalidAmount"
    34  	RuleErrorTxnOutputExceedsInput                RuleError = "RuleErrorTxnOutputExceedsInput"
    35  	RuleErrorTxnFeeBelowNetworkMinimum            RuleError = "RuleErrorTxnFeeBelowNetworkMinimum"
    36  	RuleErrorOverflowDetectedInFeeRateCalculation RuleError = "RuleErrorOverflowDetectedInFeeRateCalculation"
    37  	RuleErrorBlockRewardOutputWithInvalidAmount   RuleError = "RuleErrorBlockRewardOutputWithInvalidAmount"
    38  	RuleErrorBlockRewardOverflow                  RuleError = "RuleErrorBlockRewardOverflow"
    39  	RuleErrorBlockRewardExceedsMaxAllowed         RuleError = "RuleErrorBlockRewardExceedsMaxAllowed"
    40  	RuleErrorProfileUsernameExists                RuleError = "RuleErrorProfileUsernameExists"
    41  	RuleErrorPubKeyLen                            RuleError = "RuleErrorPubKeyLen"
    42  	RuleErrorMaxProfilePicSize                    RuleError = "RuleErrorMaxProfilePicSize"
    43  	RuleErrorProfileCreatorPercentageSize         RuleError = "RuleErrorProfileCreatorPercentageSize"
    44  	RuleErrorProfileStakeMultipleSize             RuleError = "RuleErrorProfileStakeMultipleSize"
    45  	RuleErrorInvalidUsername                      RuleError = "RuleErrorInvalidUsername"
    46  	RuleErrorEncryptedDataLen                     RuleError = "RuleErrorEncryptedDataLen"
    47  	RuleErrorInputOverflows                       RuleError = "RuleErrorInputOverflows"
    48  	RuleErrorInsufficientRefund                   RuleError = "RuleErrorInsufficientRefund"
    49  	RuleErrorMissingSignature                     RuleError = "RuleErrorMissingSignature"
    50  	RuleErrorSigHash                              RuleError = "RuleErrorSigHash"
    51  	RuleErrorParsePublicKey                       RuleError = "RuleErrorParsePublicKey"
    52  	RuleErrorSigCheckFailed                       RuleError = "RuleErrorSigCheckFailed"
    53  	RuleErrorOutputPublicKeyNotRecognized         RuleError = "RuleErrorOutputPublicKeyNotRecognized"
    54  	RuleErrorInputsWithDifferingSpendKeys         RuleError = "RuleErrorInputsWithDifferingSpendKeys"
    55  	RuleErrorInvalidTransactionSignature          RuleError = "RuleErrorInvalidTransactionSignature"
    56  
    57  	RuleErrorMissingBlockProducerSignature                      RuleError = "RuleErrorMissingBlockProducerSignature"
    58  	RuleErrorInvalidBlockProducerPublicKey                      RuleError = "RuleErrorInvalidBlockProducerPublicKey"
    59  	RuleErrorBlockProducerPublicKeyNotInWhitelist               RuleError = "RuleErrorBlockProducerPublicKeyNotInWhitelist"
    60  	RuleErrorForbiddenBlockProducerPublicKey                    RuleError = "RuleErrorForbiddenBlockProducerPublicKey"
    61  	RuleErrorInvalidBlockProducerSIgnature                      RuleError = "RuleErrorInvalidBlockProducerSIgnature"
    62  	RuleErrorInvalidBlockHeader                                 RuleError = "RuleErrorInvalidBlockHeader"
    63  	RuleErrorOrphanBlock                                        RuleError = "RuleErrorOrphanBlock"
    64  	RuleErrorInputWithPublicKeyDifferentFromTxnPublicKey        RuleError = "RuleErrorInputWithPublicKeyDifferentFromTxnPublicKey"
    65  	RuleErrorBlockRewardTxnNotAllowedToHaveInputs               RuleError = "RuleErrorBlockRewardTxnNotAllowedToHaveInputs"
    66  	RuleErrorBlockRewardTxnNotAllowedToHaveSignature            RuleError = "RuleErrorBlockRewardTxnNotAllowedToHaveSignature"
    67  	RuleErrorDeflationBombForbidsMintingAnyMoreDeSo             RuleError = "RuleErrorDeflationBombForbidsMintingAnyMoreDeSo"
    68  	RuleErrorBitcoinExchangeShouldNotHaveInputs                 RuleError = "RuleErrorBitcoinExchangeShouldNotHaveInputs"
    69  	RuleErrorBitcoinExchangeShouldNotHaveOutputs                RuleError = "RuleErrorBitcoinExchangeShouldNotHaveOutputs"
    70  	RuleErrorBitcoinExchangeShouldNotHavePublicKey              RuleError = "RuleErrorBitcoinExchangeShouldNotHavePublicKey"
    71  	RuleErrorBitcoinExchangeShouldNotHaveSignature              RuleError = "RuleErrorBitcoinExchangeShouldNotHaveSignature"
    72  	RuleErrorBitcoinExchangeHasBadBitcoinTxHash                 RuleError = "RuleErrorBitcoinExchangeHasBadBitcoinTxHash"
    73  	RuleErrorBitcoinExchangeDoubleSpendingBitcoinTransaction    RuleError = "RuleErrorBitcoinExchangeDoubleSpendingBitcoinTransaction"
    74  	RuleErrorBitcoinExchangeBlockHashNotFoundInMainBitcoinChain RuleError = "RuleErrorBitcoinExchangeBlockHashNotFoundInMainBitcoinChain"
    75  	RuleErrorBitcoinExchangeHasBadMerkleRoot                    RuleError = "RuleErrorBitcoinExchangeHasBadMerkleRoot"
    76  	RuleErrorBitcoinExchangeInvalidMerkleProof                  RuleError = "RuleErrorBitcoinExchangeInvalidMerkleProof"
    77  	RuleErrorBitcoinExchangeValidPublicKeyNotFoundInInputs      RuleError = "RuleErrorBitcoinExchangeValidPublicKeyNotFoundInInputs"
    78  	RuleErrorBitcoinExchangeProblemComputingBurnOutput          RuleError = "RuleErrorBitcoinExchangeProblemComputingBurnOutput"
    79  	RuleErrorBitcoinExchangeFeeOverflow                         RuleError = "RuleErrorBitcoinExchangeFeeOverflow"
    80  	RuleErrorBitcoinExchangeTotalOutputLessThanOrEqualZero      RuleError = "RuleErrorBitcoinExchangeTotalOutputLessThanOrEqualZero"
    81  	RuleErrorTxnSanity                                          RuleError = "RuleErrorTxnSanity"
    82  	RuleErrorTxnTooBig                                          RuleError = "RuleErrorTxnTooBig"
    83  
    84  	RuleErrorPrivateMessageEncryptedTextLengthExceedsMax           RuleError = "RuleErrorPrivateMessageEncryptedTextLengthExceedsMax"
    85  	RuleErrorPrivateMessageRecipientPubKeyLen                      RuleError = "RuleErrorPrivateMessageRecipientPubKeyLen"
    86  	RuleErrorPrivateMessageTstampIsZero                            RuleError = "RuleErrorPrivateMessageTstampIsZero"
    87  	RuleErrorTransactionMissingPublicKey                           RuleError = "RuleErrorTransactionMissingPublicKey"
    88  	RuleErrorPrivateMessageExistsWithSenderPublicKeyTstampTuple    RuleError = "RuleErrorPrivateMessageExistsWithSenderPublicKeyTstampTuple"
    89  	RuleErrorPrivateMessageExistsWithRecipientPublicKeyTstampTuple RuleError = "RuleErrorPrivateMessageExistsWithRecipientPublicKeyTstampTuple"
    90  	RuleErrorPrivateMessageParsePubKeyError                        RuleError = "RuleErrorPrivateMessageParsePubKeyError"
    91  	RuleErrorPrivateMessageSenderPublicKeyEqualsRecipientPublicKey RuleError = "RuleErrorPrivateMessageSenderPublicKeyEqualsRecipientPublicKey"
    92  	RuleErrorBurnAddressCannotBurnBitcoin                          RuleError = "RuleErrorBurnAddressCannotBurnBitcoin"
    93  
    94  	RuleErrorFollowPubKeyLen                         RuleError = "RuleErrorFollowFollowedPubKeyLen"
    95  	RuleErrorFollowParsePubKeyError                  RuleError = "RuleErrorFollowParsePubKeyError"
    96  	RuleErrorFollowEntryAlreadyExists                RuleError = "RuleErrorFollowEntryAlreadyExists"
    97  	RuleErrorFollowingNonexistentProfile             RuleError = "RuleErrorFollowingNonexistentProfile"
    98  	RuleErrorCannotUnfollowNonexistentFollowEntry    RuleError = "RuleErrorCannotUnfollowNonexistentFollowEntry"
    99  	RuleErrorProfilePublicKeyNotEqualToPKIDPublicKey RuleError = "RuleErrorProfilePublicKeyNotEqualToPKIDPublicKey"
   100  
   101  	RuleErrorLikeEntryAlreadyExists            RuleError = "RuleErrorLikeEntryAlreadyExists"
   102  	RuleErrorCannotLikeNonexistentPost         RuleError = "RuleErrorCannotLikeNonexistentPost"
   103  	RuleErrorCannotUnlikeWithoutAnExistingLike RuleError = "RuleErrorCannotUnlikeWithoutAnExistingLike"
   104  
   105  	RuleErrorProfileUsernameTooShort            RuleError = "RuleErrorProfileUsernameTooShort"
   106  	RuleErrorProfileDescriptionTooShort         RuleError = "RuleErrorProfileDescriptionTooShort"
   107  	RuleErrorProfileUsernameTooLong             RuleError = "RuleErrorProfileUsernameTooLong"
   108  	RuleErrorProfileDescriptionTooLong          RuleError = "RuleErrorProfileDescriptionTooLong"
   109  	RuleErrorProfileProfilePicTooShort          RuleError = "RuleErrorProfileProfilePicTooShort"
   110  	RuleErrorProfileUpdateRequiresNonZeroInput  RuleError = "RuleErrorProfileUpdateRequiresNonZeroInput"
   111  	RuleErrorCreateProfileTxnOutputExceedsInput RuleError = "RuleErrorCreateProfileTxnOutputExceedsInput"
   112  	RuleErrorProfilePublicKeySize               RuleError = "RuleErrorProfilePublicKeySize"
   113  	RuleErrorProfileBadPublicKey                RuleError = "RuleErrorProfileBadPublicKey"
   114  	RuleErrorProfilePubKeyNotAuthorized         RuleError = "RuleErrorProfilePubKeyNotAuthorized"
   115  	RuleErrorProfileModificationNotAuthorized   RuleError = "RuleErrorProfileModificationNotAuthorized"
   116  	RuleErrorProfileUsernameCannotContainZeros  RuleError = "RuleErrorProfileUsernameCannotContainZeros"
   117  
   118  	RuleSubmitPostNilParentPostHash                  RuleError = "RuleSubmitPostNilParentPostHash"
   119  	RuleSubmitPostTitleLength                        RuleError = "RuleSubmitPostTitleLength"
   120  	RuleSubmitPostBodyLength                         RuleError = "RuleSubmitPostBodyLength"
   121  	RuleSubmitPostSubLength                          RuleError = "RuleSubmitPostSubLength"
   122  	RuleErrorSubmitPostStakeMultipleSize             RuleError = "RuleErrorSubmitPostStakeMultipleSize"
   123  	RuleErrorSubmitPostCreatorPercentageSize         RuleError = "RuleErrorSubmitPostCreatorPercentageSize"
   124  	RuleErrorSubmitPostTimestampIsZero               RuleError = "RuleErrorSubmitPostTimestampIsZero"
   125  	RuleErrorPostAlreadyExists                       RuleError = "RuleErrorPostAlreadyExists"
   126  	RuleErrorSubmitPostInvalidCommentStakeID         RuleError = "RuleErrorSubmitPostInvalidCommentStakeID"
   127  	RuleErrorSubmitPostRequiresNonZeroInput          RuleError = "RuleErrorSubmitPostRequiresNonZeroInput"
   128  	RuleErrorSubmitPostInvalidPostHashToModify       RuleError = "RuleErrorSubmitPostInvalidPostHashToModify"
   129  	RuleErrorSubmitPostModifyingNonexistentPost      RuleError = "RuleErrorSubmitPostModifyingNonexistentPost"
   130  	RuleErrorSubmitPostPostModificationNotAuthorized RuleError = "RuleErrorSubmitPostPostModificationNotAuthorized"
   131  	RuleErrorSubmitPostInvalidParentStakeIDLength    RuleError = "RuleErrorSubmitPostInvalidParentStakeIDLength"
   132  	RuleErrorSubmitPostParentNotFound                RuleError = "RuleErrorSubmitPostParentNotFound"
   133  	RuleErrorSubmitPostRepostPostNotFound            RuleError = "RuleErrorSubmitPostRepostPostNotFound"
   134  	RuleErrorSubmitPostRepostOfRepost                RuleError = "RuleErrorSubmitPostRepostOfRepost"
   135  	RuleErrorSubmitPostUpdateRepostHash              RuleError = "RuleErrorSubmitPostUpdateRepostHash"
   136  	RuleErrorSubmitPostUpdateIsQuotedRepost          RuleError = "RuleErrorSubmitPostUpdateIsQuotedRepost"
   137  	RuleErrorSubmitPostCannotUpdateNFT               RuleError = "RuleErrorSubmitPostCannotUpdateNFT"
   138  
   139  	RuleErrorInvalidStakeID                      RuleError = "RuleErrorInvalidStakeID"
   140  	RuleErrorInvalidStakeIDSize                  RuleError = "RuleErrorInvalidStakeIDSize"
   141  	RuleErrorStakingToNonexistentPost            RuleError = "RuleErrorStakingToNonexistentPost"
   142  	RuleErrorStakingToNonexistentProfile         RuleError = "RuleErrorStakingToNonexistentProfile"
   143  	RuleErrorNotImplemented                      RuleError = "RuleErrorNotImplemented"
   144  	RuleErrorStakingZeroNanosNotAllowed          RuleError = "RuleErrorStakingZeroNanosNotAllowed"
   145  	RuleErrorAddStakeTxnMustHaveExactlyOneOutput RuleError = "RuleErrorAddStakeTxnMustHaveExactlyOneOutput"
   146  	RuleErrorExistingStakeExceedsMaxAllowed      RuleError = "RuleErrorExistingStakeExceedsMaxAllowed"
   147  	RuleErrorAddStakeRequiresNonZeroInput        RuleError = "RuleErrorAddStakeRequiresNonZeroInput"
   148  	RuleErrorProfileForPostDoesNotExist          RuleError = "RuleErrorProfileForPostDoesNotExist"
   149  
   150  	// Global Params
   151  	RuleErrorExchangeRateTooLow                    RuleError = "RuleErrorExchangeRateTooLow"
   152  	RuleErrorExchangeRateTooHigh                   RuleError = "RuleErrorExchangeRateTooHigh"
   153  	RuleErrorMinNetworkFeeTooLow                   RuleError = "RuleErrorMinNetworkFeeTooLow"
   154  	RuleErrorMinNetworkFeeTooHigh                  RuleError = "RuleErrorMinNetworkFeeTooHigh"
   155  	RuleErrorCreateProfileFeeTooLow                RuleError = "RuleErrorCreateProfileFeeTooLow"
   156  	RuleErrorCreateProfileTooHigh                  RuleError = "RuleErrorCreateProfileTooHigh"
   157  	RuleErrorCreateNFTFeeTooLow                    RuleError = "RuleErrorCreateNFTFeeTooLow"
   158  	RuleErrorCreateNFTFeeTooHigh                   RuleError = "RuleErrorCreateNFTFeeTooHigh"
   159  	RuleErrorMaxCopiesPerNFTTooLow                 RuleError = "RuleErrorMaxCopiesPerNFTTooLow"
   160  	RuleErrorMaxCopiesPerNFTTooHigh                RuleError = "RuleErrorMaxCopiesPerNFTTooHigh"
   161  	RuleErrorForbiddenPubKeyLength                 RuleError = "RuleErrorForbiddenPubKeyLength"
   162  	RuleErrorUserNotAuthorizedToUpdateExchangeRate RuleError = "RuleErrorUserNotAuthorizedToUpdateExchangeRate"
   163  	RuleErrorUserNotAuthorizedToUpdateGlobalParams RuleError = "RuleErrorUserNotAuthorizedToUpdateGlobalParams"
   164  	RuleErrorUserOutputMustBeNonzero               RuleError = "RuleErrorUserOutputMustBeNonzero"
   165  
   166  	// DeSo Diamonds
   167  	RuleErrorBasicTransferHasDiamondPostHashWithoutDiamondLevel   RuleError = "RuleErrorBasicTransferHasDiamondPostHashWithoutDiamondLevel"
   168  	RuleErrorBasicTransferHasInvalidDiamondLevel                  RuleError = "RuleErrorBasicTransferHasInvalidDiamondLevel"
   169  	RuleErrorBasicTransferDiamondInvalidLengthForPostHashBytes    RuleError = "RuleErrorBasicTransferInvalidLengthForPostHashBytes"
   170  	RuleErrorBasicTransferDiamondPostEntryDoesNotExist            RuleError = "RuleErrorBasicTransferDiamondPostEntryDoesNotExist"
   171  	RuleErrorBasicTransferInsufficientCreatorCoinsForDiamondLevel RuleError = "RuleErrorBasicTransferInsufficientCreatorCoinsForDiamondLevel"
   172  	RuleErrorBasicTransferDiamondCannotTransferToSelf             RuleError = "RuleErrorBasicTransferDiamondCannotTransferToSelf"
   173  	RuleErrorBasicTransferInsufficientDeSoForDiamondLevel         RuleError = "RuleErrorBasicTransferInsufficientDeSoForDiamondLevel"
   174  
   175  	RuleErrorCreatorCoinTransferRequiresNonZeroInput                    RuleError = "RuleErrorCreatorCoinTransferRequiresNonZeroInput"
   176  	RuleErrorCreatorCoinTransferInvalidProfilePubKeySize                RuleError = "RuleErrorCreatorCoinTransferInvalidProfilePubKeySize"
   177  	RuleErrorCreatorCoinTransferInvalidReceiverPubKeySize               RuleError = "RuleErrorCreatorCoinTransferInvalidReceiverPubKeySize"
   178  	RuleErrorCreatorCoinTransferOnNonexistentProfile                    RuleError = "RuleErrorCreatorCoinTransferOnNonexistentProfile"
   179  	RuleErrorCreatorCoinTransferBalanceEntryDoesNotExist                RuleError = "RuleErrorCreatorCoinTransferBalanceEntryDoesNotExist"
   180  	RuleErrorCreatorCoinTransferMustBeGreaterThanMinThreshold           RuleError = "RuleErrorCreatorCoinTransferMustBeGreaterThanMinThreshold"
   181  	RuleErrorCreatorCoinTransferInsufficientCoins                       RuleError = "RuleErrorCreatorCoinTransferInsufficientCoins"
   182  	RuleErrorCreatorCoinTransferCannotTransferToSelf                    RuleError = "RuleErrorCreatorCoinTransferCannotTransferToSelf"
   183  	RuleErrorCreatorCoinTransferHasDiamondPostHashWithoutDiamondLevel   RuleError = "RuleErrorCreatorCoinTransferHasDiamondPostHashWithoutDiamondLevel"
   184  	RuleErrorCreatorCoinTransferCantSendDiamondsForOtherProfiles        RuleError = "RuleErrorCreatorCoinTransferCantSendDiamondsForOtherProfiles"
   185  	RuleErrorCreatorCoinTransferCantDiamondYourself                     RuleError = "RuleErrorCreatorCoinTransferCantDiamondYourself"
   186  	RuleErrorCreatorCoinTransferInvalidLengthForPostHashBytes           RuleError = "RuleErrorCreatorCoinTransferInvalidLengthForPostHashBytes"
   187  	RuleErrorCreatorCoinTransferInsufficientCreatorCoinsForDiamondLevel RuleError = "RuleErrorCreatorCoinTransferInsufficientCreatorCoinsForDiamondLevel"
   188  	RuleErrorCreatorCoinTransferHasInvalidDiamondLevel                  RuleError = "RuleErrorCreatorCoinTransferHasInvalidDiamondLevel"
   189  	RuleErrorCreatorCoinTransferHasDiamondsAfterDeSoBlockHeight         RuleError = "RuleErrorCreatorCoinTransferHasDiamondsAfterDeSoBlockHeight"
   190  	RuleErrorCreatorCoinTransferPostAlreadyHasSufficientDiamonds        RuleError = "RuleErrorCreatorCoinTransferPostAlreadyHasSufficientDiamonds"
   191  	RuleErrorCreatorCoinTransferDiamondsCantHaveNegativeNanos           RuleError = "RuleErrorCreatorCoinTransferDiamondsCantHaveNegativeNanos"
   192  	RuleErrorCreatorCoinTransferDiamondPostEntryDoesNotExist            RuleError = "RuleErrorCreatorCoinTransferDiamondPostEntryDoesNotExist"
   193  
   194  	RuleErrorCreatorCoinRequiresNonZeroInput                           RuleError = "RuleErrorCreatorCoinRequiresNonZeroInput"
   195  	RuleErrorCreatorCoinInvalidPubKeySize                              RuleError = "RuleErrorCreatorCoinInvalidPubKeySize"
   196  	RuleErrorCreatorCoinOperationOnNonexistentProfile                  RuleError = "RuleErrorCreatorCoinOperationOnNonexistentProfile"
   197  	RuleErrorCreatorCoinBuyMustTradeNonZeroDeSo                        RuleError = "RuleErrorCreatorCoinBuyMustTradeNonZeroDeSo"
   198  	RuleErrorCreatorCoinTxnOutputWithInvalidBuyAmount                  RuleError = "RuleErrorCreatorCoinTxnOutputWithInvalidBuyAmount"
   199  	RuleErrorCreatorCoinTxnOutputExceedsInput                          RuleError = "RuleErrorCreatorCoinTxnOutputExceedsInput"
   200  	RuleErrorCreatorCoinLessThanMinimumSetByUser                       RuleError = "RuleErrorCreatorCoinLessThanMinimumSetByUser"
   201  	RuleErrorCreatorCoinBuyMustTradeNonZeroDeSoAfterFees               RuleError = "RuleErrorCreatorCoinBuyMustTradeNonZeroDeSoAfterFees"
   202  	RuleErrorCreatorCoinBuyMustTradeNonZeroDeSoAfterFounderReward      RuleError = "RuleErrorCreatorCoinBuyMustTradeNonZeroDeSoAfterFounderReward"
   203  	RuleErrorCreatorCoinBuyMustSatisfyAutoSellThresholdNanos           RuleError = "RuleErrorCreatorCoinBuyMustSatisfyAutoSellThresholdNanos"
   204  	RuleErrorCreatorCoinBuyMustSatisfyAutoSellThresholdNanosForCreator RuleError = "RuleErrorCreatorCoinBuyMustSatisfyAutoSellThresholdNanosForCreator"
   205  	RuleErrorCreatorCoinBuyMustSatisfyAutoSellThresholdNanosForBuyer   RuleError = "RuleErrorCreatorCoinBuyMustSatisfyAutoSellThresholdNanosForBuyer"
   206  	RuleErrorCreatorCoinBuyZeroLockedNanosAndNonZeroHolders            RuleError = "RuleErrorCreatorCoinBuyZeroLockedNanosAndNonZeroHolders"
   207  	RuleErrorCreatorCoinSellMustHaveAtLeastOneInput                    RuleError = "RuleErrorCreatorCoinSellMustHaveAtLeastOneInput"
   208  	RuleErrorCreatorCoinSellMustTradeNonZeroCreatorCoin                RuleError = "RuleErrorCreatorCoinSellMustTradeNonZeroCreatorCoin"
   209  	RuleErrorCreatorCoinSellerBalanceEntryDoesNotExist                 RuleError = "RuleErrorCreatorCoinSellerBalanceEntryDoesNotExist"
   210  	RuleErrorCreatorCoinSellInsufficientCoins                          RuleError = "RuleErrorCreatorCoinSellInsufficientCoins"
   211  	RuleErrorCreatorCoinSellNotAllowedWhenZeroDeSoLocked               RuleError = "RuleErrorCreatorCoinSellNotAllowedWhenZeroDeSoLocked"
   212  	RuleErrorDeSoReceivedIsLessThanMinimumSetBySeller                  RuleError = "RuleErrorDeSoReceivedIsLessThanMinimumSetBySeller"
   213  
   214  	// Derived Keys
   215  	RuleErrorAuthorizeDerivedKeyAccessSignatureNotValid RuleError = "RuleErrorAuthorizeDerivedKeyAccessSignatureNotValid"
   216  	RuleErrorAuthorizeDerivedKeyRequiresNonZeroInput    RuleError = "RuleErrorAuthorizeDerivedKeyRequiresNonZeroInput"
   217  	RuleErrorAuthorizeDerivedKeyExpiredDerivedPublicKey RuleError = "RuleErrorAuthorizeDerivedKeyExpired"
   218  	RuleErrorAuthorizeDerivedKeyInvalidDerivedPublicKey RuleError = "RuleErrorAuthorizeDerivedKeyInvalidDerivedKey"
   219  	RuleErrorAuthorizeDerivedKeyDeletedDerivedPublicKey RuleError = "RuleErrorAuthorizeDerivedKeyDeletedDerivedPublicKey"
   220  	RuleErrorAuthorizeDerivedKeyInvalidOwnerPublicKey   RuleError = "RuleErrorAuthorizeDerivedKeyInvalidOwnerPublicKey"
   221  	RuleErrorDerivedKeyNotAuthorized                    RuleError = "RuleErrorDerivedKeyNotAuthorized"
   222  	RuleErrorDerivedKeyInvalidExtraData                 RuleError = "RuleErrorDerivedKeyInvalidExtraData"
   223  	RuleErrorDerivedKeyBeforeBlockHeight                RuleError = "RuleErrorDerivedKeyBeforeBlockHeight"
   224  
   225  	// NFTs
   226  	RuleErrorTooManyNFTCopies                     RuleError = "RuleErrorTooManyNFTCopies"
   227  	RuleErrorCreateNFTRequiresNonZeroInput        RuleError = "RuleErrorCreateNFTRequiresNonZeroInput"
   228  	RuleErrorUpdateNFTRequiresNonZeroInput        RuleError = "RuleErrorUpdateNFTRequiresNonZeroInput"
   229  	RuleErrorCreateNFTOnNonexistentPost           RuleError = "RuleErrorCreateNFTOnNonexistentPost"
   230  	RuleErrorCreateNFTOnVanillaRepost             RuleError = "RuleErrorCreateNFTOnVanillaRepost"
   231  	RuleErrorCreateNFTWithInsufficientFunds       RuleError = "RuleErrorCreateNFTWithInsufficientFunds"
   232  	RuleErrorCreateNFTOnPostThatAlreadyIsNFT      RuleError = "RuleErrorCreateNFTOnPostThatAlreadyIsNFT"
   233  	RuleErrorCreateNFTMustBeCalledByPoster        RuleError = "RuleErrorCreateNFTMustBeCalledByPoster"
   234  	RuleErrorNFTMustHaveNonZeroCopies             RuleError = "RuleErrorNFTMustHaveNonZeroCopies"
   235  	RuleErrorCannotUpdateNonExistentNFT           RuleError = "RuleErrorCannotUpdateNonExistentNFT"
   236  	RuleErrorCannotUpdatePendingNFTTransfer       RuleError = "RuleErrorCannotUpdatePendingNFTTransfer"
   237  	RuleErrorCannotAcceptBidForPendingNFTTransfer RuleError = "RuleErrorCannotAcceptBidForPendingNFTTransfer"
   238  	RuleErrorCannotBidForPendingNFTTransfer       RuleError = "RuleErrorCannotBidForPendingNFTTransfer"
   239  	RuleErrorUpdateNFTByNonOwner                  RuleError = "RuleErrorUpdateNFTByNonOwner"
   240  	RuleErrorAcceptNFTBidByNonOwner               RuleError = "RuleErrorAcceptNFTBidByNonOwner"
   241  	RuleErrorCantCreateNFTWithoutProfileEntry     RuleError = "RuleErrorCantCreateNFTWithoutProfileEntry"
   242  	RuleErrorNFTRoyaltyHasTooManyBasisPoints      RuleError = "RuleErrorNFTRoyaltyHasTooManyBasisPoints"
   243  	RuleErrorNFTRoyaltyOverflow                   RuleError = "RuleErrorNFTRoyaltyOverflow"
   244  	RuleErrorNFTUpdateMustUpdateIsForSaleStatus   RuleError = "RuleErrorNFTUpdateMustUpdateIsForSaleStatus"
   245  
   246  	// NFT Bids
   247  	RuleErrorNFTBidRequiresNonZeroInput                    RuleError = "RuleErrorNFTBidRequiresNonZeroInput"
   248  	RuleErrorAcceptNFTBidRequiresNonZeroInput              RuleError = "RuleErrorAcceptNFTBidRequiresNonZeroInput"
   249  	RuleErrorNFTBidOnNonExistentPost                       RuleError = "RuleErrorNFTBidOnNonExistentPost"
   250  	RuleErrorNFTBidOnPostThatIsNotAnNFT                    RuleError = "RuleErrorNFTBidOnPostThatIsNotAnNFT"
   251  	RuleErrorNFTBidOnInvalidSerialNumber                   RuleError = "RuleErrorNFTBidOnInvalidSerialNumber"
   252  	RuleErrorNFTBidOnNonExistentNFTEntry                   RuleError = "RuleErrorNFTBidOnNonExistentNFTEntry"
   253  	RuleErrorNFTBidOnNFTThatIsNotForSale                   RuleError = "RuleErrorNFTBidOnNFTThatIsNotForSale"
   254  	RuleErrorNFTOwnerCannotBidOnOwnedNFT                   RuleError = "RuleErrorNFTOwnerCannotBidOnOwnedNFT"
   255  	RuleErrorCantAcceptNonExistentBid                      RuleError = "RuleErrorCantAcceptNonExistentBid"
   256  	RuleErrorAcceptedNFTBidAmountDoesNotMatch              RuleError = "RuleErrorAcceptedNFTBidAmountDoesNotMatch"
   257  	RuleErrorPostEntryNotFoundForAcceptedNFTBid            RuleError = "RuleErrorPostEntryNotFoundForAcceptedNFTBid"
   258  	RuleErrorUnlockableNFTMustProvideUnlockableText        RuleError = "RuleErrorUnlockableNFTMustProvideUnlockableText"
   259  	RuleErrorUnlockableTextLengthExceedsMax                RuleError = "RuleErrorUnlockableTextLengthExceedsMax"
   260  	RuleErrorAcceptedNFTBidMustSpecifyBidderInputs         RuleError = "RuleErrorAcceptedNFTBidMustSpecifyBidderInputs"
   261  	RuleErrorBidderInputForAcceptedNFTBidNoLongerExists    RuleError = "RuleErrorBidderInputForAcceptedNFTBidNoLongerExists"
   262  	RuleErrorAcceptNFTBidderInputsInsufficientForBidAmount RuleError = "RuleErrorAcceptNFTBidderInputsInsufficientForBidAmount"
   263  	RuleErrorInsufficientFundsForNFTBid                    RuleError = "RuleErrorInsufficientFundsForNFTBid"
   264  	RuleErrorNFTBidLessThanMinBidAmountNanos               RuleError = "RuleErrorNFTBidLessThanMinBidAmountNanos"
   265  
   266  	// NFT Transfers
   267  	RuleErrorNFTTransferBeforeBlockHeight                 RuleError = "RuleErrorNFTTranserBeforeBlockHeight"
   268  	RuleErrorAcceptNFTTransferBeforeBlockHeight           RuleError = "RuleErrorAcceptNFTTranserBeforeBlockHeight"
   269  	RuleErrorNFTTransferInvalidReceiverPubKeySize         RuleError = "RuleErrorNFTTransferInvalidReceiverPubKeySize"
   270  	RuleErrorNFTTransferCannotTransferToSelf              RuleError = "RuleErrorNFTTransferCannotTransferToSelf"
   271  	RuleErrorCannotTransferNonExistentNFT                 RuleError = "RuleErrorCannotTransferNonExistentNFT"
   272  	RuleErrorNFTTransferByNonOwner                        RuleError = "RuleErrorNFTTransferByNonOwner"
   273  	RuleErrorCannotTransferForSaleNFT                     RuleError = "RuleErrorCannotTransferForSaleNFT"
   274  	RuleErrorCannotTransferUnlockableNFTWithoutUnlockable RuleError = "RuleErrorCannotTransferUnlockableNFTWithoutUnlockable"
   275  	RuleErrorNFTTransferRequiresNonZeroInput              RuleError = "RuleErrorNFTTransferRequiresNonZeroInput"
   276  	RuleErrorCannotAcceptTransferOfNonExistentNFT         RuleError = "RuleErrorCannotAcceptTransferOfNonExistentNFT"
   277  	RuleErrorAcceptNFTTransferByNonOwner                  RuleError = "RuleErrorAcceptNFTTransferByNonOwner"
   278  	RuleErrorAcceptNFTTransferForNonPendingNFT            RuleError = "RuleErrorAcceptNFTTransferForNonPendingNFT"
   279  	RuleErrorAcceptNFTTransferRequiresNonZeroInput        RuleError = "RuleErrorAcceptNFTTransferRequiresNonZeroInput"
   280  
   281  	// NFT Burns
   282  	RuleErrorBurnNFTBeforeBlockHeight    RuleError = "RuleErrorBurnNFTBeforeBlockHeight"
   283  	RuleErrorCannotBurnNonExistentNFT    RuleError = "RuleErrorCannotBurnNonExistentNFT"
   284  	RuleErrorBurnNFTByNonOwner           RuleError = "RuleErrorBurnNFTByNonOwner"
   285  	RuleErrorCannotBurnNFTThatIsForSale  RuleError = "RuleErrorCannotBurnNFTThatIsForSale"
   286  	RuleErrorBurnNFTRequiresNonZeroInput RuleError = "RuleErrorBurnNFTRequiresNonZeroInput"
   287  
   288  	RuleErrorSwapIdentityIsParamUpdaterOnly RuleError = "RuleErrorSwapIdentityIsParamUpdaterOnly"
   289  	RuleErrorFromPublicKeyIsRequired        RuleError = "RuleErrorFromPublicKeyIsRequired"
   290  	RuleErrorInvalidFromPublicKey           RuleError = "RuleErrorInvalidFromPublicKey"
   291  	RuleErrorToPublicKeyIsRequired          RuleError = "RuleErrorToPublicKeyIsRequired"
   292  	RuleErrorInvalidToPublicKey             RuleError = "RuleErrorInvalidToPublicKey"
   293  	RuleErrorOldFromPublicKeyHasDeletedPKID RuleError = "RuleErrorOldFromPublicKeyHasDeletedPKID"
   294  	RuleErrorOldToPublicKeyHasDeletedPKID   RuleError = "RuleErrorOldToPublicKeyHasDeletedPKID"
   295  
   296  	HeaderErrorDuplicateHeader                                                   RuleError = "HeaderErrorDuplicateHeader"
   297  	HeaderErrorNilPrevHash                                                       RuleError = "HeaderErrorNilPrevHash"
   298  	HeaderErrorInvalidParent                                                     RuleError = "HeaderErrorInvalidParent"
   299  	HeaderErrorBlockTooFarInTheFuture                                            RuleError = "HeaderErrorBlockTooFarInTheFuture"
   300  	HeaderErrorTimestampTooEarly                                                 RuleError = "HeaderErrorTimestampTooEarly"
   301  	HeaderErrorBlockDifficultyAboveTarget                                        RuleError = "HeaderErrorBlockDifficultyAboveTarget"
   302  	HeaderErrorHeightInvalid                                                     RuleError = "HeaderErrorHeightInvalid"
   303  	HeaderErrorDifficultyBitsNotConsistentWithTargetDifficultyComputedFromParent RuleError = "HeaderErrorDifficultyBitsNotConsistentWithTargetDifficultyComputedFromParent"
   304  
   305  	TxErrorTooLarge                                                 RuleError = "TxErrorTooLarge"
   306  	TxErrorDuplicate                                                RuleError = "TxErrorDuplicate"
   307  	TxErrorIndividualBlockReward                                    RuleError = "TxErrorIndividualBlockReward"
   308  	TxErrorInsufficientFeeMinFee                                    RuleError = "TxErrorInsufficientFeeMinFee"
   309  	TxErrorInsufficientFeeRateLimit                                 RuleError = "TxErrorInsufficientFeeRateLimit"
   310  	TxErrorInsufficientFeePriorityQueue                             RuleError = "TxErrorInsufficientFeePriorityQueue"
   311  	TxErrorUnconnectedTxnNotAllowed                                 RuleError = "TxErrorUnconnectedTxnNotAllowed"
   312  	TxErrorCannotProcessBitcoinExchangeUntilBitcoinManagerIsCurrent RuleError = "TxErrorCannotProcessBitcoinExchangeUntilBitcoinManagerIsCurrent"
   313  )
   314  
   315  func (e RuleError) Error() string {
   316  	return string(e)
   317  }
   318  
   319  // IsRuleError returns true if the error is any of the errors specified above.
   320  func IsRuleError(err error) bool {
   321  	// TODO: I know I am a bad person for doing a string comparison here, but I
   322  	// realized late in the game that errors.Wrapf warps the type of what it contains
   323  	// and moving this from a type-switch to a string compare is easier than going
   324  	// back and expunging all instances of Wrapf that might cause us to lose the
   325  	// type of RuleError randomly as the error gets passed up the stack. Nevertheless,
   326  	// eventually we should clean this up and get rid of the string comparison both
   327  	// for the code's sake but also for the sake of our tests.
   328  	return strings.Contains(err.Error(), "RuleError") ||
   329  			strings.Contains(err.Error(), "HeaderError") ||
   330  			strings.Contains(err.Error(), "TxError")
   331  }