Documentation ¶
Index ¶
- Constants
- func ContainsEID(rawRequests []types.RawRequest, target types.ExternalID) bool
- func ContainsVal(vals []sdk.ValAddress, target sdk.ValAddress) bool
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func NewQuerier(keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier
- type FeeCollector
- type Keeper
- func (k Keeper) Activate(ctx sdk.Context, val sdk.ValAddress) error
- func (k Keeper) AddDataSource(ctx sdk.Context, dataSource types.DataSource) types.DataSourceID
- func (k Keeper) AddExecutableFile(file []byte) string
- func (k Keeper) AddOracleScript(ctx sdk.Context, oracleScript types.OracleScript) types.OracleScriptID
- func (k Keeper) AddOracleScriptFile(file []byte) (string, error)
- func (k Keeper) AddPendingRequest(ctx sdk.Context, id types.RequestID)
- func (k Keeper) AddReport(ctx sdk.Context, rid types.RequestID, rep types.Report) error
- func (k Keeper) AddRequest(ctx sdk.Context, req types.Request) types.RequestID
- func (k Keeper) AllocateTokens(ctx sdk.Context, previousVotes []abci.VoteInfo)
- func (k Keeper) AuthenticateCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) bool
- func (k Keeper) BaseOwasmGas(ctx sdk.Context) (res uint64)
- func (k Keeper) BindPort(ctx sdk.Context, portID string) error
- func (k Keeper) CheckValidReport(ctx sdk.Context, rid types.RequestID, rep types.Report) error
- func (k Keeper) ClaimCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) error
- func (k Keeper) CollectFee(ctx sdk.Context, payer sdk.AccAddress, feeLimit sdk.Coins, askCount uint64, ...) (sdk.Coins, error)
- func (k Keeper) DeleteReports(ctx sdk.Context, rid types.RequestID)
- func (k Keeper) DeleteRequest(ctx sdk.Context, id types.RequestID)
- func (k Keeper) ExpirationBlockCount(ctx sdk.Context) (res uint64)
- func (k Keeper) GetAllDataSources(ctx sdk.Context) (dataSources []types.DataSource)
- func (k Keeper) GetAllOracleScripts(ctx sdk.Context) (oracleScripts []types.OracleScript)
- func (k Keeper) GetDataSource(ctx sdk.Context, id types.DataSourceID) (types.DataSource, error)
- func (k Keeper) GetDataSourceCount(ctx sdk.Context) uint64
- func (k Keeper) GetFile(name string) []byte
- func (k Keeper) GetNextDataSourceID(ctx sdk.Context) types.DataSourceID
- func (k Keeper) GetNextOracleScriptID(ctx sdk.Context) types.OracleScriptID
- func (k Keeper) GetNextRequestID(ctx sdk.Context) types.RequestID
- func (k Keeper) GetOracleScript(ctx sdk.Context, id types.OracleScriptID) (types.OracleScript, error)
- func (k Keeper) GetOracleScriptCount(ctx sdk.Context) uint64
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetPendingResolveList(ctx sdk.Context) (ids []types.RequestID)
- func (k Keeper) GetPort(ctx sdk.Context) string
- func (k Keeper) GetRandomValidators(ctx sdk.Context, size int, id uint64) ([]sdk.ValAddress, error)
- func (k Keeper) GetReportCount(ctx sdk.Context, rid types.RequestID) (count uint64)
- func (k Keeper) GetReportIterator(ctx sdk.Context, rid types.RequestID) sdk.Iterator
- func (k Keeper) GetReports(ctx sdk.Context, rid types.RequestID) (reports []types.Report)
- func (k Keeper) GetRequest(ctx sdk.Context, id types.RequestID) (types.Request, error)
- func (k Keeper) GetRequestCount(ctx sdk.Context) uint64
- func (k Keeper) GetRequestLastExpired(ctx sdk.Context) types.RequestID
- func (k Keeper) GetResult(ctx sdk.Context, id types.RequestID) (types.Result, error)
- func (k Keeper) GetRollingSeed(ctx sdk.Context) []byte
- func (k Keeper) GetValidatorStatus(ctx sdk.Context, val sdk.ValAddress) types.ValidatorStatus
- func (k Keeper) GrantReporter(ctx sdk.Context, validator sdk.ValAddress, reporter sdk.AccAddress) error
- func (k Keeper) HasDataSource(ctx sdk.Context, id types.DataSourceID) bool
- func (k Keeper) HasOracleScript(ctx sdk.Context, id types.OracleScriptID) bool
- func (k Keeper) HasReport(ctx sdk.Context, rid types.RequestID, val sdk.ValAddress) bool
- func (k Keeper) HasRequest(ctx sdk.Context, id types.RequestID) bool
- func (k Keeper) HasResult(ctx sdk.Context, id types.RequestID) bool
- func (k Keeper) IBCRequestEnabled(ctx sdk.Context) (res bool)
- func (k Keeper) InactivePenaltyDuration(ctx sdk.Context) (res uint64)
- func (k Keeper) IsBound(ctx sdk.Context, portID string) bool
- func (k Keeper) IsReporter(ctx sdk.Context, validator sdk.ValAddress, reporter sdk.AccAddress) bool
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MaxAskCount(ctx sdk.Context) (res uint64)
- func (k Keeper) MaxCalldataSize(ctx sdk.Context) (res uint64)
- func (k Keeper) MaxRawRequestCount(ctx sdk.Context) (res uint64)
- func (k Keeper) MaxReportDataSize(ctx sdk.Context) (res uint64)
- func (k Keeper) MissReport(ctx sdk.Context, val sdk.ValAddress, requestTime time.Time)
- func (k Keeper) MustEditDataSource(ctx sdk.Context, id types.DataSourceID, new types.DataSource)
- func (k Keeper) MustEditOracleScript(ctx sdk.Context, id types.OracleScriptID, new types.OracleScript)
- func (k Keeper) MustGetDataSource(ctx sdk.Context, id types.DataSourceID) types.DataSource
- func (k Keeper) MustGetOracleScript(ctx sdk.Context, id types.OracleScriptID) types.OracleScript
- func (k Keeper) MustGetRequest(ctx sdk.Context, id types.RequestID) types.Request
- func (k Keeper) MustGetResult(ctx sdk.Context, id types.RequestID) types.Result
- func (k Keeper) OnRecvPacket(ctx sdk.Context, packet channeltypes.Packet, ...) (types.RequestID, error)
- func (k Keeper) OracleRewardPercentage(ctx sdk.Context) (res uint64)
- func (k Keeper) PerValidatorRequestGas(ctx sdk.Context) (res uint64)
- func (k Keeper) PrepareRequest(ctx sdk.Context, r types.RequestSpec, feePayer sdk.AccAddress, ...) (types.RequestID, error)
- func (k Keeper) ProcessExpiredRequests(ctx sdk.Context)
- func (k Keeper) ResolveExpired(ctx sdk.Context, id types.RequestID)
- func (k Keeper) ResolveFailure(ctx sdk.Context, id types.RequestID, reason string)
- func (k Keeper) ResolveRequest(ctx sdk.Context, reqID types.RequestID)
- func (k Keeper) ResolveSuccess(ctx sdk.Context, id types.RequestID, result []byte, gasUsed uint32)
- func (k Keeper) RevokeReporter(ctx sdk.Context, validator sdk.ValAddress, reporter sdk.AccAddress) error
- func (k Keeper) SamplingTryCount(ctx sdk.Context) (res uint64)
- func (k Keeper) SaveResult(ctx sdk.Context, id types.RequestID, status types.ResolveStatus, result []byte)
- func (k Keeper) SetDataSource(ctx sdk.Context, id types.DataSourceID, dataSource types.DataSource)
- func (k Keeper) SetDataSourceCount(ctx sdk.Context, count uint64)
- func (k Keeper) SetOracleScript(ctx sdk.Context, id types.OracleScriptID, oracleScript types.OracleScript)
- func (k Keeper) SetOracleScriptCount(ctx sdk.Context, count uint64)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetPendingResolveList(ctx sdk.Context, ids []types.RequestID)
- func (k Keeper) SetPort(ctx sdk.Context, portID string)
- func (k Keeper) SetReport(ctx sdk.Context, rid types.RequestID, rep types.Report)
- func (k Keeper) SetRequest(ctx sdk.Context, id types.RequestID, request types.Request)
- func (k Keeper) SetRequestCount(ctx sdk.Context, count uint64)
- func (k Keeper) SetRequestLastExpired(ctx sdk.Context, id types.RequestID)
- func (k Keeper) SetResult(ctx sdk.Context, reqID types.RequestID, result types.Result)
- func (k Keeper) SetRollingSeed(ctx sdk.Context, rollingSeed []byte)
- func (k Keeper) SetValidatorStatus(ctx sdk.Context, val sdk.ValAddress, status types.ValidatorStatus)
- type Querier
- func (k Querier) ActiveValidators(c context.Context, req *types.QueryActiveValidatorsRequest) (*types.QueryActiveValidatorsResponse, error)
- func (k Querier) Counts(c context.Context, req *types.QueryCountsRequest) (*types.QueryCountsResponse, error)
- func (k Querier) Data(c context.Context, req *types.QueryDataRequest) (*types.QueryDataResponse, error)
- func (k Querier) DataSource(c context.Context, req *types.QueryDataSourceRequest) (*types.QueryDataSourceResponse, error)
- func (k Querier) IsReporter(c context.Context, req *types.QueryIsReporterRequest) (*types.QueryIsReporterResponse, error)
- func (k Querier) OracleScript(c context.Context, req *types.QueryOracleScriptRequest) (*types.QueryOracleScriptResponse, error)
- func (k Querier) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Querier) PendingRequests(c context.Context, req *types.QueryPendingRequestsRequest) (*types.QueryPendingRequestsResponse, error)
- func (k Querier) Reporters(c context.Context, req *types.QueryReportersRequest) (*types.QueryReportersResponse, error)
- func (k Querier) Request(c context.Context, req *types.QueryRequestRequest) (*types.QueryRequestResponse, error)
- func (k Querier) RequestPrice(c context.Context, req *types.QueryRequestPriceRequest) (*types.QueryRequestPriceResponse, error)
- func (k Querier) RequestSearch(c context.Context, req *types.QueryRequestSearchRequest) (*types.QueryRequestSearchResponse, error)
- func (k Querier) RequestVerification(c context.Context, req *types.QueryRequestVerificationRequest) (*types.QueryRequestVerificationResponse, error)
- func (k Querier) Validator(c context.Context, req *types.QueryValidatorRequest) (*types.QueryValidatorResponse, error)
Constants ¶
const (
RollingSeedSizeInBytes = 32
)
Variables ¶
This section is empty.
Functions ¶
func ContainsEID ¶
func ContainsEID(rawRequests []types.RawRequest, target types.ExternalID) bool
ContainsEID returns whether the given slice of raw requests contains the target id.
func ContainsVal ¶
func ContainsVal(vals []sdk.ValAddress, target sdk.ValAddress) bool
ContainsVal returns whether the given slice of validators contains the target validator.
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the bank MsgServer interface for the provided Keeper.
func NewQuerier ¶
func NewQuerier(keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier
NewQuerier is the module level router for state queries.
Types ¶
type FeeCollector ¶
type FeeCollector interface { Collect(sdk.Context, sdk.Coins, sdk.AccAddress) error Collected() sdk.Coins }
FeeCollector define fee collector
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, key sdk.StoreKey, ps paramtypes.Subspace, fileDir string, feeCollectorName string, authKeeper types.AccountKeeper, bankKeeper types.BankKeeper, stakingKeeper types.StakingKeeper, distrKeeper types.DistrKeeper, authzKeeper types.AuthzKeeper, channelKeeper types.ChannelKeeper, portKeeper types.PortKeeper, scopeKeeper capabilitykeeper.ScopedKeeper, owasmVM *owasm.Vm, ) Keeper
NewKeeper creates a new oracle Keeper instance.
func (Keeper) Activate ¶
Activate changes the given validator's status to active. Returns error if the validator is already active or was deactivated recently, as specified by InactivePenaltyDuration parameter.
func (Keeper) AddDataSource ¶
func (k Keeper) AddDataSource(ctx sdk.Context, dataSource types.DataSource) types.DataSourceID
AddDataSource adds the given data source to the storage.
func (Keeper) AddExecutableFile ¶
AddExecutableFile saves the given executable file to a file to filecahe storage and returns its sha256sum reference name. Returns do-not-modify symbol if the input is do-not-modify.
func (Keeper) AddOracleScript ¶
func (k Keeper) AddOracleScript(ctx sdk.Context, oracleScript types.OracleScript) types.OracleScriptID
AddOracleScript adds the given oracle script to the storage.
func (Keeper) AddOracleScriptFile ¶
AddOracleScriptFile compiles Wasm code (see go-owasm), adds the compiled file to filecache, and returns its sha256 reference name. Returns do-not-modify symbol if input is do-not-modify.
func (Keeper) AddPendingRequest ¶
AddPendingRequest adds the request to the pending list. DO NOT add same request more than once.
func (Keeper) AddReport ¶
AddReports performs sanity checks and adds a new batch from one validator to one request to the store. Note that we expect each validator to report to all raw data requests at once.
func (Keeper) AddRequest ¶
AddRequest attempts to create and save a new request.
func (Keeper) AllocateTokens ¶
AllocateTokens allocates a portion of fee collected in the previous blocks to validators that that are actively performing oracle tasks. Note that this reward is also subjected to comm tax.
func (Keeper) AuthenticateCapability ¶
func (k Keeper) AuthenticateCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) bool
AuthenticateCapability wraps the scopedKeeper's AuthenticateCapability function
func (Keeper) BaseOwasmGas ¶
BaseOwasmGas - amount of gas consumed by owasm required as a baseline
func (Keeper) BindPort ¶
BindPort defines a wrapper function for the ort Keeper's function in order to expose it to module's InitGenesis function
func (Keeper) CheckValidReport ¶ added in v2.2.0
func (Keeper) ClaimCapability ¶
func (k Keeper) ClaimCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) error
ClaimCapability allows the oracle module that can claim a capability that IBC module passes to it
func (Keeper) CollectFee ¶
func (k Keeper) CollectFee(ctx sdk.Context, payer sdk.AccAddress, feeLimit sdk.Coins, askCount uint64, rawRequests []types.RawRequest) (sdk.Coins, error)
CollectFee subtract fee from fee payer and send them to treasury
func (Keeper) DeleteReports ¶
DeleteReports removes all reports for the given request ID.
func (Keeper) DeleteRequest ¶
DeleteRequest removes the given data request from the store.
func (Keeper) ExpirationBlockCount ¶
ExpirationBlockCount - number of blocks allowed to fulfill oracle requests If current block height is ahead of the block height of an oracle request for more than this param value, then the request is considered expired
func (Keeper) GetAllDataSources ¶
func (k Keeper) GetAllDataSources(ctx sdk.Context) (dataSources []types.DataSource)
GetAllDataSources returns the list of all data sources in the store, or nil if there is none.
func (Keeper) GetAllOracleScripts ¶
func (k Keeper) GetAllOracleScripts(ctx sdk.Context) (oracleScripts []types.OracleScript)
GetAllOracleScripts returns the list of all oracle scripts in the store, or nil if there is none.
func (Keeper) GetDataSource ¶
func (k Keeper) GetDataSource(ctx sdk.Context, id types.DataSourceID) (types.DataSource, error)
GetDataSource returns the data source struct for the given ID or error if not exists.
func (Keeper) GetDataSourceCount ¶
GetDataSourceCount returns the current number of all data sources ever exist.
func (Keeper) GetFile ¶
GetFile loads the file from the file storage. Panics if the file does not exist.
func (Keeper) GetNextDataSourceID ¶
func (k Keeper) GetNextDataSourceID(ctx sdk.Context) types.DataSourceID
GetNextDataSourceID increments and returns the current number of data sources.
func (Keeper) GetNextOracleScriptID ¶
func (k Keeper) GetNextOracleScriptID(ctx sdk.Context) types.OracleScriptID
GetNextOracleScriptID increments and returns the current number of oracle scripts.
func (Keeper) GetNextRequestID ¶
GetNextRequestID increments and returns the current number of requests.
func (Keeper) GetOracleScript ¶
func (k Keeper) GetOracleScript(ctx sdk.Context, id types.OracleScriptID) (types.OracleScript, error)
GetOracleScript returns the oracle script struct for the given ID or error if not exists.
func (Keeper) GetOracleScriptCount ¶
GetOracleScriptCount returns the current number of all oracle scripts ever exist.
func (Keeper) GetPendingResolveList ¶
GetPendingResolveList returns the list of pending requests to be executed during EndBlock.
func (Keeper) GetRandomValidators ¶
GetRandomValidators returns a pseudorandom subset of active validators. Each validator has chance of getting selected directly proportional to the amount of voting power it has.
func (Keeper) GetReportCount ¶
GetReportCount returns the number of reports for the given request ID.
func (Keeper) GetReportIterator ¶
GetReportIterator returns the iterator for all reports of the given request ID.
func (Keeper) GetReports ¶
GetReports returns all reports for the given request ID, or nil if there is none.
func (Keeper) GetRequest ¶
GetRequest returns the request struct for the given ID or error if not exists.
func (Keeper) GetRequestCount ¶
GetRequestCount returns the current number of all requests ever exist.
func (Keeper) GetRequestLastExpired ¶
GetRequestLastExpired returns the ID of the last expired request.
func (Keeper) GetResult ¶
GetResult returns the result for the given request ID or error if not exists.
func (Keeper) GetRollingSeed ¶
GetRollingSeed returns the current rolling seed value.
func (Keeper) GetValidatorStatus ¶
func (k Keeper) GetValidatorStatus(ctx sdk.Context, val sdk.ValAddress) types.ValidatorStatus
GetValidatorStatus returns the validator status for the given validator. Note that validator status is default to [inactive, 0], so new validators start with inactive state.
func (Keeper) GrantReporter ¶ added in v2.2.0
func (k Keeper) GrantReporter(ctx sdk.Context, validator sdk.ValAddress, reporter sdk.AccAddress) error
GrantReporter grants the reporter to validator for testing
func (Keeper) HasDataSource ¶
HasDataSource checks if the data source of this ID exists in the storage.
func (Keeper) HasOracleScript ¶
HasOracleScript checks if the oracle script of this ID exists in the storage.
func (Keeper) HasRequest ¶
HasRequest checks if the request of this ID exists in the storage.
func (Keeper) IBCRequestEnabled ¶
IBCRequestEnabled - a flag indicating whether sending oracle request via IBC is allowed or not
func (Keeper) InactivePenaltyDuration ¶
InactivePenaltyDuration - time duration that need to wait when the validator marked as inactive oracle provider, before re-activate as oracle provider
func (Keeper) IsReporter ¶
func (k Keeper) IsReporter(ctx sdk.Context, validator sdk.ValAddress, reporter sdk.AccAddress) bool
IsReporter checks if the validator granted to the reporter
func (Keeper) MaxAskCount ¶
MaxAskCount - Maximum number of validators allowed to fulfill the request
func (Keeper) MaxCalldataSize ¶ added in v2.1.1
MaxCalldataSize - Maximum size limit of calldata (bytes) in a request
func (Keeper) MaxRawRequestCount ¶
MaxRawRequestCount - Maximum number of raw request allowed
func (Keeper) MaxReportDataSize ¶ added in v2.1.1
MaxReportDataSize - Maximum size limit of report data (bytes) in a report
func (Keeper) MissReport ¶
MissReport changes the given validator's status to inactive. No-op if already inactive or if the validator was active after the time the request happened.
func (Keeper) MustEditDataSource ¶
func (k Keeper) MustEditDataSource(ctx sdk.Context, id types.DataSourceID, new types.DataSource)
MustEditDataSource edits the given data source by id and flushes it to the storage.
func (Keeper) MustEditOracleScript ¶
func (k Keeper) MustEditOracleScript(ctx sdk.Context, id types.OracleScriptID, new types.OracleScript)
MustEditOracleScript edits the given oracle script by id and flushes it to the storage. Panic if not exists.
func (Keeper) MustGetDataSource ¶
func (k Keeper) MustGetDataSource(ctx sdk.Context, id types.DataSourceID) types.DataSource
MustGetDataSource returns the data source struct for the given ID. Panic if not exists.
func (Keeper) MustGetOracleScript ¶
func (k Keeper) MustGetOracleScript(ctx sdk.Context, id types.OracleScriptID) types.OracleScript
MustGetOracleScript returns the oracle script struct for the given ID. Panic if not exists.
func (Keeper) MustGetRequest ¶
MustGetRequest returns the request struct for the given ID. Panics error if not exists.
func (Keeper) MustGetResult ¶
MustGetResult returns the result for the given request ID. Panics on error.
func (Keeper) OnRecvPacket ¶
func (k Keeper) OnRecvPacket( ctx sdk.Context, packet channeltypes.Packet, data types.OracleRequestPacketData, relayer sdk.AccAddress, ) (types.RequestID, error)
OnRecvPacket processes a cross chain oracle request. Data source fees are collected from the relayer account.
func (Keeper) OracleRewardPercentage ¶
OracleRewardPercentage - reward ratio used when allocating reward for active validators
func (Keeper) PerValidatorRequestGas ¶
PerValidatorRequestGas - amount of gas consumed when preparing request It is the amount per validator where total gas depends on ask count
func (Keeper) PrepareRequest ¶
func (k Keeper) PrepareRequest( ctx sdk.Context, r types.RequestSpec, feePayer sdk.AccAddress, ibcChannel *types.IBCChannel, ) (types.RequestID, error)
PrepareRequest takes an request specification object, performs the prepare call, and saves the request object to store. Also emits events related to the request.
func (Keeper) ProcessExpiredRequests ¶
ProcessExpiredRequests resolves all expired requests and deactivates missed validators.
func (Keeper) ResolveExpired ¶
ResolveExpired resolves the given request as expired.
func (Keeper) ResolveFailure ¶
ResolveFailure resolves the given request as failure with the given reason.
func (Keeper) ResolveRequest ¶
ResolveRequest resolves the given request and saves the result to the store. The function assumes that the given request is in a resolvable state with sufficient reporters.
func (Keeper) ResolveSuccess ¶
ResolveSuccess resolves the given request as success with the given result.
func (Keeper) RevokeReporter ¶ added in v2.2.0
func (k Keeper) RevokeReporter(ctx sdk.Context, validator sdk.ValAddress, reporter sdk.AccAddress) error
RevokeReporter revokes grant from the reporter for testing
func (Keeper) SamplingTryCount ¶
SamplingTryCount - number of tries when sampling validator set
func (Keeper) SaveResult ¶
func (k Keeper) SaveResult( ctx sdk.Context, id types.RequestID, status types.ResolveStatus, result []byte, )
SaveResult saves the result packets for the request with the given resolve status and result.
func (Keeper) SetDataSource ¶
func (k Keeper) SetDataSource(ctx sdk.Context, id types.DataSourceID, dataSource types.DataSource)
SetDataSource saves the given data source to the storage without performing validation.
func (Keeper) SetDataSourceCount ¶
SetDataSourceCount sets the number of data source count to the given value.
func (Keeper) SetOracleScript ¶
func (k Keeper) SetOracleScript(ctx sdk.Context, id types.OracleScriptID, oracleScript types.OracleScript)
SetOracleScript saves the given oracle script to the storage without performing validation.
func (Keeper) SetOracleScriptCount ¶
SetOracleScriptCount sets the number of oracle script count to the given value.
func (Keeper) SetPendingResolveList ¶
SetPendingResolveList saves the list of pending request that will be resolved at end block.
func (Keeper) SetReport ¶
SetDataReport saves the report to the storage without performing validation.
func (Keeper) SetRequest ¶
SetRequest saves the given data request to the store without performing any validation.
func (Keeper) SetRequestCount ¶
SetRequestCount sets the number of request count to the given value. Useful for genesis state.
func (Keeper) SetRequestLastExpired ¶
SetRequestLastExpired sets the ID of the last expired request.
func (Keeper) SetRollingSeed ¶
SetRollingSeed sets the rolling seed value to be provided value.
func (Keeper) SetValidatorStatus ¶
func (k Keeper) SetValidatorStatus(ctx sdk.Context, val sdk.ValAddress, status types.ValidatorStatus)
SetValidatorStatus sets the validator status for the given validator.
type Querier ¶
type Querier struct {
Keeper
}
Querier is used as Keeper will have duplicate methods if used directly, and gRPC names take precedence over keeper
func (Querier) ActiveValidators ¶
func (k Querier) ActiveValidators(c context.Context, req *types.QueryActiveValidatorsRequest) (*types.QueryActiveValidatorsResponse, error)
ActiveValidators queries all active oracle validators.
func (Querier) Counts ¶
func (k Querier) Counts(c context.Context, req *types.QueryCountsRequest) (*types.QueryCountsResponse, error)
Counts queries the number of data sources, oracle scripts, and requests.
func (Querier) Data ¶
func (k Querier) Data(c context.Context, req *types.QueryDataRequest) (*types.QueryDataResponse, error)
Data queries the data source or oracle script script for given file hash.
func (Querier) DataSource ¶
func (k Querier) DataSource(c context.Context, req *types.QueryDataSourceRequest) (*types.QueryDataSourceResponse, error)
DataSource queries data source info for given data source id.
func (Querier) IsReporter ¶ added in v2.2.0
func (k Querier) IsReporter(c context.Context, req *types.QueryIsReporterRequest) (*types.QueryIsReporterResponse, error)
IsReporter queries grant of account on this validator
func (Querier) OracleScript ¶
func (k Querier) OracleScript(c context.Context, req *types.QueryOracleScriptRequest) (*types.QueryOracleScriptResponse, error)
OracleScript queries oracle script info for given oracle script id.
func (Querier) Params ¶
func (k Querier) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Params queries the oracle parameters.
func (Querier) PendingRequests ¶
func (k Querier) PendingRequests(c context.Context, req *types.QueryPendingRequestsRequest) (*types.QueryPendingRequestsResponse, error)
func (Querier) Reporters ¶
func (k Querier) Reporters(c context.Context, req *types.QueryReportersRequest) (*types.QueryReportersResponse, error)
Reporters queries all reporters of a given validator address.
func (Querier) Request ¶
func (k Querier) Request(c context.Context, req *types.QueryRequestRequest) (*types.QueryRequestResponse, error)
Request queries request info for given request id.
func (Querier) RequestPrice ¶
func (k Querier) RequestPrice(c context.Context, req *types.QueryRequestPriceRequest) (*types.QueryRequestPriceResponse, error)
RequestPrice queries the latest price on standard price reference oracle script.
func (Querier) RequestSearch ¶
func (k Querier) RequestSearch(c context.Context, req *types.QueryRequestSearchRequest) (*types.QueryRequestSearchResponse, error)
RequestSearch queries the latest request that match the given input.
func (Querier) RequestVerification ¶
func (k Querier) RequestVerification(c context.Context, req *types.QueryRequestVerificationRequest) (*types.QueryRequestVerificationResponse, error)
RequestVerification verifies oracle request for validation before executing data sources
func (Querier) Validator ¶
func (k Querier) Validator(c context.Context, req *types.QueryValidatorRequest) (*types.QueryValidatorResponse, error)
Validator queries oracle info of validator for given validator address.