keeper

package
v0.7.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 16, 2024 License: GPL-3.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RollingSeedSizeInBytes = 32
)
View Source
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 ConvertToOwasmGas(cosmos uint64) uint64

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the bank MsgServer interface for the provided Keeper.

Types

type FeeCollector

type FeeCollector interface {
	Collect(sdk.Context, sdk.Coins) error
	Collected() sdk.Coins
}

type Keeper

type Keeper struct {
	AuthKeeper types.AccountKeeper
	BankKeeper types.BankKeeper
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	key storetypes.StoreKey,
	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

func (k Keeper) Activate(ctx sdk.Context, val sdk.ValAddress) error

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

func (k Keeper) AddExecutableFile(file []byte) string

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

func (k Keeper) AddOracleScriptFile(file []byte) (string, error)

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 types.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 types.RequestID,
	val sdk.ValAddress,
	reportInTime bool,
	rawReports []types.RawReport,
) error

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

func (k Keeper) AddRequest(ctx sdk.Context, req types.Request) types.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

func (k Keeper) AllocateTokens(ctx sdk.Context, previousVotes []abci.VoteInfo)

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

func (k Keeper) BindPort(ctx sdk.Context, portID string) error

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 (k Keeper) CheckValidReport(
	ctx sdk.Context,
	rid types.RequestID,
	val sdk.ValAddress,
	rawReports []types.RawReport,
) error

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 (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 []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

func (k Keeper) DeleteReports(ctx sdk.Context, rid types.RequestID)

DeleteReports removes all reports for the given request ID.

func (Keeper) DeleteRequest

func (k Keeper) DeleteRequest(ctx sdk.Context, id types.RequestID)

DeleteRequest removes the given data request from the store.

func (Keeper) GetAccumulatedDataProvidersRewards

func (k Keeper) GetAccumulatedDataProvidersRewards(ctx sdk.Context) (reward types.DataProvidersAccumulatedRewards)

func (Keeper) GetAccumulatedPaymentsForData

func (k Keeper) GetAccumulatedPaymentsForData(ctx sdk.Context) (payments types.AccumulatedPaymentsForData)

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) GetAuthority added in v0.7.5

func (k Keeper) GetAuthority() string

GetAuthority returns the x/oracle module's authority.

func (Keeper) GetDataProviderAccumulatedReward

func (k Keeper) GetDataProviderAccumulatedReward(ctx sdk.Context, acc sdk.AccAddress) sdk.Coins

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

func (k Keeper) GetDataSourceCount(ctx sdk.Context) uint64

GetDataSourceCount returns the current number of all data sources ever exist.

func (Keeper) GetFile

func (k Keeper) GetFile(name string) []byte

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

func (k Keeper) GetNextRequestID(ctx sdk.Context) types.RequestID

GetNextRequestID increments and returns the current number of requests.

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 types.OracleScriptID) (types.OracleScript, error)

GetOracleScript returns the oracle script struct for the given ID or error if not exists.

func (Keeper) GetOracleScriptCount

func (k Keeper) GetOracleScriptCount(ctx sdk.Context) uint64

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 sdk.Context,
	limit, offset uint64,
) ([]types.OracleScript, *query.PageResponse, error)

GetPaginatedOracleScripts returns oracle scripts with pagination.

func (Keeper) GetPaginatedRequestReports

func (k Keeper) GetPaginatedRequestReports(
	ctx sdk.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 sdk.Context,
	limit, offset uint64, reverse bool,
) ([]types.RequestResult, *query.PageResponse, error)

GetPaginatedRequests returns all requests with pagination

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) (p types.Params)

GetParams returns the current x/oracle module parameters.

func (Keeper) GetPendingResolveList

func (k Keeper) GetPendingResolveList(ctx sdk.Context) (ids []types.RequestID)

GetPendingResolveList returns the list of pending requests to be executed during EndBlock.

func (Keeper) GetPort

func (k Keeper) GetPort(ctx sdk.Context) string

GetPort returns the portID for the oracle module. Used in ExportGenesis

func (Keeper) GetRandomValidators

func (k Keeper) GetRandomValidators(ctx sdk.Context, size int, id uint64) ([]sdk.ValAddress, error)

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

func (k Keeper) GetReportCount(ctx sdk.Context, rid types.RequestID) (count uint64)

GetReportCount returns the number of reports for the given request ID.

func (Keeper) GetReportIterator

func (k Keeper) GetReportIterator(ctx sdk.Context, rid types.RequestID) sdk.Iterator

GetReportIterator returns the iterator for all reports of the given request ID.

func (Keeper) GetReports added in v0.7.5

