github.com/turingchain2020/turingchain@v1.1.21/types/error.go (about)

     1  // Copyright Turing Corp. 2018 All Rights Reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package types
     6  
     7  import (
     8  	"errors"
     9  )
    10  
    11  // turingchain定义的错误类型
    12  var (
    13  	ErrSequenceNotMatch        = errors.New("ErrSequenceNotMatch")
    14  	ErrSequenceTooBig          = errors.New("ErrSequenceTooBig")
    15  	ErrTooManySeqCB            = errors.New("ErrTooManySeqCB")
    16  	ErrPushSeqPostData         = errors.New("ErrPushSeqPostData")
    17  	ErrMethodReturnType        = errors.New("ErrMethodReturnType")
    18  	ErrMethodNotFound          = errors.New("ErrMethodNotFound")
    19  	ErrExecBlockNil            = errors.New("ErrExecBlockNil")
    20  	ErrNotAllow                = errors.New("ErrNotAllow")
    21  	ErrCanOnlyDelTopVersion    = errors.New("ErrCanOnlyDelTopVersion")
    22  	ErrPrevVersion             = errors.New("ErrPrevVersion")
    23  	ErrNoExecerInMavlKey       = errors.New("ErrNoExecerInMavlKey")
    24  	ErrMavlKeyNotStartWithMavl = errors.New("ErrMavlKeyNotStartWithMavl")
    25  	ErrNotFound                = errors.New("ErrNotFound")
    26  	ErrBlockExec               = errors.New("ErrBlockExec")
    27  	ErrCheckStateHash          = errors.New("ErrCheckStateHash")
    28  	ErrCheckTxHash             = errors.New("ErrCheckTxHash")
    29  	ErrReRunGenesis            = errors.New("ErrReRunGenesis")
    30  	ErrActionNotSupport        = errors.New("ErrActionNotSupport")
    31  	ErrQueryNotSupport         = errors.New("ErrQueryNotSupport")
    32  	ErrAmount                  = errors.New("ErrAmount")
    33  	ErrMinerIsStared           = errors.New("ErrMinerIsStared")
    34  	ErrMinerNotStared          = errors.New("ErrMinerNotStared")
    35  	ErrMinerNotClosed          = errors.New("ErrMinerNotClosed")
    36  	ErrNoPeer                  = errors.New("ErrNoPeer")
    37  	ErrExecNameNotMatch        = errors.New("ErrExecNameNotMatch")
    38  	ErrChannelClosed           = errors.New("ErrChannelClosed")
    39  	ErrNotMinered              = errors.New("ErrNotMinered")
    40  	ErrFromAddr                = errors.New("ErrFromAddr")
    41  	ErrBlockHeight             = errors.New("ErrBlockHeight")
    42  	ErrBlockTime               = errors.New("ErrBlockTime")
    43  	ErrCoinBaseExecer          = errors.New("ErrCoinBaseExecer")
    44  	ErrCoinBaseTxType          = errors.New("ErrCoinBaseTxType")
    45  	ErrCoinBaseExecErr         = errors.New("ErrCoinBaseExecErr")
    46  	ErrCoinBaseTarget          = errors.New("ErrCoinBaseTarget")
    47  	ErrCoinbaseReward          = errors.New("ErrCoinbaseReward")
    48  	ErrNotAllowDeposit         = errors.New("ErrNotAllowDeposit")
    49  	ErrCoinBaseIndex           = errors.New("ErrCoinBaseIndex")
    50  	ErrCoinBaseTicketStatus    = errors.New("ErrCoinBaseTicketStatus")
    51  	ErrBlockNotFound           = errors.New("ErrBlockNotFound")
    52  	ErrLogType                 = errors.New("ErrLogType")
    53  	ErrInvalidParam            = errors.New("ErrInvalidParam")
    54  	ErrInvalidExpire           = errors.New("ErrInvalidExpire")
    55  	ErrInvalidAddress          = errors.New("ErrInvalidAddress")
    56  	ErrNotInited               = errors.New("ErrNotInited")
    57  
    58  	ErrStartBigThanEnd            = errors.New("ErrStartBigThanEnd")
    59  	ErrToAddrNotSameToExecAddr    = errors.New("ErrToAddrNotSameToExecAddr")
    60  	ErrTypeAsset                  = errors.New("ErrTypeAsset")
    61  	ErrEmpty                      = errors.New("ErrEmpty")
    62  	ErrIsClosed                   = errors.New("ErrIsClosed")
    63  	ErrSendSameToRecv             = errors.New("ErrSendSameToRecv")
    64  	ErrExecNameNotAllow           = errors.New("ErrExecNameNotAllow")
    65  	ErrExecNotFound               = errors.New("ErrExecNotFound")
    66  	ErrLocalDBPerfix              = errors.New("ErrLocalDBPerfix")
    67  	ErrBlockHeaderDifficulty      = errors.New("ErrBlockHeaderDifficulty")
    68  	ErrNoTx                       = errors.New("ErrNoTx")
    69  	ErrTxExist                    = errors.New("ErrTxExist")
    70  	ErrManyTx                     = errors.New("ErrManyTx")
    71  	ErrDupTx                      = errors.New("ErrDupTx")
    72  	ErrMemFull                    = errors.New("ErrMemFull")
    73  	ErrNoBalance                  = errors.New("ErrNoBalance")
    74  	ErrBalanceLessThanTenTimesFee = errors.New("ErrBalanceLessThanTenTimesFee")
    75  	ErrTxExpire                   = errors.New("ErrTxExpire")
    76  	ErrHeaderNotSet               = errors.New("ErrHeaderNotSet")
    77  	ErrSign                       = errors.New("ErrSign")
    78  	ErrCertificate                = errors.New("ErrCertificate")
    79  	ErrFeeTooLow                  = errors.New("ErrFeeTooLow")
    80  	ErrEmptyTx                    = errors.New("ErrEmptyTx")
    81  	ErrTxFeeTooLow                = errors.New("ErrTxFeeTooLow")
    82  	ErrTxFeeTooHigh               = errors.New("ErrTxFeeTooHigh")
    83  	ErrTxMsgSizeTooBig            = errors.New("ErrTxMsgSizeTooBig")
    84  	ErrFutureBlock                = errors.New("ErrFutureBlock")
    85  	ErrHashNotFound               = errors.New("ErrHashNotFound")
    86  	ErrTxDup                      = errors.New("ErrTxDup")
    87  	ErrNotSync                    = errors.New("ErrNotSync")
    88  	ErrSize                       = errors.New("ErrSize")
    89  
    90  	// ErrHashNotExist BlockChain Error Types
    91  	ErrHashNotExist           = errors.New("ErrHashNotExist")
    92  	ErrHeightNotExist         = errors.New("ErrHeightNotExist")
    93  	ErrTxNotExist             = errors.New("ErrTxNotExist")
    94  	ErrAddrNotExist           = errors.New("ErrAddrNotExist")
    95  	ErrStartHeight            = errors.New("ErrStartHeight")
    96  	ErrEndLessThanStartHeight = errors.New("ErrEndLessThanStartHeight")
    97  	ErrClientNotBindQueue     = errors.New("ErrClientNotBindQueue")
    98  	ErrContinueBack           = errors.New("ErrContinueBack")
    99  	ErrUnmarshal              = errors.New("ErrUnmarshal")
   100  	ErrMarshal                = errors.New("ErrMarshal")
   101  	ErrBlockExist             = errors.New("ErrBlockExist")
   102  	ErrParentBlockNoExist     = errors.New("ErrParentBlockNoExist")
   103  	ErrBlockHeightNoMatch     = errors.New("ErrBlockHeightNoEqual")
   104  	ErrParentTdNoExist        = errors.New("ErrParentTdNoExist")
   105  	ErrBlockHashNoMatch       = errors.New("ErrBlockHashNoMatch")
   106  	ErrDecode                 = errors.New("ErrDecode")
   107  	ErrNotRollBack            = errors.New("ErrNotRollBack")
   108  	ErrPeerInfoIsNil          = errors.New("ErrPeerInfoIsNil")
   109  	//ErrWalletIsLocked wallet
   110  	ErrWalletIsLocked       = errors.New("ErrWalletIsLocked")
   111  	ErrSaveSeedFirst        = errors.New("ErrSaveSeedFirst")
   112  	ErrUnLockFirst          = errors.New("ErrUnLockFirst")
   113  	ErrLabelHasUsed         = errors.New("ErrLabelHasUsed")
   114  	ErrPrivkeyExist         = errors.New("ErrPrivkeyExist")
   115  	ErrPrivkey              = errors.New("ErrPrivkey")
   116  	ErrInsufficientBalance  = errors.New("ErrInsufficientBalance")
   117  	ErrInsufficientTokenBal = errors.New("ErrInsufficientTokenBalance")
   118  	ErrInsuffSellOrder      = errors.New("ErrInsufficientSellOrder2buy")
   119  	ErrVerifyOldpasswdFail  = errors.New("ErrVerifyOldpasswdFail")
   120  	ErrInputPassword        = errors.New("ErrInputPassword")
   121  	ErrSeedlang             = errors.New("ErrSeedlang")
   122  	ErrSeedNotExist         = errors.New("ErrSeedNotExist")
   123  	ErrSubPubKeyVerifyFail  = errors.New("ErrSubPubKeyVerifyFail")
   124  	ErrLabelNotExist        = errors.New("ErrLabelNotExist")
   125  	ErrAccountNotExist      = errors.New("ErrAccountNotExist")
   126  	ErrSeedExist            = errors.New("ErrSeedExist")
   127  	ErrNotSupport           = errors.New("ErrNotSupport")
   128  	ErrSeedWordNum          = errors.New("ErrSeedWordNum")
   129  	ErrPubKeyLen            = errors.New("ErrPublicKeyLen")
   130  	ErrPrivateKeyLen        = errors.New("ErrPrivateKeyLen")
   131  	ErrSeedWord             = errors.New("ErrSeedWord")
   132  	ErrNoPrivKeyOrAddr      = errors.New("ErrNoPrivKeyOrAddr")
   133  	ErrNewWalletFromSeed    = errors.New("ErrNewWalletFromSeed")
   134  	ErrNewKeyPair           = errors.New("ErrNewKeyPair")
   135  	ErrPrivkeyToPub         = errors.New("ErrPrivkeyToPub")
   136  
   137  	ErrOnlyTicketUnLocked = errors.New("ErrOnlyTicketUnLocked")
   138  	ErrNewCrypto          = errors.New("ErrNewCrypto")
   139  	ErrFromHex            = errors.New("ErrFromHex")
   140  	ErrPrivKeyFromBytes   = errors.New("ErrFromHex")
   141  	ErrParentHash         = errors.New("ErrParentHash")
   142  	ErrInvalidPassWord    = errors.New("ErrInvalidPassWord")
   143  	//ErrPing p2p模块错误类型
   144  	ErrPing       = errors.New("ErrPingSignature")
   145  	ErrVersion    = errors.New("ErrVersionNoSupport")
   146  	ErrStreamPing = errors.New("ErrStreamPing")
   147  	ErrPeerStop   = errors.New("ErrPeerStop")
   148  	ErrP2PChannel = errors.New("ErrIllegalP2PChannel")
   149  
   150  	ErrBlockSize                  = errors.New("ErrBlockSize")
   151  	ErrTxGroupIndex               = errors.New("ErrTxGroupIndex")
   152  	ErrTxGroupFormat              = errors.New("ErrTxGroupFormat")
   153  	ErrTxGroupCountLessThanTwo    = errors.New("ErrTxGroupCountLessThanTwo")
   154  	ErrTxGroupHeader              = errors.New("ErrTxGroupHeader")
   155  	ErrTxGroupNext                = errors.New("ErrTxGroupNext")
   156  	ErrTxGroupCountBigThanMaxSize = errors.New("ErrTxGroupCountBigThanMaxSize")
   157  	ErrTxGroupEmpty               = errors.New("ErrTxGroupEmpty")
   158  	ErrTxGroupCount               = errors.New("ErrTxGroupCount")
   159  	ErrTxGroupFeeNotZero          = errors.New("ErrTxGroupFeeNotZero")
   160  	ErrNomalTx                    = errors.New("ErrNomalTx")
   161  	ErrUnknowDriver               = errors.New("ErrUnknowDriver")
   162  	ErrUnRegistedDriver           = errors.New("ErrUnRegistedDriver")
   163  	ErrSymbolNameNotAllow         = errors.New("ErrSymbolNameNotAllow")
   164  	ErrTxGroupNotSupport          = errors.New("ErrTxGroupNotSupport")
   165  	ErrNotAllowKey                = errors.New("ErrNotAllowKey")
   166  	ErrNotAllowMemSetKey          = errors.New("ErrNotAllowMemSetKey")
   167  	ErrNotAllowMemSetLocalKey     = errors.New("ErrNotAllowMemSetLocalKey")
   168  	ErrDataBaseDamage             = errors.New("ErrDataBaseDamage")
   169  	ErrIndex                      = errors.New("ErrIndex")
   170  	ErrTxGroupParaCount           = errors.New("ErrTxGroupParaCount")
   171  	ErrTxGroupParaMainMixed       = errors.New("ErrTxGroupParaMainMixed")
   172  
   173  	//ErrInvalidMainnetRPCAddr rpc模块的错误类型
   174  	ErrInvalidMainnetRPCAddr = errors.New("ErrInvalidMainnetRPCAddr")
   175  
   176  	ErrDBFlag      = errors.New("ErrDBFlag")
   177  	ErrLocalPrefix = errors.New("ErrLocalPrefix")
   178  	ErrLocalKeyLen = errors.New("ErrLocalKeyLen")
   179  	//ErrNotSetInTransaction 必须set 在 事务 中
   180  	ErrNotSetInTransaction = errors.New("can not set kvs not in transaction")
   181  	ErrLocalDBTxDupOpen    = errors.New("ErrLocalDBTxDupOpen")
   182  
   183  	ErrCloneForkFrom      = errors.New("ErrCloneForkFrom")
   184  	ErrCloneForkToExist   = errors.New("ErrCloneForkToExist")
   185  	ErrQueryThistIsNotSet = errors.New("ErrQueryThistIsNotSet")
   186  
   187  	ErrHeightLessZero      = errors.New("ErrHeightLessZero")
   188  	ErrHeightOverflow      = errors.New("ErrHeightOverflow")
   189  	ErrRecordBlockSequence = errors.New("ErrRecordBlockSequence")
   190  	ErrExecPanic           = errors.New("ErrExecPanic")
   191  
   192  	ErrDisableWrite = errors.New("ErrDisableWrite")
   193  	ErrDisableRead  = errors.New("ErrDisableRead")
   194  
   195  	ErrConsensusHashErr   = errors.New("ErrConsensusHashErr")
   196  	ErrMaxCountPerTime    = errors.New("ErrMaxCountPerTime")
   197  	ErrInValidFileHeader  = errors.New("ErrInValidFileHeader")
   198  	ErrFileExists         = errors.New("ErrFileExists")
   199  	ErrSubscriberExist    = errors.New("ErrSubscriberExist")
   200  	ErrTooManySubscriber  = errors.New("ErrTooManySubscriber")
   201  	ErrPushNotSupport     = errors.New("ErrPushNotSupport")
   202  	ErrNotAllowModifyPush = errors.New("ErrNotAllowModifyPush")
   203  	ErrTxReceiptReduced   = errors.New("ErrTxReceiptReduced")
   204  	ErrPushNotSubscribed  = errors.New("ErrPushNotSubscribed")
   205  	ErrTxChainID          = errors.New("ErrTxChainID")
   206  	ErrTimeout            = errors.New("ErrTimeout")
   207  )