Documentation ¶
Index ¶
- Constants
- func ContainsEID(rawRequests []types.RawRequest, target types.ExternalID) bool
- func ContainsVal(vals []sdk.ValAddress, target sdk.ValAddress) bool
- func ConvertToOwasmGas(cosmos uint64) uint64
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- type FeeCollector
- type Keeper
- func (k Keeper) Activate(ctx context.Context, val sdk.ValAddress) error
- func (k Keeper) AddDataSource(ctx sdk.Context, dataSource types.DataSource) (types.DataSourceID, error)
- func (k Keeper) AddExecutableFile(file []byte) string
- func (k Keeper) AddOracleScript(ctx context.Context, oracleScript types.OracleScript) (types.OracleScriptID, error)
- func (k Keeper) AddOracleScriptFile(file []byte) (string, error)
- func (k Keeper) AddPendingRequest(ctx context.Context, id types.RequestID) error
- func (k Keeper) AddReport(ctx context.Context, rid types.RequestID, val sdk.ValAddress, ...) error
- func (k Keeper) AddRequest(ctx context.Context, req types.Request) (types.RequestID, error)
- func (k Keeper) AllocateRewardsToDataProviders(ctx sdk.Context, rid oracletypes.RequestID) error
- func (k Keeper) AllocateTokens(ctx sdk.Context, previousVotes []abci.VoteInfo) error
- func (k Keeper) AuthenticateCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) bool
- func (k Keeper) BindPort(ctx sdk.Context, portID string) error
- func (k Keeper) CheckValidReport(ctx context.Context, rid types.RequestID, val sdk.ValAddress, ...) error
- func (k Keeper) ClaimCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) error
- func (k Keeper) ClearDataProviderAccumulatedReward(ctx sdk.Context, acc sdk.AccAddress) error
- func (k Keeper) CollectFee(ctx sdk.Context, payer sdk.AccAddress, feeLimit sdk.Coins, askCount uint64, ...) (sdk.Coins, error)
- func (k Keeper) CollectReward(ctx sdk.Context, rawReports []oracletypes.RawReport, ...) (sdk.Coins, error)
- func (k Keeper) DeleteReports(ctx context.Context, rid types.RequestID) error
- func (k Keeper) DeleteRequest(ctx context.Context, id types.RequestID) error
- func (k Keeper) GetAccumulatedDataProvidersRewards(ctx context.Context) (reward types.DataProvidersAccumulatedRewards, err error)
- func (k Keeper) GetAccumulatedPaymentsForData(ctx context.Context) (payments types.AccumulatedPaymentsForData, err error)
- func (k Keeper) GetAllDataSources(ctx sdk.Context) (dataSources []types.DataSource, err error)
- func (k Keeper) GetAllOracleScripts(ctx context.Context) (oracleScripts []types.OracleScript, err error)
- func (k Keeper) GetAuthority() string
- func (k Keeper) GetDataProviderAccumulatedReward(ctx sdk.Context, acc sdk.AccAddress) (sdk.Coins, error)
- func (k Keeper) GetDataSource(ctx context.Context, id types.DataSourceID) (types.DataSource, error)
- func (k Keeper) GetDataSourceCount(ctx context.Context) (uint64, error)
- func (k Keeper) GetFile(name string) []byte
- func (k Keeper) GetNextDataSourceID(ctx context.Context) (types.DataSourceID, error)
- func (k Keeper) GetNextOracleScriptID(ctx context.Context) (types.OracleScriptID, error)
- func (k Keeper) GetNextRequestID(ctx context.Context) (types.RequestID, error)
- func (k Keeper) GetOracleScript(ctx context.Context, id types.OracleScriptID) (types.OracleScript, error)
- func (k Keeper) GetOracleScriptCount(ctx context.Context) (uint64, error)
- func (k Keeper) GetPaginatedDataSources(ctx sdk.Context, limit, offset uint64) ([]types.DataSource, *query.PageResponse, error)
- func (k Keeper) GetPaginatedOracleScripts(ctx context.Context, limit, offset uint64) ([]types.OracleScript, *query.PageResponse, error)
- func (k Keeper) GetPaginatedRequestReports(ctx context.Context, rid types.RequestID, limit, offset uint64) ([]types.Report, *query.PageResponse, error)
- func (k Keeper) GetPaginatedRequests(ctx context.Context, limit, offset uint64, reverse bool) ([]types.RequestResult, *query.PageResponse, error)
- func (k Keeper) GetParams(ctx context.Context) (p types.Params, err error)
- func (k Keeper) GetPendingResolveList(ctx context.Context) (ids []types.RequestID, err error)
- func (k Keeper) GetPort() string
- func (k Keeper) GetRandomValidators(ctx sdk.Context, size int, id uint64) ([]sdk.ValAddress, error)
- func (k Keeper) GetReportCount(ctx context.Context, rid types.RequestID) (count uint64, err error)
- func (k Keeper) GetReports(ctx context.Context, rid types.RequestID) (reports []types.Report, err error)
- func (k Keeper) GetRequest(ctx context.Context, id types.RequestID) (types.Request, error)
- func (k Keeper) GetRequestCount(ctx context.Context) (uint64, error)
- func (k Keeper) GetRequestLastExpired(ctx context.Context) (types.RequestID, error)
- func (k Keeper) GetResult(ctx context.Context, id types.RequestID) (types.Result, error)
- func (k Keeper) GetRollingSeed(ctx context.Context) ([]byte, error)
- func (k Keeper) GetSpanSize(ctx context.Context) (uint64, error)
- func (k Keeper) GetValidatorStatus(ctx context.Context, val sdk.ValAddress) (types.ValidatorStatus, error)
- func (k Keeper) GrantReporter(ctx sdk.Context, validator sdk.ValAddress, reporter sdk.AccAddress) error
- func (k Keeper) HasDataProviderReward(ctx sdk.Context, acc sdk.AccAddress) (bool, error)
- func (k Keeper) HasDataSource(ctx sdk.Context, id types.DataSourceID) (bool, error)
- func (k Keeper) HasOracleScript(ctx context.Context, id types.OracleScriptID) (bool, error)
- func (k Keeper) HasReport(ctx context.Context, rid types.RequestID, val sdk.ValAddress) (bool, error)
- func (k Keeper) HasRequest(ctx context.Context, id types.RequestID) (bool, error)
- func (k Keeper) HasResult(ctx context.Context, id types.RequestID) (bool, error)
- func (k Keeper) HasValidatorStatus(ctx context.Context, val sdk.ValAddress) (bool, error)
- 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) IterateReports(ctx context.Context, rid types.RequestID, ...) error
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MissReport(ctx context.Context, val sdk.ValAddress, requestTime time.Time) error
- func (k Keeper) MustEditDataSource(ctx sdk.Context, id types.DataSourceID, new types.DataSource)
- func (k Keeper) MustEditOracleScript(ctx context.Context, id types.OracleScriptID, new types.OracleScript)
- func (k Keeper) MustGetDataSource(ctx sdk.Context, id types.DataSourceID) types.DataSource
- func (k Keeper) MustGetOracleScript(ctx context.Context, id types.OracleScriptID) types.OracleScript
- func (k Keeper) MustGetRequest(ctx context.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) PrepareRequest(ctx sdk.Context, r types.RequestSpec, feePayer sdk.AccAddress, ...) (types.RequestID, error)
- func (k Keeper) ProcessExpiredRequests(ctx context.Context) error
- func (k Keeper) ResolveExpired(ctx context.Context, id types.RequestID) error
- func (k Keeper) ResolveFailure(ctx sdk.Context, id types.RequestID, reason string) error
- func (k Keeper) ResolveRequest(ctx sdk.Context, reqID types.RequestID) error
- func (k Keeper) ResolveSuccess(ctx sdk.Context, id types.RequestID, result []byte, gasUsed uint64) error
- func (k Keeper) RevokeReporter(ctx context.Context, validator sdk.ValAddress, reporter sdk.AccAddress) error
- func (k Keeper) SaveResult(ctx context.Context, id types.RequestID, status types.ResolveStatus, ...) error
- func (k Keeper) SetAccumulatedDataProvidersRewards(ctx context.Context, reward types.DataProvidersAccumulatedRewards) error
- func (k Keeper) SetAccumulatedPaymentsForData(ctx context.Context, payments types.AccumulatedPaymentsForData) error
- func (k Keeper) SetDataProviderAccumulatedReward(ctx sdk.Context, acc sdk.AccAddress, reward sdk.Coins) error
- func (k Keeper) SetDataSource(ctx sdk.Context, id types.DataSourceID, dataSource types.DataSource) error
- func (k Keeper) SetDataSourceCount(ctx context.Context, count uint64) error
- func (k Keeper) SetOracleScript(ctx context.Context, id types.OracleScriptID, oracleScript types.OracleScript) error
- func (k Keeper) SetOracleScriptCount(ctx context.Context, count uint64) error
- func (k Keeper) SetParams(ctx context.Context, p types.Params) error
- func (k Keeper) SetPendingResolveList(ctx context.Context, ids []types.RequestID) error
- func (k Keeper) SetReport(ctx context.Context, rid types.RequestID, rep types.Report) error
- func (k Keeper) SetRequest(ctx context.Context, id types.RequestID, request types.Request) error
- func (k Keeper) SetRequestCount(ctx context.Context, count uint64) error
- func (k Keeper) SetRequestLastExpired(ctx context.Context, id types.RequestID) error
- func (k Keeper) SetResult(ctx context.Context, reqID types.RequestID, result types.Result) error
- func (k Keeper) SetRollingSeed(ctx context.Context, rollingSeed []byte) error
- func (k Keeper) SetValidatorStatus(ctx context.Context, val sdk.ValAddress, status types.ValidatorStatus) error
- type Migrator
- type OracleSnapshotter
- func (os *OracleSnapshotter) RestoreExtension(height uint64, format uint32, payloadReader snapshot.ExtensionPayloadReader) error
- func (os *OracleSnapshotter) SnapshotExtension(height uint64, payloadWriter snapshot.ExtensionPayloadWriter) error
- func (os *OracleSnapshotter) SnapshotFormat() uint32
- func (os *OracleSnapshotter) SnapshotName() string
- func (os *OracleSnapshotter) SupportedFormats() []uint32
- type Querier
- func (k Querier) ActiveValidators(c context.Context, req *types.QueryActiveValidatorsRequest) (*types.QueryActiveValidatorsResponse, error)
- func (k Querier) Counts(ctx context.Context, req *types.QueryCountsRequest) (*types.QueryCountsResponse, error)
- func (k Querier) Data(c context.Context, req *types.QueryDataRequest) (*types.QueryDataResponse, error)
- func (k Querier) DataProviderAccumulatedReward(c context.Context, req *types.QueryDataProviderAccumulatedRewardRequest) (*types.QueryDataProviderAccumulatedRewardResponse, error)
- func (k Querier) DataProviderReward(c context.Context, _ *types.QueryDataProviderRewardRequest) (*types.QueryDataProviderRewardResponse, error)
- func (k Querier) DataSource(c context.Context, req *types.QueryDataSourceRequest) (*types.QueryDataSourceResponse, error)
- func (k Querier) DataSources(c context.Context, req *types.QueryDataSourcesRequest) (*types.QueryDataSourcesResponse, 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) OracleScripts(c context.Context, req *types.QueryOracleScriptsRequest) (*types.QueryOracleScriptsResponse, 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) RequestReports(c context.Context, req *types.QueryRequestReportsRequest) (*types.QueryRequestReportsResponse, 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) Requests(c context.Context, req *types.QueryRequestsRequest) (*types.QueryRequestsResponse, error)
- func (k Querier) Validator(c context.Context, req *types.QueryValidatorRequest) (*types.QueryValidatorResponse, error)
- type RewardCollector
Constants ¶
const SnapshotFormat = 1
SnapshotFormat format 1 is just gzipped byte code for each oracle scripts and data sources.
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 ConvertToOwasmGas ¶ added in v0.7.2
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the bank MsgServer interface for the provided Keeper.
Types ¶
type FeeCollector ¶
type Keeper ¶
type Keeper struct { AuthKeeper types.AccountKeeper BankKeeper types.BankKeeper Schema collections.Schema Params collections.Item[types.Params] DataSources collections.Map[uint64, types.DataSource] OracleScripts collections.Map[uint64, types.OracleScript] Requests collections.Map[uint64, types.Request] PendingResolveList collections.Item[types.PendingResolveList] Reports collections.Map[collections.Pair[uint64, []byte], types.Report] Results collections.Map[uint64, types.Result] ValidatorStatuses collections.Map[[]byte, types.ValidatorStatus] RequestID collections.Sequence DataSourceID collections.Sequence OracleScriptID collections.Sequence RollingSeed collections.Item[[]byte] RequestLastExpired collections.Item[uint64] DataProviderAccumulatedRewards collections.Map[[]byte, types.DataProviderAccumulatedReward] AccumulatedDataProvidersRewards collections.Item[types.DataProvidersAccumulatedRewards] AccumulatedPaymentsForData collections.Item[types.AccumulatedPaymentsForData] // contains filtered or unexported fields }
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeService corestoretypes.KVStoreService, 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, authority string, ) 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, error)
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 context.Context, oracleScript types.OracleScript) (types.OracleScriptID, error)
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 ¶
func (k Keeper) AddReport( ctx context.Context, rid types.RequestID, val sdk.ValAddress, reportInTime bool, rawReports []types.RawReport, ) error
AddReport 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) AllocateRewardsToDataProviders ¶
AllocateRewardsToDataProviders sends rewards from fee pool to data providers, that have given data for the passed 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) 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 v0.7.5
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) ClearDataProviderAccumulatedReward ¶
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) CollectReward ¶
func (k Keeper) CollectReward( ctx sdk.Context, rawReports []oracletypes.RawReport, rawRequests []oracletypes.RawRequest, ) (sdk.Coins, error)
CollectReward subtract reward from fee pool and sends it to the data providers for reporting data
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) GetAccumulatedDataProvidersRewards ¶
func (Keeper) GetAccumulatedPaymentsForData ¶
func (Keeper) GetAllDataSources ¶
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 context.Context) (oracleScripts []types.OracleScript, err error)
GetAllOracleScripts returns the list of all oracle scripts in the store, or nil if there is none.
func (Keeper) GetAuthority ¶ added in v0.7.5
GetAuthority returns the x/oracle module's authority.
func (Keeper) GetDataProviderAccumulatedReward ¶
func (Keeper) GetDataSource ¶
func (k Keeper) GetDataSource(ctx context.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 ¶
GetNextDataSourceID increments and returns the current number of data sources.
func (Keeper) GetNextOracleScriptID ¶
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 context.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) GetPaginatedDataSources ¶
func (k Keeper) GetPaginatedDataSources( ctx sdk.Context, limit, offset uint64, ) ([]types.DataSource, *query.PageResponse, error)
GetPaginatedDataSources returns the list of all data sources in the store with pagination
func (Keeper) GetPaginatedOracleScripts ¶
func (k Keeper) GetPaginatedOracleScripts( ctx context.Context, limit, offset uint64, ) ([]types.OracleScript, *query.PageResponse, error)
GetPaginatedOracleScripts returns oracle scripts with pagination.
func (Keeper) GetPaginatedRequestReports ¶
func (k Keeper) GetPaginatedRequestReports( ctx context.Context, rid types.RequestID, limit, offset uint64, ) ([]types.Report, *query.PageResponse, error)
GetPaginatedRequestReports returns all reports for the given request ID with pagination.
func (Keeper) GetPaginatedRequests ¶
func (k Keeper) GetPaginatedRequests( ctx context.Context, limit, offset uint64, reverse bool, ) ([]types.RequestResult, *query.PageResponse, error)
GetPaginatedRequests returns all requests with pagination
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) GetReports ¶ added in v0.7.5
func (k Keeper) GetReports(ctx context.Context, rid types.RequestID) (reports []types.Report, err error)
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) GetSpanSize ¶ added in v0.7.2
GetSpanSize return maximum value between MaxReportDataSize and MaxCallDataSize
func (Keeper) GetValidatorStatus ¶
func (k Keeper) GetValidatorStatus(ctx context.Context, val sdk.ValAddress) (types.ValidatorStatus, error)
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 v0.7.5
func (k Keeper) GrantReporter(ctx sdk.Context, validator sdk.ValAddress, reporter sdk.AccAddress) error
GrantReporter grants the reporter to validator for testing
func (Keeper) HasDataProviderReward ¶
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) HasReport ¶
func (k Keeper) HasReport(ctx context.Context, rid types.RequestID, val sdk.ValAddress) (bool, error)
HasReport checks if the report of this ID triple exists in the storage.
func (Keeper) HasRequest ¶
HasRequest checks if the request of this ID exists in the storage.
func (Keeper) HasValidatorStatus ¶ added in v0.8.0
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) IterateReports ¶ added in v0.8.0
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 context.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 context.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) 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 ¶
func (k Keeper) ResolveSuccess(ctx sdk.Context, id types.RequestID, result []byte, gasUsed uint64) error
ResolveSuccess resolves the given request as success with the given result.
func (Keeper) RevokeReporter ¶ added in v0.7.5
func (k Keeper) RevokeReporter(ctx context.Context, validator sdk.ValAddress, reporter sdk.AccAddress) error
RevokeReporter revokes grant from the reporter for testing
func (Keeper) SaveResult ¶
func (k Keeper) SaveResult( ctx context.Context, id types.RequestID, status types.ResolveStatus, result []byte, ) error
SaveResult saves the result packets for the request with the given resolve status and result.
func (Keeper) SetAccumulatedDataProvidersRewards ¶
func (Keeper) SetAccumulatedPaymentsForData ¶
func (Keeper) SetDataProviderAccumulatedReward ¶
func (Keeper) SetDataSource ¶
func (k Keeper) SetDataSource(ctx sdk.Context, id types.DataSourceID, dataSource types.DataSource) error
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 context.Context, id types.OracleScriptID, oracleScript types.OracleScript) error
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) 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 context.Context, val sdk.ValAddress, status types.ValidatorStatus) error
SetValidatorStatus sets the validator status for the given validator.
type Migrator ¶ added in v0.7.5
type Migrator struct {
// contains filtered or unexported fields
}
Migrator is a struct for handling in-place state migrations.
func (Migrator) Migrate1to2 ¶ added in v0.7.5
Migrate1to2 migrates the x/oracle module state from the consensus version 1 to version 2. Specifically, it takes the parameters that are currently stored and managed by the x/params modules and stores them directly into the x/oracle module state.
type OracleSnapshotter ¶ added in v0.7.5
type OracleSnapshotter struct {
// contains filtered or unexported fields
}
func NewOracleSnapshotter ¶ added in v0.7.5
func NewOracleSnapshotter(cms storetypes.MultiStore, keeper *Keeper) *OracleSnapshotter
func (*OracleSnapshotter) RestoreExtension ¶ added in v0.7.5
func (os *OracleSnapshotter) RestoreExtension( height uint64, format uint32, payloadReader snapshot.ExtensionPayloadReader, ) error
func (*OracleSnapshotter) SnapshotExtension ¶ added in v0.7.5
func (os *OracleSnapshotter) SnapshotExtension(height uint64, payloadWriter snapshot.ExtensionPayloadWriter) error
func (*OracleSnapshotter) SnapshotFormat ¶ added in v0.7.5
func (os *OracleSnapshotter) SnapshotFormat() uint32
func (*OracleSnapshotter) SnapshotName ¶ added in v0.7.5
func (os *OracleSnapshotter) SnapshotName() string
func (*OracleSnapshotter) SupportedFormats ¶ added in v0.7.5
func (os *OracleSnapshotter) SupportedFormats() []uint32
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(ctx 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) DataProviderAccumulatedReward ¶ added in v0.5.4
func (k Querier) DataProviderAccumulatedReward(c context.Context, req *types.QueryDataProviderAccumulatedRewardRequest) (*types.QueryDataProviderAccumulatedRewardResponse, error)
DataProviderAccumulatedReward queries reward of a given data provider address.
func (Querier) DataProviderReward ¶
func (k Querier) DataProviderReward( c context.Context, _ *types.QueryDataProviderRewardRequest, ) (*types.QueryDataProviderRewardResponse, error)
DataProviderReward returns current reward per byte for data providers
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) DataSources ¶
func (k Querier) DataSources( c context.Context, req *types.QueryDataSourcesRequest, ) (*types.QueryDataSourcesResponse, error)
DataSources queries data sources
func (Querier) IsReporter ¶
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) OracleScripts ¶
func (k Querier) OracleScripts(c context.Context, req *types.QueryOracleScriptsRequest) (*types.QueryOracleScriptsResponse, error)
OracleScripts queries all oracle scripts with pagination.
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 100 gratees of a given validator address and filter for reporter.
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) RequestReports ¶
func (k Querier) RequestReports(c context.Context, req *types.QueryRequestReportsRequest) (*types.QueryRequestReportsResponse, error)
RequestReports queries all reports by the giver request id with pagination.
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) Requests ¶
func (k Querier) Requests(c context.Context, req *types.QueryRequestsRequest) (*types.QueryRequestsResponse, error)
Requests queries all requests with pagination.
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.