code.vegaprotocol.io/vega@v0.79.0/core/datasource/errors/errors.go (about)

     1  // Copyright (C) 2023 Gobalsky Labs Limited
     2  //
     3  // This program is free software: you can redistribute it and/or modify
     4  // it under the terms of the GNU Affero General Public License as
     5  // published by the Free Software Foundation, either version 3 of the
     6  // License, or (at your option) any later version.
     7  //
     8  // This program is distributed in the hope that it will be useful,
     9  // but WITHOUT ANY WARRANTY; without even the implied warranty of
    10  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    11  // GNU Affero General Public License for more details.
    12  //
    13  // You should have received a copy of the GNU Affero General Public License
    14  // along with this program.  If not, see <http://www.gnu.org/licenses/>.
    15  
    16  package errors
    17  
    18  import "errors"
    19  
    20  var (
    21  	// ErrMissingPropertyKey is returned when a property key is undefined.
    22  	ErrMissingPropertyKey = errors.New("a property key is required")
    23  	// ErrInvalidTimestamp is returned when the timestamp has a negative value
    24  	// which may happen in case of unsigned integer overflow.
    25  	ErrInvalidTimestamp = errors.New("invalid timestamp")
    26  
    27  	ErrSignerIsEmpty     = errors.New("signer is empty")
    28  	ErrSignerInValidHex  = errors.New("signer is not a valid hex")
    29  	ErrSignerUnknownType = errors.New("unknown type of signer")
    30  
    31  	ErrInternalTimeDataSourceMissingConditions = errors.New("internal time based data source must have at least one condition")
    32  
    33  	// ErrDataSourceSpecHasMultipleSameKeyNamesInFilterList is returned when filters with same key names exists inside a single list.
    34  	ErrDataSourceSpecHasMultipleSameKeyNamesInFilterList = errors.New("multiple keys with same name found in filter list")
    35  
    36  	// ErrDataSourceSpecHasInvalidTimeCondition is returned when timestamp value is used with 'LessThan'
    37  	// or 'LessThanOrEqual' condition operator value.
    38  	ErrDataSourceSpecHasInvalidTimeCondition = errors.New("data source spec time value is used with 'less than' or 'less than equal' condition")
    39  
    40  	// ErrMissingSigners is returned when the datapb.OracleSpec is missing
    41  	// its signers.
    42  	ErrMissingSigners = errors.New("signers are required")
    43  
    44  	// ErrAtLeastOneFilterIsRequired is returned when the datapb.OracleSpec
    45  	// has no expected properties nor filters. At least one of these should be
    46  	// defined.
    47  	ErrAtLeastOneFilterIsRequired = errors.New("at least one filter is required")
    48  
    49  	// ErrMissingPropertyName is returned when a property as no name.
    50  	ErrMissingPropertyName = errors.New("a property name is required")
    51  
    52  	// ErrInvalidPropertyKey is returned if validation finds a reserved Vega property key.
    53  	ErrInvalidPropertyKey = errors.New("property key is reserved")
    54  
    55  	// ErrDuplicatedEthereumCallEvent is returned when there is a duplicated Ethereum event.
    56  	ErrDuplicatedEthereumCallEvent = errors.New("duplicated call event")
    57  
    58  	// ErrEthereumCallEventTooOld is returned when an old Ethereum event is received by the network.
    59  	ErrEthereumCallEventTooOld = errors.New("call event is too old")
    60  
    61  	// ErrDuplicatedEthereumCallEvent is returned when no deterministic time is given to set the next time trigger
    62  	// repetition.
    63  	ErrMissingTimeForSettingTriggerRepetition = errors.New("missing time for setting trigger repetition")
    64  )