keeper

package
v0.0.0-...-baf6593 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper types.BridgeKeeper) types.MsgServer

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

Types

type Keeper

type Keeper struct {
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey storetypes.StoreKey,
	bridgeEventManager *bridgeserver.BridgeEventManager,
	bankKeeper types.BankKeeper,
	delayMsgKeeper delaymsgtypes.DelayMsgKeeper,
	authorities []string,
) *Keeper

func (Keeper) AcknowledgeBridges

func (k Keeper) AcknowledgeBridges(
	ctx sdk.Context,
	bridgeEvents []types.BridgeEvent,
) (err error)

AcknowledgeBridges acknowledges a list of bridge events and returns an error if any of following - bridging is disabled. - fails to delay a `MsgCompleteBridge` for any bridge event. - fails to update `AcknowledgedEventInfo` in state.

func (Keeper) AcknowledgedEventInfo

AcknowledgedEventInfo processes a query request/response for `AcknowledgedEventInfo` from state.

func (Keeper) CompleteBridge

func (k Keeper) CompleteBridge(
	ctx sdk.Context,
	bridge types.BridgeEvent,
) (err error)

`CompleteBridge` processes a bridge event by transferring the specified coin from bridge module account to the given address. The id of the bridge is not validated as it should have already been validated by AcknowledgeBridges.

func (Keeper) EventParams

EventParams processes a query request/response for the EventParams from state.

func (Keeper) GetAcknowledgeBridges

func (k Keeper) GetAcknowledgeBridges(
	ctx sdk.Context,
	blockTimestamp time.Time,
) (msg *types.MsgAcknowledgeBridges)

GetAcknowledgeBridges returns a `MsgAcknowledgeBridges` for recognized but not-yet-acknowledged bridge events, up to a maximum number of `ProposeParams.MaxBridgesPerBlock`.

func (Keeper) GetAcknowledgedEventInfo

func (k Keeper) GetAcknowledgedEventInfo(
	ctx sdk.Context,
) (acknowledgedEventInfo types.BridgeEventInfo)

GetAcknowledgedEventInfo returns `AcknowledgedEventInfo` from state.

func (Keeper) GetBridgeEventFromServer

func (k Keeper) GetBridgeEventFromServer(ctx sdk.Context, id uint32) (event types.BridgeEvent, found bool)

`GetBridgeEventFromServer` returns the bridge event with the given id from the server. `found` is false if the event is not found.

func (Keeper) GetDelayedCompleteBridgeMessages

func (k Keeper) GetDelayedCompleteBridgeMessages(
	ctx sdk.Context,
	address string,
) (
	messages []types.DelayedCompleteBridgeMessage,
)

`GetDelayedCompleteBridgeMessages` returns all delayed complete bridge messages and corresponding block heights at which they'll execute. If `address` is given, only returns messages for that address.

func (Keeper) GetEventParams

func (k Keeper) GetEventParams(
	ctx sdk.Context,
) (
	params types.EventParams,
)

GetEventParams returns the EventParams in state.

func (Keeper) GetProposeParams

func (k Keeper) GetProposeParams(
	ctx sdk.Context,
) (
	params types.ProposeParams,
)

GetProposeParams returns the ProposeParams in state.

func (Keeper) GetRecognizedEventInfo

func (k Keeper) GetRecognizedEventInfo(
	ctx sdk.Context,
) (recognizedEventInfo types.BridgeEventInfo)

GetRecognizedEventInfo returns `RecognizedEventInfo` from `BridgeEventManager`. This has the next event id that has not yet been recognized by this node’s daemon. This also has the height of the highest Ethereum block at which a bridge event was recognized. These values are not in-consensus.

func (Keeper) GetSafetyParams

func (k Keeper) GetSafetyParams(
	ctx sdk.Context,
) (
	params types.SafetyParams,
)

GetSafetyParams returns the SafetyParams in state.

func (Keeper) HasAuthority

func (k Keeper) HasAuthority(authority string) bool

HasAuthority returns whether `authority` exists in `k.authorities`.

func (Keeper) InitializeForGenesis

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

func (Keeper) Logger

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

func (Keeper) ProposeParams

ProposeParams processes a query request/response for the ProposeParams from state.

func (Keeper) RecognizedEventInfo

RecognizedEventInfo processes a query request/response for the following that has a greater `NextId`: - the `AcknowledgedEventInfo` from state - the `RecognizedEventInfo` from memory Since RecognizedEventInfo is from memory, the value is not deterministic based on state and therefore may be different between nodes.

func (Keeper) SafetyParams

SafetyParams processes a query request/response for the SafetyParams from state.

func (Keeper) SetAcknowledgedEventInfo

func (k Keeper) SetAcknowledgedEventInfo(
	ctx sdk.Context,
	acknowledgedEventInfo types.BridgeEventInfo,
) error

SetAcknowledgedEventInfo sets `AcknowledgedEventInfo` in state.

func (Keeper) UpdateEventParams

func (k Keeper) UpdateEventParams(
	ctx sdk.Context,
	params types.EventParams,
) error

UpdateEventParams updates the EventParams in state. Returns an error iff validation fails.

func (Keeper) UpdateProposeParams

func (k Keeper) UpdateProposeParams(
	ctx sdk.Context,
	params types.ProposeParams,
) error

UpdateProposeParams updates the ProposeParams in state. Returns an error iff validation fails.

func (Keeper) UpdateSafetyParams

func (k Keeper) UpdateSafetyParams(
	ctx sdk.Context,
	params types.SafetyParams,
) error

UpdateSafetyParams updates the SafetyParams in state. Returns an error iff validation fails.

Jump to

Keyboard shortcuts

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