Documentation ¶
Index ¶
- Constants
- Variables
- func EmitUpdateOracleAckEvent(ctx sdk.Context, metric *types.Metric, ackStatus string)
- func EmitUpdateOracleEvent(ctx sdk.Context, metric types.Metric)
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- type Keeper
- func (k Keeper) ActiveOracles(c context.Context, req *types.QueryActiveOraclesRequest) (*types.QueryActiveOraclesResponse, error)
- func (k Keeper) AllOracles(c context.Context, req *types.QueryAllOraclesRequest) (*types.QueryAllOraclesResponse, error)
- func (k Keeper) Callbacks() icacallbackstypes.ModuleCallbacks
- func (k Keeper) EndBlocker(ctx sdk.Context)
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) GetAllMetrics(ctx sdk.Context) (metrics []types.Metric)
- func (k Keeper) GetAllOracles(ctx sdk.Context) []types.Oracle
- func (k Keeper) GetAllQueuedMetrics(ctx sdk.Context) (metrics []types.Metric)
- func (k Keeper) GetAuthority() string
- func (k Keeper) GetMetric(ctx sdk.Context, metricId string) (metric types.Metric, found bool)
- func (k Keeper) GetOracle(ctx sdk.Context, chainId string) (oracle types.Oracle, found bool)
- func (k Keeper) GetOracleFromConnectionId(ctx sdk.Context, connectionId string) (oracle types.Oracle, found bool)
- func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState)
- func (k Keeper) InstantiateOracleCallback(ctx sdk.Context, packet channeltypes.Packet, ...) error
- func (k Keeper) IsOracleICAChannelOpen(ctx sdk.Context, oracle types.Oracle) bool
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) Metrics(c context.Context, req *types.QueryMetricsRequest) (*types.QueryMetricsResponse, error)
- func (k Keeper) OnChanOpenAck(ctx sdk.Context, portID, channelID string) error
- func (k Keeper) Oracle(c context.Context, req *types.QueryOracleRequest) (*types.QueryOracleResponse, error)
- func (k Keeper) PostAllQueuedMetrics(ctx sdk.Context)
- func (k Keeper) QueueMetricUpdate(ctx sdk.Context, key, value, metricType, attributes string)
- func (k Keeper) RemoveMetric(ctx sdk.Context, metricId string)
- func (k Keeper) RemoveOracle(ctx sdk.Context, chainId string)
- func (k Keeper) SetMetric(ctx sdk.Context, metric types.Metric)
- func (k Keeper) SetOracle(ctx sdk.Context, oracle types.Oracle)
- func (k Keeper) SubmitICATx(ctx sdk.Context, tx types.ICATx) error
- func (k Keeper) SubmitMetricUpdate(ctx sdk.Context, oracle types.Oracle, metric types.Metric) error
- func (k Keeper) ToggleOracle(ctx sdk.Context, chainId string, active bool) error
- func (k Keeper) UpdateMetricStatus(ctx sdk.Context, metric types.Metric, status types.MetricStatus)
- func (k Keeper) UpdateOracleCallback(ctx sdk.Context, packet channeltypes.Packet, ...) error
Constants ¶
const ( ICACallbackID_InstantiateOracle = "instantiate_oracle" ICACallbackID_UpdateOracle = "update_oracle" )
Variables ¶
var ( InstantiateOracleTimeout = time.Hour * 24 // 1 day MetricUpdateTimeout = time.Hour * 24 // 1 day )
Functions ¶
func EmitUpdateOracleAckEvent ¶
Emits an event for an oracle update
func EmitUpdateOracleEvent ¶
Emits an event for an oracle update
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.
Types ¶
type Keeper ¶
type Keeper struct { ICS4Wrapper types.ICS4Wrapper ClientKeeper types.ClientKeeper ConnectionKeeper types.ConnectionKeeper ChannelKeeper types.ChannelKeeper ICAControllerKeeper icacontrollerkeeper.Keeper ICACallbacksKeeper types.ICACallbacksKeeper // contains filtered or unexported fields }
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, key storetypes.StoreKey, paramstore paramtypes.Subspace, authority string, ics4Wrapper types.ICS4Wrapper, clientKeeper types.ClientKeeper, connectionKeeper types.ConnectionKeeper, channelKeeper types.ChannelKeeper, icaControllerKeeper icacontrollerkeeper.Keeper, icaCallbacksKeeper types.ICACallbacksKeeper, ) *Keeper
func (Keeper) ActiveOracles ¶
func (k Keeper) ActiveOracles(c context.Context, req *types.QueryActiveOraclesRequest) (*types.QueryActiveOraclesResponse, error)
Query all oracles with a filter on whether they are currently active
func (Keeper) AllOracles ¶
func (k Keeper) AllOracles(c context.Context, req *types.QueryAllOraclesRequest) (*types.QueryAllOraclesResponse, error)
Query all oracles with s
func (Keeper) Callbacks ¶
func (k Keeper) Callbacks() icacallbackstypes.ModuleCallbacks
func (Keeper) EndBlocker ¶
EndBlocker of icaoracle module
func (Keeper) ExportGenesis ¶
func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
ExportGenesis returns the capability module's exported genesis.
func (Keeper) GetAllMetrics ¶
Returns all metrics from the store
func (Keeper) GetAllOracles ¶
Returns all oracles
func (Keeper) GetAllQueuedMetrics ¶
Returns all metrics from the index queue
func (Keeper) GetAuthority ¶
GetAuthority returns the x/staking module's authority.
func (Keeper) GetOracleFromConnectionId ¶
func (k Keeper) GetOracleFromConnectionId(ctx sdk.Context, connectionId string) (oracle types.Oracle, found bool)
Grab's an oracle from it's connectionId
func (Keeper) InitGenesis ¶
func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState)
InitGenesis initializes the capability module's state from a provided genesis state.
func (Keeper) InstantiateOracleCallback ¶
func (k Keeper) InstantiateOracleCallback(ctx sdk.Context, packet channeltypes.Packet, ackResponse *icacallbackstypes.AcknowledgementResponse, args []byte) error
Callback after an instantiating an oracle's CW contract
If successful: Stores the cosmwasm contract address on the oracle object If timeout/failure: Does nothing
func (Keeper) IsOracleICAChannelOpen ¶
Checks if the oracle ICA channel is open
func (Keeper) Metrics ¶
func (k Keeper) Metrics(c context.Context, req *types.QueryMetricsRequest) (*types.QueryMetricsResponse, error)
Query metrics with optional filters
func (Keeper) OnChanOpenAck ¶
func (Keeper) Oracle ¶
func (k Keeper) Oracle(c context.Context, req *types.QueryOracleRequest) (*types.QueryOracleResponse, error)
Query a specific oracle
func (Keeper) PostAllQueuedMetrics ¶
For each queued metric, submit an ICA to each oracle, and then flag the metric as IN_PROGRESS
func (Keeper) QueueMetricUpdate ¶
Queues an metric update across each active oracle One metric record is created for each oracle, in status QUEUED
func (Keeper) RemoveMetric ¶
Removes a metric from the store
func (Keeper) RemoveOracle ¶
Removes an oracle from the store
func (Keeper) SetMetric ¶
Stores a metric in the main metric store and then either adds the metric to the queue or removes it from the queue depending on the status of the metric
func (Keeper) SubmitMetricUpdate ¶
Submits an ICA to update the metric in the CW contract
func (Keeper) ToggleOracle ¶
Toggle whether an oracle is active
func (Keeper) UpdateMetricStatus ¶
Updates the status of a metric which will consequently move it either in or out of the queue
func (Keeper) UpdateOracleCallback ¶
func (k Keeper) UpdateOracleCallback(ctx sdk.Context, packet channeltypes.Packet, ackResponse *icacallbackstypes.AcknowledgementResponse, args []byte) error
Callback after an update oracle ICA
If successful/failure: the metric is removed from the pending store If timeout: metric is left in pending store so it can be re-submitted