func (k Keeper) GetReports(ctx sdk.Context, rid types.RequestID) (reports []types.Report)

GetReports returns all reports for the given request ID, or nil if there is none.

func (Keeper) GetRequest

func (k Keeper) GetRequest(ctx sdk.Context, id types.RequestID) (types.Request, error)

GetRequest returns the request struct for the given ID or error if not exists.

func (Keeper) GetRequestCount

func (k Keeper) GetRequestCount(ctx sdk.Context) uint64

GetRequestCount returns the current number of all requests ever exist.

func (Keeper) GetRequestLastExpired

func (k Keeper) GetRequestLastExpired(ctx sdk.Context) types.RequestID

GetRequestLastExpired returns the ID of the last expired request.

func (Keeper) GetResult

func (k Keeper) GetResult(ctx sdk.Context, id types.RequestID) (types.Result, error)

GetResult returns the result for the given request ID or error if not exists.

func (Keeper) GetRollingSeed

func (k Keeper) GetRollingSeed(ctx sdk.Context) []byte

GetRollingSeed returns the current rolling seed value.

func (Keeper) GetSpanSize added in v0.7.2

func (k Keeper) GetSpanSize(ctx sdk.Context) uint64

GetSpanSize return maximum value between MaxReportDataSize and MaxCallDataSize

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 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 (k Keeper) HasDataProviderReward(ctx sdk.Context, acc sdk.AccAddress) bool

func (Keeper) HasDataSource

func (k Keeper) HasDataSource(ctx sdk.Context, id types.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 types.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 types.RequestID, val sdk.ValAddress) bool

HasReport checks if the report of this ID triple exists in the storage.

func (Keeper) HasRequest

func (k Keeper) HasRequest(ctx sdk.Context, id types.RequestID) bool

HasRequest checks if the request of this ID exists in the storage.

func (Keeper) HasResult

func (k Keeper) HasResult(ctx sdk.Context, id types.RequestID) bool

HasResult checks if the result of this request ID exists in the storage.

func (Keeper) IsAllowedFeeDenom added in v0.5.3

func (k Keeper) IsAllowedFeeDenom(ctx sdk.Context, feeDenom string) bool

IsAllowedFeeDenom checks if fee denom exists in data requester fee denoms list

func (Keeper) IsBound

func (k Keeper) IsBound(ctx sdk.Context, portID string) bool

IsBound checks if the oracle module is already bound to the desired port

func (Keeper) IsInDataProviderRewardPerByte added in v0.5.3

func (k Keeper) IsInDataProviderRewardPerByte(ctx sdk.Context, feeDenom string) bool

IsInDataProviderRewardPerByte checks if fee denom exists in data provider reward per byte list

func (Keeper) IsInDataProviderRewardThreshold added in v0.5.3

func (k Keeper) IsInDataProviderRewardThreshold(ctx sdk.Context, feeDenom string) bool

IsInDataProviderRewardThreshold checks if fee denom exists in data provider reward threshold list

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) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

Logger returns a module-specific logger.

func (Keeper) MissReport

func (k Keeper) MissReport(ctx sdk.Context, val sdk.ValAddress, requestTime time.Time)

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

func (k Keeper) MustGetRequest(ctx sdk.Context, id types.RequestID) types.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 types.RequestID) types.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)

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

func (k Keeper) ProcessExpiredRequests(ctx sdk.Context)

ProcessExpiredRequests resolves all expired requests and deactivates missed validators.

func (Keeper) ResolveExpired

func (k Keeper) ResolveExpired(ctx sdk.Context, id types.RequestID)

ResolveExpired resolves the given request as expired.

func (Keeper) ResolveFailure

func (k Keeper) ResolveFailure(ctx sdk.Context, id types.RequestID, reason string)

ResolveFailure resolves the given request as failure with the given reason.

func (Keeper) ResolveRequest

func (k Keeper) ResolveRequest(ctx sdk.Context, reqID types.RequestID)

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)

ResolveSuccess resolves the given request as success with the given result.

func (Keeper) RevokeReporter added in v0.7.5

func (k Keeper) RevokeReporter(ctx sdk.Context, validator sdk.ValAddress, reporter sdk.AccAddress) error

RevokeReporter revokes grant from the reporter for testing

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) SetAccumulatedDataProvidersRewards

func (k Keeper) SetAccumulatedDataProvidersRewards(ctx sdk.Context, reward types.DataProvidersAccumulatedRewards)

func (Keeper) SetAccumulatedPaymentsForData

func (k Keeper) SetAccumulatedPaymentsForData(ctx sdk.Context, payments types.AccumulatedPaymentsForData)

