github.com/klaytn/klaytn@v1.12.1/kerrors/kerrors.go (about)

     1  // Copyright 2019 The klaytn Authors
     2  // This file is part of the klaytn library.
     3  //
     4  // The klaytn 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 klaytn 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 klaytn library. If not, see <http://www.gnu.org/licenses/>.
    16  
    17  package kerrors
    18  
    19  import "errors"
    20  
    21  // TODO-Klaytn: Use integer for error codes.
    22  // TODO-Klaytn: Integrate all universally accessible errors into kerrors package.
    23  var (
    24  	ErrNotHumanReadableAddress    = errors.New("Human-readable address is not supported now")
    25  	ErrHumanReadableNotSupported  = errors.New("Human-readable address is not supported now")
    26  	ErrInvalidContractAddress     = errors.New("contract deploy transaction can't have a recipient address")
    27  	ErrOutOfGas                   = errors.New("out of gas")
    28  	ErrMaxKeysExceed              = errors.New("the number of keys exceeds the limit")
    29  	ErrMaxKeysExceedInValidation  = errors.New("the number of keys exceeds the limit in the validation check")
    30  	ErrMaxFeeRatioExceeded        = errors.New("fee ratio exceeded the maximum")
    31  	ErrEmptySlice                 = errors.New("slice is empty")
    32  	ErrNotForProgramAccount       = errors.New("this type transaction cannot be sent to contract addresses")
    33  	ErrNotProgramAccount          = errors.New("not a program account (e.g., an account having code and storage)")
    34  	ErrPrecompiledContractAddress = errors.New("the address is reserved for pre-compiled contracts")
    35  	ErrInvalidCodeFormat          = errors.New("smart contract code format is invalid")
    36  
    37  	// Error codes related to account keys.
    38  	ErrAccountAlreadyExists                 = errors.New("account already exists")
    39  	ErrFeeRatioOutOfRange                   = errors.New("fee ratio is out of range [1, 99]")
    40  	ErrAccountKeyFailNotUpdatable           = errors.New("AccountKeyFail is not updatable")
    41  	ErrDifferentAccountKeyType              = errors.New("different account key type")
    42  	ErrAccountKeyNilUninitializable         = errors.New("AccountKeyNil cannot be initialized to an account")
    43  	ErrNotOnCurve                           = errors.New("public key is not on curve")
    44  	ErrZeroKeyWeight                        = errors.New("key weight is zero")
    45  	ErrUnserializableKey                    = errors.New("key is not serializable")
    46  	ErrDuplicatedKey                        = errors.New("duplicated key")
    47  	ErrWeightedSumOverflow                  = errors.New("weighted sum overflow")
    48  	ErrUnsatisfiableThreshold               = errors.New("unsatisfiable threshold. Weighted sum of keys is less than the threshold.")
    49  	ErrZeroLength                           = errors.New("length is zero")
    50  	ErrLengthTooLong                        = errors.New("length too long")
    51  	ErrNestedCompositeType                  = errors.New("nested composite type")
    52  	ErrLegacyTransactionMustBeWithLegacyKey = errors.New("a legacy transaction must be with a legacy account key")
    53  
    54  	ErrDeprecated   = errors.New("deprecated feature")
    55  	ErrNotSupported = errors.New("not supported")
    56  )