Documentation ¶
Index ¶
- func ContainsEID(rawRequests []types.RawRequest, target types.ExternalID) bool
- func ContainsVal(vals []sdk.ValAddress, target sdk.ValAddress) bool
- func ExportGenesis(ctx sdk.Context, k Keeper) *types.GenesisState
- func InitGenesis(ctx sdk.Context, k Keeper, data *types.GenesisState)
- func NewMsgServerImpl(keeper Keeper) oracletypes.MsgServer
- func NewQuerier(keeper Keeper, cdc *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 oracletypes.DataSource) oracletypes.DataSourceID
- func (k Keeper) AddExecutableFile(file []byte) string
- func (k Keeper) AddOracleScript(ctx sdk.Context, oracleScript oracletypes.OracleScript) oracletypes.OracleScriptID
- func (k Keeper) AddOracleScriptFile(file []byte) (string, error)
- func (k Keeper) AddPendingRequest(ctx sdk.Context, id oracletypes.RequestID)
- func (k Keeper) AddReport(ctx sdk.Context, rid oracletypes.RequestID, rep oracletypes.Report) error
- func (k Keeper) AddReporter(ctx sdk.Context, val sdk.ValAddress, addr sdk.AccAddress) error
- func (k Keeper) AddRequest(ctx sdk.Context, req oracletypes.Request) oracletypes.RequestID
- func (k Keeper) AllocateRewardsToDataProviders(ctx sdk.Context, rid oracletypes.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) BindPort(ctx sdk.Context, portID string) error
- func (k Keeper) ClaimCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) error
- func (k Keeper) ClearDataProviderAccumulatedReward(ctx sdk.Context, acc sdk.AccAddress)
- 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 sdk.Context, rid oracletypes.RequestID)
- func (k Keeper) DeleteRequest(ctx sdk.Context, id oracletypes.RequestID)
- func (k Keeper) GetAccumulatedDataProvidersRewards(ctx sdk.Context) (reward oracletypes.DataProvidersAccumulatedRewards)
- func (k Keeper) GetAccumulatedPaymentsForData(ctx sdk.Context) (payments oracletypes.AccumulatedPaymentsForData)
- func (k Keeper) GetAllDataSources(ctx sdk.Context) (dataSources []oracletypes.DataSource)
- func (k Keeper) GetAllOracleScripts(ctx sdk.Context) (oracleScripts []oracletypes.OracleScript)
- func (k Keeper) GetDataProviderAccumulatedReward(ctx sdk.Context, acc sdk.AccAddress) sdk.Coins
- func (k Keeper) GetDataProviderRewardPerByteParam(ctx sdk.Context) (res sdk.Coins)
- func (k Keeper) GetDataProviderRewardThresholdParam(ctx sdk.Context) (res oracletypes.RewardThreshold)
- func (k Keeper) GetDataRequesterFeeDenomsParam(ctx sdk.Context) (res []string)
- func (k Keeper) GetDataSource(ctx sdk.Context, id oracletypes.DataSourceID) (oracletypes.DataSource, error)
- func (k Keeper) GetDataSourceCount(ctx sdk.Context) int64
- func (k Keeper) GetFile(name string) []byte
- func (k Keeper) GetNextDataSourceID(ctx sdk.Context) oracletypes.DataSourceID
- func (k Keeper) GetNextOracleScriptID(ctx sdk.Context) oracletypes.OracleScriptID
- func (k Keeper) GetNextRequestID(ctx sdk.Context) oracletypes.RequestID
- func (k Keeper) GetOracleAccount(ctx sdk.Context) authtypes.ModuleAccountI
- func (k Keeper) GetOracleModuleCoinsAccount(ctx sdk.Context) (account sdk.AccAddress)
- func (k Keeper) GetOraclePool(ctx sdk.Context) (oraclePool oracletypes.OraclePool)
- func (k Keeper) GetOracleScript(ctx sdk.Context, id oracletypes.OracleScriptID) (oracletypes.OracleScript, error)
- func (k Keeper) GetOracleScriptCount(ctx sdk.Context) int64
- func (k Keeper) GetPaginatedDataSources(ctx sdk.Context, limit, offset uint64) ([]oracletypes.DataSource, *query.PageResponse, error)
- func (k Keeper) GetPaginatedOracleScripts(ctx sdk.Context, limit, offset uint64) ([]oracletypes.OracleScript, *query.PageResponse, error)
- func (k Keeper) GetPaginatedRequestReports(ctx sdk.Context, rid oracletypes.RequestID, limit, offset uint64) ([]oracletypes.Report, *query.PageResponse, error)
- func (k Keeper) GetPaginatedRequests(ctx sdk.Context, limit, offset uint64, reverse bool) ([]oracletypes.RequestResult, *query.PageResponse, error)
- func (k Keeper) GetParamUint64(ctx sdk.Context, key []byte) (res uint64)
- func (k Keeper) GetParams(ctx sdk.Context) (params oracletypes.Params)
- func (k Keeper) GetPendingResolveList(ctx sdk.Context) (ids []oracletypes.RequestID)
- func (k Keeper) GetPort(ctx sdk.Context) string
- func (k Keeper) GetRandomValidators(ctx sdk.Context, size int, id int64) ([]sdk.ValAddress, error)
- func (k Keeper) GetReportCount(ctx sdk.Context, rid oracletypes.RequestID) (count uint64)
- func (k Keeper) GetReportIterator(ctx sdk.Context, rid oracletypes.RequestID) sdk.Iterator
- func (k Keeper) GetReporters(ctx sdk.Context, val sdk.ValAddress) (reporters []sdk.AccAddress)
- func (k Keeper) GetRequest(ctx sdk.Context, id oracletypes.RequestID) (oracletypes.Request, error)
- func (k Keeper) GetRequestCount(ctx sdk.Context) int64
- func (k Keeper) GetRequestLastExpired(ctx sdk.Context) oracletypes.RequestID
- func (k Keeper) GetRequestReports(ctx sdk.Context, rid oracletypes.RequestID) (reports []oracletypes.Report)
- func (k Keeper) GetResult(ctx sdk.Context, id oracletypes.RequestID) (oracletypes.Result, error)
- func (k Keeper) GetRewardDecreasingFractionParam(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) GetRollingSeed(ctx sdk.Context) []byte
- func (k Keeper) GetValidatorStatus(ctx sdk.Context, val sdk.ValAddress) types.ValidatorStatus
- func (k Keeper) HasDataProviderReward(ctx sdk.Context, acc sdk.AccAddress) bool
- func (k Keeper) HasDataSource(ctx sdk.Context, id oracletypes.DataSourceID) bool
- func (k Keeper) HasOracleScript(ctx sdk.Context, id oracletypes.OracleScriptID) bool
- func (k Keeper) HasReport(ctx sdk.Context, rid oracletypes.RequestID, val sdk.ValAddress) bool
- func (k Keeper) HasRequest(ctx sdk.Context, id oracletypes.RequestID) bool
- func (k Keeper) HasResult(ctx sdk.Context, id oracletypes.RequestID) bool
- func (k Keeper) IsAllowedFeeDenom(ctx sdk.Context, feeDenom string) bool
- func (k Keeper) IsBound(ctx sdk.Context, portID string) bool
- func (k Keeper) IsInDataProviderRewardPerByte(ctx sdk.Context, feeDenom string) bool
- func (k Keeper) IsInDataProviderRewardThreshold(ctx sdk.Context, feeDenom string) bool
- func (k Keeper) IsReporter(ctx sdk.Context, val sdk.ValAddress, addr sdk.AccAddress) bool
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MissReport(ctx sdk.Context, val sdk.ValAddress, requestTime time.Time)
- func (k Keeper) MustEditDataSource(ctx sdk.Context, id oracletypes.DataSourceID, new oracletypes.DataSource)
- func (k Keeper) MustEditOracleScript(ctx sdk.Context, id oracletypes.OracleScriptID, new oracletypes.OracleScript)
- func (k Keeper) MustGetDataSource(ctx sdk.Context, id oracletypes.DataSourceID) oracletypes.DataSource
- func (k Keeper) MustGetOracleScript(ctx sdk.Context, id oracletypes.OracleScriptID) oracletypes.OracleScript
- func (k Keeper) MustGetRequest(ctx sdk.Context, id oracletypes.RequestID) oracletypes.Request
- func (k Keeper) MustGetResult(ctx sdk.Context, id oracletypes.RequestID) oracletypes.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 sdk.Context)
- func (k Keeper) RemoveReporter(ctx sdk.Context, val sdk.ValAddress, addr sdk.AccAddress) error
- func (k Keeper) ResolveExpired(ctx sdk.Context, id oracletypes.RequestID)
- func (k Keeper) ResolveFailure(ctx sdk.Context, id oracletypes.RequestID, reason string)
- func (k Keeper) ResolveRequest(ctx sdk.Context, reqID types.RequestID)
- func (k Keeper) ResolveSuccess(ctx sdk.Context, id oracletypes.RequestID, result []byte, gasUsed uint32)
- func (k Keeper) SaveResult(ctx sdk.Context, id oracletypes.RequestID, status oracletypes.ResolveStatus, ...)
- func (k Keeper) SetAccumulatedDataProvidersRewards(ctx sdk.Context, reward oracletypes.DataProvidersAccumulatedRewards)
- func (k Keeper) SetAccumulatedPaymentsForData(ctx sdk.Context, payments oracletypes.AccumulatedPaymentsForData)
- func (k Keeper) SetDataProviderAccumulatedReward(ctx sdk.Context, acc sdk.AccAddress, reward sdk.Coins)
- func (k Keeper) SetDataProviderRewardPerByteParam(ctx sdk.Context, value sdk.Coins)
- func (k Keeper) SetDataProviderRewardThresholdParam(ctx sdk.Context, value oracletypes.RewardThreshold)
- func (k Keeper) SetDataRequesterFeeDenomsParam(ctx sdk.Context, value []string)
- func (k Keeper) SetDataSource(ctx sdk.Context, id oracletypes.DataSourceID, ...)
- func (k Keeper) SetDataSourceCount(ctx sdk.Context, count int64)
- func (k Keeper) SetOracleModuleCoinsAccount(ctx sdk.Context, account sdk.AccAddress)
- func (k Keeper) SetOraclePool(ctx sdk.Context, oraclePool oracletypes.OraclePool)
- func (k Keeper) SetOracleScript(ctx sdk.Context, id oracletypes.OracleScriptID, ...)
- func (k Keeper) SetOracleScriptCount(ctx sdk.Context, count int64)
- func (k Keeper) SetParamUint64(ctx sdk.Context, key []byte, value uint64)
- func (k Keeper) SetParams(ctx sdk.Context, value oracletypes.Params)
- func (k Keeper) SetPendingResolveList(ctx sdk.Context, ids []oracletypes.RequestID)
- func (k Keeper) SetPort(ctx sdk.Context, portID string)
- func (k Keeper) SetReport(ctx sdk.Context, rid oracletypes.RequestID, rep oracletypes.Report)
- func (k Keeper) SetRequest(ctx sdk.Context, id oracletypes.RequestID, request oracletypes.Request)
- func (k Keeper) SetRequestCount(ctx sdk.Context, count int64)
- func (k Keeper) SetRequestLastExpired(ctx sdk.Context, id oracletypes.RequestID)
- func (k Keeper) SetResult(ctx sdk.Context, reqID oracletypes.RequestID, result oracletypes.Result)
- func (k Keeper) SetRewardDecreasingFractionParam(ctx sdk.Context, value sdk.Dec)
- 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 *oracletypes.QueryActiveValidatorsRequest) (*oracletypes.QueryActiveValidatorsResponse, error)
- func (k Querier) Counts(c context.Context, req *oracletypes.QueryCountsRequest) (*oracletypes.QueryCountsResponse, error)
- func (k Querier) Data(c context.Context, req *oracletypes.QueryDataRequest) (*oracletypes.QueryDataResponse, error)
- func (k Querier) DataProviderReward(c context.Context, _ *oracletypes.QueryDataProviderRewardRequest) (*oracletypes.QueryDataProviderRewardResponse, error)
- func (k Querier) DataProvidersPool(c context.Context, req *oracletypes.QueryDataProvidersPoolRequest) (*oracletypes.QueryDataProvidersPoolResponse, error)
- func (k Querier) DataSource(c context.Context, req *oracletypes.QueryDataSourceRequest) (*oracletypes.QueryDataSourceResponse, error)
- func (k Querier) DataSources(c context.Context, req *oracletypes.QueryDataSourcesRequest) (*oracletypes.QueryDataSourcesResponse, error)
- func (k Querier) IsReporter(c context.Context, req *oracletypes.QueryIsReporterRequest) (*oracletypes.QueryIsReporterResponse, error)
- func (k Querier) OracleScript(c context.Context, req *oracletypes.QueryOracleScriptRequest) (*oracletypes.QueryOracleScriptResponse, error)
- func (k Querier) OracleScripts(c context.Context, req *oracletypes.QueryOracleScriptsRequest) (*oracletypes.QueryOracleScriptsResponse, error)
- func (k Querier) Params(c context.Context, req *oracletypes.QueryParamsRequest) (*oracletypes.QueryParamsResponse, error)
- func (k Querier) PendingRequests(c context.Context, req *oracletypes.QueryPendingRequestsRequest) (*oracletypes.QueryPendingRequestsResponse, error)
- func (k Querier) Reporters(c context.Context, req *oracletypes.QueryReportersRequest) (*oracletypes.QueryReportersResponse, error)
- func (k Querier) Request(c context.Context, req *oracletypes.QueryRequestRequest) (*oracletypes.QueryRequestResponse, error)
- func (k Querier) RequestPrice(c context.Context, req *oracletypes.QueryRequestPriceRequest) (*oracletypes.QueryRequestPriceResponse, error)
- func (k Querier) RequestReports(c context.Context, req *oracletypes.QueryRequestReportsRequest) (*oracletypes.QueryRequestReportsResponse, error)
- func (k Querier) RequestSearch(c context.Context, req *oracletypes.QueryRequestSearchRequest) (*oracletypes.QueryRequestSearchResponse, error)
- func (k Querier) RequestVerification(c context.Context, req *oracletypes.QueryRequestVerificationRequest) (*oracletypes.QueryRequestVerificationResponse, error)
- func (k Querier) Requests(c context.Context, req *oracletypes.QueryRequestsRequest) (*oracletypes.QueryRequestsResponse, error)
- func (k Querier) Validator(c context.Context, req *oracletypes.QueryValidatorRequest) (*oracletypes.QueryValidatorResponse, error)
- type RewardCollector
Constants ¶
This section is empty.
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 ExportGenesis ¶
func ExportGenesis(ctx sdk.Context, k Keeper) *types.GenesisState
ExportGenesis returns a GenesisState for a given context and keeper.
func InitGenesis ¶
func InitGenesis(ctx sdk.Context, k Keeper, data *types.GenesisState)
InitGenesis performs genesis initialization for the oracle module.
func NewMsgServerImpl ¶
func NewMsgServerImpl(keeper Keeper) oracletypes.MsgServer
NewMsgServerImpl returns an implementation of the oracle MsgServer interface for the provided Keeper.
func NewQuerier ¶
func NewQuerier(keeper Keeper, cdc *codec.LegacyAmino) sdk.Querier
NewQuerier is the module level router for state queries.
Types ¶
type FeeCollector ¶
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 oracletypes.AccountKeeper, bankKeeper oracletypes.BankKeeper, stakingKeeper oracletypes.StakingKeeper, distrKeeper oracletypes.DistrKeeper, channelKeeper oracletypes.ChannelKeeper, portKeeper oracletypes.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 oracletypes.DataSource) oracletypes.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 oracletypes.OracleScript) oracletypes.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 ¶
func (k Keeper) AddPendingRequest(ctx sdk.Context, id oracletypes.RequestID)
AddPendingRequest adds the request to the pending list. DO NOT add same request more than once.
func (Keeper) AddReport ¶
func (k Keeper) AddReport(ctx sdk.Context, rid oracletypes.RequestID, rep oracletypes.Report) 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) AddReporter ¶
func (k Keeper) AddReporter(ctx sdk.Context, val sdk.ValAddress, addr sdk.AccAddress) error
AddReporter adds the reporter address to the list of reporters of the given validator.
func (Keeper) AddRequest ¶
func (k Keeper) AddRequest(ctx sdk.Context, req oracletypes.Request) oracletypes.RequestID
AddRequest attempts to create and save a new request.
func (Keeper) AllocateRewardsToDataProviders ¶
func (k Keeper) AllocateRewardsToDataProviders(ctx sdk.Context, rid oracletypes.RequestID)
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) ClaimCapability ¶
func (k Keeper) ClaimCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) error
ClaimCapability allows the transfer module that can claim a capability that IBC module passes to it
func (Keeper) ClearDataProviderAccumulatedReward ¶
func (k Keeper) ClearDataProviderAccumulatedReward(ctx sdk.Context, acc sdk.AccAddress)
func (Keeper) CollectFee ¶
func (k Keeper) CollectFee( ctx sdk.Context, payer sdk.AccAddress, feeLimit sdk.Coins, askCount uint64, rawRequests []oracletypes.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 ¶
func (k Keeper) DeleteReports(ctx sdk.Context, rid oracletypes.RequestID)
DeleteReports removes all reports for the given request ID.
func (Keeper) DeleteRequest ¶
func (k Keeper) DeleteRequest(ctx sdk.Context, id oracletypes.RequestID)
DeleteRequest removes the given data request from the store.
func (Keeper) GetAccumulatedDataProvidersRewards ¶
func (k Keeper) GetAccumulatedDataProvidersRewards(ctx sdk.Context) (reward oracletypes.DataProvidersAccumulatedRewards)
func (Keeper) GetAccumulatedPaymentsForData ¶
func (k Keeper) GetAccumulatedPaymentsForData(ctx sdk.Context) (payments oracletypes.AccumulatedPaymentsForData)
func (Keeper) GetAllDataSources ¶
func (k Keeper) GetAllDataSources(ctx sdk.Context) (dataSources []oracletypes.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 []oracletypes.OracleScript)
GetAllOracleScripts returns the list of all oracle scripts in the store, or nil if there is none.
func (Keeper) GetDataProviderAccumulatedReward ¶
func (Keeper) GetDataProviderRewardPerByteParam ¶
func (Keeper) GetDataProviderRewardThresholdParam ¶
func (k Keeper) GetDataProviderRewardThresholdParam(ctx sdk.Context) (res oracletypes.RewardThreshold)
func (Keeper) GetDataRequesterFeeDenomsParam ¶
func (Keeper) GetDataSource ¶
func (k Keeper) GetDataSource(ctx sdk.Context, id oracletypes.DataSourceID) (oracletypes.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) oracletypes.DataSourceID
GetNextDataSourceID increments and returns the current number of data sources.
func (Keeper) GetNextOracleScriptID ¶
func (k Keeper) GetNextOracleScriptID(ctx sdk.Context) oracletypes.OracleScriptID
GetNextOracleScriptID increments and returns the current number of oracle scripts.
func (Keeper) GetNextRequestID ¶
func (k Keeper) GetNextRequestID(ctx sdk.Context) oracletypes.RequestID
GetNextRequestID increments and returns the current number of requests.
func (Keeper) GetOracleAccount ¶
func (k Keeper) GetOracleAccount(ctx sdk.Context) authtypes.ModuleAccountI
GetOracleAccount returns the oracle ModuleAccount
func (Keeper) GetOracleModuleCoinsAccount ¶
func (k Keeper) GetOracleModuleCoinsAccount(ctx sdk.Context) (account sdk.AccAddress)
get the module coins account
func (Keeper) GetOraclePool ¶
func (k Keeper) GetOraclePool(ctx sdk.Context) (oraclePool oracletypes.OraclePool)
GetOraclePool gets the oracle pool info
func (Keeper) GetOracleScript ¶
func (k Keeper) GetOracleScript(ctx sdk.Context, id oracletypes.OracleScriptID) (oracletypes.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, ) ([]oracletypes.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 sdk.Context, limit, offset uint64, ) ([]oracletypes.OracleScript, *query.PageResponse, error)
GetPaginatedOracleScripts returns oracle scripts with pagination.
func (Keeper) GetPaginatedRequestReports ¶
func (k Keeper) GetPaginatedRequestReports( ctx sdk.Context, rid oracletypes.RequestID, limit, offset uint64, ) ([]oracletypes.Report, *query.PageResponse, error)
GetPaginatedRequestReports returns all reports for the given request ID with pagination.
func (Keeper) GetPaginatedRequests ¶
func (k Keeper) GetPaginatedRequests( ctx sdk.Context, limit, offset uint64, reverse bool, ) ([]oracletypes.RequestResult, *query.PageResponse, error)
GetPaginatedRequests returns all requests with pagination
func (Keeper) GetParamUint64 ¶
GetParamUint64 returns the parameter as specified by key as an uint64.
func (Keeper) GetParams ¶
func (k Keeper) GetParams(ctx sdk.Context) (params oracletypes.Params)
GetParams returns all current parameters as a oracletypes.Params instance.
func (Keeper) GetPendingResolveList ¶
func (k Keeper) GetPendingResolveList(ctx sdk.Context) (ids []oracletypes.RequestID)
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) GetReporters ¶
func (k Keeper) GetReporters(ctx sdk.Context, val sdk.ValAddress) (reporters []sdk.AccAddress)
GetReporters returns the reporter list of the given validator.
func (Keeper) GetRequest ¶
func (k Keeper) GetRequest(ctx sdk.Context, id oracletypes.RequestID) (oracletypes.Request, error)
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 ¶
func (k Keeper) GetRequestLastExpired(ctx sdk.Context) oracletypes.RequestID
GetRequestLastExpired returns the ID of the last expired request.
func (Keeper) GetRequestReports ¶
func (k Keeper) GetRequestReports(ctx sdk.Context, rid oracletypes.RequestID) (reports []oracletypes.Report)
GetRequestReports returns all reports for the given request ID, or nil if there is none.
func (Keeper) GetResult ¶
func (k Keeper) GetResult(ctx sdk.Context, id oracletypes.RequestID) (oracletypes.Result, error)
GetResult returns the result for the given request ID or error if not exists.
func (Keeper) GetRewardDecreasingFractionParam ¶
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) HasDataProviderReward ¶
func (Keeper) HasDataSource ¶
func (k Keeper) HasDataSource(ctx sdk.Context, id oracletypes.DataSourceID) bool
HasDataSource checks if the data source of this ID exists in the storage.
func (Keeper) HasOracleScript ¶
func (k Keeper) HasOracleScript(ctx sdk.Context, id oracletypes.OracleScriptID) bool
HasOracleScript checks if the oracle script of this ID exists in the storage.
func (Keeper) HasReport ¶
func (k Keeper) HasReport(ctx sdk.Context, rid oracletypes.RequestID, val sdk.ValAddress) bool
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) IsAllowedFeeDenom ¶ added in v0.5.3
IsAllowedFeeDenom checks if fee denom exists in data requester fee denoms list
func (Keeper) IsInDataProviderRewardPerByte ¶ added in v0.5.3
IsInDataProviderRewardPerByte checks if fee denom exists in data provider reward per byte list
func (Keeper) IsInDataProviderRewardThreshold ¶ added in v0.5.3
IsInDataProviderRewardThreshold checks if fee denom exists in data provider reward threshold list
func (Keeper) IsReporter ¶
func (k Keeper) IsReporter(ctx sdk.Context, val sdk.ValAddress, addr sdk.AccAddress) bool
IsReporter returns true iff the address is an authorized reporter for the given validator.
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 oracletypes.DataSourceID, new oracletypes.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 oracletypes.OracleScriptID, new oracletypes.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 oracletypes.DataSourceID) oracletypes.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 oracletypes.OracleScriptID) oracletypes.OracleScript
MustGetOracleScript returns the oracle script struct for the given ID. Panic if not exists.
func (Keeper) MustGetRequest ¶
func (k Keeper) MustGetRequest(ctx sdk.Context, id oracletypes.RequestID) oracletypes.Request
MustGetRequest returns the request struct for the given ID. Panics error if not exists.
func (Keeper) MustGetResult ¶
func (k Keeper) MustGetResult(ctx sdk.Context, id oracletypes.RequestID) oracletypes.Result
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)
func (Keeper) PrepareRequest ¶
func (k Keeper) PrepareRequest( ctx sdk.Context, r types.RequestSpec, feePayer sdk.AccAddress, ibcSource *types.IBCSource, ) (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) RemoveReporter ¶
func (k Keeper) RemoveReporter(ctx sdk.Context, val sdk.ValAddress, addr sdk.AccAddress) error
RemoveReporter removes the reporter address from the list of reporters of the given validator.
func (Keeper) ResolveExpired ¶
func (k Keeper) ResolveExpired(ctx sdk.Context, id oracletypes.RequestID)
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 oracletypes.RequestID, result []byte, gasUsed uint32)
ResolveSuccess resolves the given request as success with the given result.
func (Keeper) SaveResult ¶
func (k Keeper) SaveResult( ctx sdk.Context, id oracletypes.RequestID, status oracletypes.ResolveStatus, result []byte, )
SaveResult saves the result packets for the request with the given resolve status and result.
func (Keeper) SetAccumulatedDataProvidersRewards ¶
func (k Keeper) SetAccumulatedDataProvidersRewards(ctx sdk.Context, reward oracletypes.DataProvidersAccumulatedRewards)
func (Keeper) SetAccumulatedPaymentsForData ¶
func (k Keeper) SetAccumulatedPaymentsForData(ctx sdk.Context, payments oracletypes.AccumulatedPaymentsForData)
func (Keeper) SetDataProviderAccumulatedReward ¶
func (Keeper) SetDataProviderRewardPerByteParam ¶
func (Keeper) SetDataProviderRewardThresholdParam ¶
func (k Keeper) SetDataProviderRewardThresholdParam(ctx sdk.Context, value oracletypes.RewardThreshold)
func (Keeper) SetDataRequesterFeeDenomsParam ¶
func (Keeper) SetDataSource ¶
func (k Keeper) SetDataSource(ctx sdk.Context, id oracletypes.DataSourceID, dataSource oracletypes.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) SetOracleModuleCoinsAccount ¶
func (k Keeper) SetOracleModuleCoinsAccount(ctx sdk.Context, account sdk.AccAddress)
set the module coins account
func (Keeper) SetOraclePool ¶
func (k Keeper) SetOraclePool(ctx sdk.Context, oraclePool oracletypes.OraclePool)
SetOraclePool sets the oracle pool info
func (Keeper) SetOracleScript ¶
func (k Keeper) SetOracleScript(ctx sdk.Context, id oracletypes.OracleScriptID, oracleScript oracletypes.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) SetParamUint64 ¶
func (Keeper) SetParams ¶
func (k Keeper) SetParams(ctx sdk.Context, value oracletypes.Params)
SetParams saves the given key-value parameter to the store.
func (Keeper) SetPendingResolveList ¶
func (k Keeper) SetPendingResolveList(ctx sdk.Context, ids []oracletypes.RequestID)
SetPendingResolveList saves the list of pending request that will be resolved at end block.
func (Keeper) SetReport ¶
func (k Keeper) SetReport(ctx sdk.Context, rid oracletypes.RequestID, rep oracletypes.Report)
SetReport saves the report to the storage without performing validation.
func (Keeper) SetRequest ¶
func (k Keeper) SetRequest(ctx sdk.Context, id oracletypes.RequestID, request oracletypes.Request)
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 ¶
func (k Keeper) SetRequestLastExpired(ctx sdk.Context, id oracletypes.RequestID)
SetRequestLastExpired sets the ID of the last expired request.
func (Keeper) SetResult ¶
func (k Keeper) SetResult(ctx sdk.Context, reqID oracletypes.RequestID, result oracletypes.Result)
SetResult sets result to the store.
func (Keeper) SetRewardDecreasingFractionParam ¶
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 *oracletypes.QueryActiveValidatorsRequest) (*oracletypes.QueryActiveValidatorsResponse, error)
ActiveValidators queries all active oracle validators.
func (Querier) Counts ¶
func (k Querier) Counts(c context.Context, req *oracletypes.QueryCountsRequest) (*oracletypes.QueryCountsResponse, error)
Counts queries the number of data sources, oracle scripts, and requests.
func (Querier) Data ¶
func (k Querier) Data(c context.Context, req *oracletypes.QueryDataRequest) (*oracletypes.QueryDataResponse, error)
Data queries the data source or oracle script script for given file hash.
func (Querier) DataProviderReward ¶
func (k Querier) DataProviderReward( c context.Context, _ *oracletypes.QueryDataProviderRewardRequest, ) (*oracletypes.QueryDataProviderRewardResponse, error)
DataProviderReward returns current reward per byte for data providers
func (Querier) DataProvidersPool ¶
func (k Querier) DataProvidersPool(c context.Context, req *oracletypes.QueryDataProvidersPoolRequest) (*oracletypes.QueryDataProvidersPoolResponse, error)
func (Querier) DataSource ¶
func (k Querier) DataSource(c context.Context, req *oracletypes.QueryDataSourceRequest) (*oracletypes.QueryDataSourceResponse, error)
DataSource queries data source info for given data source id.
func (Querier) DataSources ¶
func (k Querier) DataSources(c context.Context, req *oracletypes.QueryDataSourcesRequest) (*oracletypes.QueryDataSourcesResponse, error)
DataSources queries data sources
func (Querier) IsReporter ¶
func (k Querier) IsReporter(c context.Context, req *oracletypes.QueryIsReporterRequest) (*oracletypes.QueryIsReporterResponse, error)
IsReporter queries grant of account on this validator
func (Querier) OracleScript ¶
func (k Querier) OracleScript(c context.Context, req *oracletypes.QueryOracleScriptRequest) (*oracletypes.QueryOracleScriptResponse, error)
OracleScript queries oracle script info for given oracle script id.
func (Querier) OracleScripts ¶
func (k Querier) OracleScripts(c context.Context, req *oracletypes.QueryOracleScriptsRequest) (*oracletypes.QueryOracleScriptsResponse, error)
OracleScripts queries all oracle scripts with pagination.
func (Querier) Params ¶
func (k Querier) Params(c context.Context, req *oracletypes.QueryParamsRequest) (*oracletypes.QueryParamsResponse, error)
Params queries the oracle parameters.
func (Querier) PendingRequests ¶
func (k Querier) PendingRequests(c context.Context, req *oracletypes.QueryPendingRequestsRequest) (*oracletypes.QueryPendingRequestsResponse, error)
func (Querier) Reporters ¶
func (k Querier) Reporters(c context.Context, req *oracletypes.QueryReportersRequest) (*oracletypes.QueryReportersResponse, error)
Reporters queries all reporters of a given validator address.
func (Querier) Request ¶
func (k Querier) Request(c context.Context, req *oracletypes.QueryRequestRequest) (*oracletypes.QueryRequestResponse, error)
Request queries request info for given request id.
func (Querier) RequestPrice ¶
func (k Querier) RequestPrice(c context.Context, req *oracletypes.QueryRequestPriceRequest) (*oracletypes.QueryRequestPriceResponse, error)
TODO: RequestPrice queries the latest price on standard price reference oracle script.
func (Querier) RequestReports ¶
func (k Querier) RequestReports(c context.Context, req *oracletypes.QueryRequestReportsRequest) (*oracletypes.QueryRequestReportsResponse, error)
RequestReports queries all reports by the giver request id with pagination.
func (Querier) RequestSearch ¶
func (k Querier) RequestSearch(c context.Context, req *oracletypes.QueryRequestSearchRequest) (*oracletypes.QueryRequestSearchResponse, error)
TODO: drop or change RequestSearch queries the latest request that matches the given input.
func (Querier) RequestVerification ¶
func (k Querier) RequestVerification( c context.Context, req *oracletypes.QueryRequestVerificationRequest, ) (*oracletypes.QueryRequestVerificationResponse, error)
RequestVerification verifies oracle request for validation before executing data sources
func (Querier) Requests ¶
func (k Querier) Requests(c context.Context, req *oracletypes.QueryRequestsRequest) (*oracletypes.QueryRequestsResponse, error)
Requests queries all requests with pagination.
func (Querier) Validator ¶
func (k Querier) Validator(c context.Context, req *oracletypes.QueryValidatorRequest) (*oracletypes.QueryValidatorResponse, error)
Validator queries oracle info of validator for given validator address.
Source Files ¶
- alias_functions.go
- collector.go
- data_providers_pool.go
- data_source.go
- fee_collector.go
- genesis.go
- grpc_query.go
- keeper.go
- modify.go
- msg_server.go
- oracle_script.go
- owasm.go
- querier.go
- relay.go
- report.go
- reporter.go
- request.go
- result.go
- reward.go
- reward_collector.go
- store.go
- validation.go
- validator_status.go