func (Keeper) SetDataProviderAccumulatedReward

func (k Keeper) SetDataProviderAccumulatedReward(ctx sdk.Context, acc sdk.AccAddress, reward sdk.Coins)

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

func (k Keeper) SetDataSourceCount(ctx sdk.Context, count uint64)

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 types.OracleScriptID, oracleScript types.OracleScript)

SetOracleScript saves the given oracle script to the storage without performing validation.

func (Keeper) SetOracleScriptCount

func (k Keeper) SetOracleScriptCount(ctx sdk.Context, count uint64)

SetOracleScriptCount sets the number of oracle script count to the given value.

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, p types.Params) error

SetParams sets the x/oracle module parameters.

func (Keeper) SetPendingResolveList

func (k Keeper) SetPendingResolveList(ctx sdk.Context, ids []types.RequestID)

SetPendingResolveList saves the list of pending request that will be resolved at end block.

func (Keeper) SetPort

func (k Keeper) SetPort(ctx sdk.Context, portID string)

SetPort sets the portID for the oracle module. Used in InitGenesis

func (Keeper) SetReport

func (k Keeper) SetReport(ctx sdk.Context, rid types.RequestID, rep types.Report)

SetDataReport saves the report to the storage without performing validation.

func (Keeper) SetRequest

func (k Keeper) SetRequest(ctx sdk.Context, id types.RequestID, request types.Request)

SetRequest saves the given data request to the store without performing any validation.

func (Keeper) SetRequestCount

func (k Keeper) SetRequestCount(ctx sdk.Context, count uint64)

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 types.RequestID)

SetRequestLastExpired sets the ID of the last expired request.

func (Keeper) SetResult

func (k Keeper) SetResult(ctx sdk.Context, reqID types.RequestID, result types.Result)

SetResult sets result to the store.

func (Keeper) SetRollingSeed

func (k Keeper) SetRollingSeed(ctx sdk.Context, rollingSeed []byte)

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 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 NewMigrator added in v0.7.5

func NewMigrator(k Keeper, ss exported.Subspace) Migrator

func (Migrator) Migrate1to2 added in v0.7.5

func (m Migrator) Migrate1to2(ctx sdk.Context) error

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 sdk.MultiStore, keeper *Keeper) *OracleSnapshotter

func (*OracleSnapshotter) PruneSnapshotHeight added in v0.7.5

func (os *OracleSnapshotter) PruneSnapshotHeight(height int64)

No need to do anything

func (*OracleSnapshotter) RestoreExtension added in v0.7.5

func (os *OracleSnapshotter) RestoreExtension(
	height uint64, format uint32, payloadReader snapshot.ExtensionPayloadReader,
) error

func (*OracleSnapshotter) SetSnapshotInterval added in v0.7.5

func (os *OracleSnapshotter) SetSnapshotInterval(snapshotInterval uint64)

No need to do anything

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

ActiveValidators queries all active oracle validators.

func (Querier) Counts

Counts queries the number of data sources, oracle scripts, and requests.

func (Querier) Data

Data queries the data source or oracle script script for given file hash.

func (Querier) DataProviderAccumulatedReward added in v0.5.4

DataProviderAccumulatedReward queries reward of a given data provider address.

func (Querier) DataProviderReward

DataProviderReward returns current reward per byte for data providers

func (Querier) DataSource

DataSource queries data source info for given data source id.

func (Querier) DataSources

DataSources queries data sources

func (Querier) IsReporter

IsReporter queries grant of account on this validator

func (Querier) OracleScript

OracleScript queries oracle script info for given oracle script id.

func (Querier) OracleScripts

OracleScripts queries all oracle scripts with pagination.

func (Querier) Params

Params queries the oracle parameters.

func (Querier) Reporters

Reporters queries 100 gratees of a given validator address and filter for reporter.

func (Querier) Request

Request queries request info for given request id.

func (Querier) RequestPrice

RequestPrice queries the latest price on standard price reference oracle script.

func (Querier) RequestReports

RequestReports queries all reports by the giver request id with pagination.

func (Querier) RequestSearch

RequestSearch queries the latest request that match the given input.

func (Querier) RequestVerification

RequestVerification verifies oracle request for validation before executing data sources

func (Querier) Requests

Requests queries all requests with pagination.

func (Querier) Validator

Validator queries oracle info of validator for given validator address.

type RewardCollector

type RewardCollector interface {
	Collect(sdk.Context, sdk.Coins, sdk.AccAddress) error
	CalculateReward([]byte, sdk.Coins) sdk.Coins
	Collected() sdk.Coins
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL