github.com/neatlab/neatio@v1.7.3-0.20220425043230-d903e92fcc75/chain/core/error.go (about) 1 // Copyright 2014 The go-ethereum Authors 2 // This file is part of the go-ethereum library. 3 // 4 // The go-ethereum library is free software: you can redistribute it and/or modify 5 // it under the terms of the GNU Lesser General Public License as published by 6 // the Free Software Foundation, either version 3 of the License, or 7 // (at your option) any later version. 8 // 9 // The go-ethereum library is distributed in the hope that it will be useful, 10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 // GNU Lesser General Public License for more details. 13 // 14 // You should have received a copy of the GNU Lesser General Public License 15 // along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. 16 17 package core 18 19 import "errors" 20 21 var ( 22 // ErrKnownBlock is returned when a block to import is already known locally. 23 ErrKnownBlock = errors.New("block already known") 24 25 // ErrGasLimitReached is returned by the gas pool if the amount of gas required 26 // by a transaction is higher than what's left in the block. 27 ErrGasLimitReached = errors.New("gas limit reached") 28 29 // ErrBlacklistedHash is returned if a block to import is on the blacklist. 30 ErrBlacklistedHash = errors.New("blacklisted hash") 31 32 // ErrNonceTooHigh is returned if the nonce of a transaction is higher than the 33 // next one expected based on the local chain. 34 ErrNonceTooHigh = errors.New("nonce too high") 35 36 // ErrInvalidTx4 is returned if the tx4 has been checked during execution 37 ErrInvalidTx4 = errors.New("invalid Tx4") 38 39 // Delegation Error 40 // ErrCancelSelfDelegate is returned if the cancel delegate apply to the self address 41 ErrCancelSelfDelegate = errors.New("can not cancel self delegation") 42 43 // ErrCannotDelegate is returned if the request address does not have deposit balance in Annual/SemiAnnual Supernode 44 ErrCannotDelegate = errors.New("Annual/SemiAnnual Supernode candidate not accept new delegator") 45 46 // ErrCannotUnbond is returned if the request address belongs to Annual/SemiAnnual Supernode 47 ErrCannotUnBond = errors.New("Annual/SemiAnnual Supernode candidate can not unbond") 48 49 // ErrDelegateAmount is returned if the delegate amount less than 0 50 ErrDelegateAmount = errors.New("delegation amount can not be negative") 51 52 // ErrInsufficientProxiedBalance is returned if the cancellation amount of executing a transaction 53 // is higher than the proxied balance of the user's account. 54 ErrInsufficientProxiedBalance = errors.New("cancel amount greater than your Proxied Balance") 55 56 // ErrAlreadyCandidate is returned if the request address has become candidate already 57 ErrAlreadyCandidate = errors.New("address become candidate already") 58 59 // ErrCannotCandidate is returned if the request address belongs to Annual/SemiAnnual Supernode 60 ErrCannotCandidate = errors.New("Annual/SemiAnnual Supernode can not become candidate") 61 62 ErrMaxCandidate = errors.New("candidate number bigger than the maximum number") 63 64 // ErrCannotUnRegister is returned if the request address belongs to Annual/SemiAnnual Supernode 65 ErrCannotUnRegister = errors.New("Annual/SemiAnnual Supernode can not unregister") 66 67 // ErrNotCandidate is returned if the request address is not a candidate 68 ErrNotCandidate = errors.New("address not candidate") 69 70 ErrBannedUnRegister = errors.New("banned candidate can not unregister") 71 72 //ErrExceedDelegationAddressLimit is returned if delegated address number exceed the limit 73 ErrExceedDelegationAddressLimit = errors.New("exceed the delegation address limit") 74 75 // ErrMinimumRegisterAmount is returned if the request security deposit less than the minimum value 76 ErrMinimumRegisterAmount = errors.New("security deposit not meet the minimum value") 77 78 // ErrCommission is returned if the request Commission value not between 0 and 100 79 ErrCommission = errors.New("commission percentage (between 0 and 100) out of range") 80 81 // Vote Error 82 // ErrVoteAmountTooLow is returned if the vote amount less than proxied delegation amount 83 ErrVoteAmountTooLow = errors.New("vote amount too low") 84 85 // ErrVoteAmountTooHight is returned if the vote amount greater than proxied amount + self amount 86 ErrVoteAmountTooHight = errors.New("vote amount too high") 87 88 // ErrNotOwner is returned if the Address not owner 89 ErrNotOwner = errors.New("address not owner") 90 91 // ErrNotAllowedInMainChain is returned if the transaction with main flag = false be sent to main chain 92 ErrNotAllowedInMainChain = errors.New("transaction not allowed in main chain") 93 94 // ErrNotAllowedInSideChain is returned if the transaction with side flag = false be sent to side chain 95 ErrNotAllowedInSideChain = errors.New("transaction not allowed in side chain") 96 )