keeper

package
v3.0.0-rc0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

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

func NewQueryServer

func NewQueryServer(k Keeper) types.QueryServer

Types

type Keeper

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

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey storetypes.StoreKey,
	authKeeper types.AccountKeeper,
	bankKeeper types.BankKeeper,
	distrKeeper types.DistrKeeper,
	tssKeeper types.TSSKeeper,
	authority string,
	feeCollectorName string,
) Keeper

func (Keeper) ActivateMember

func (k Keeper) ActivateMember(ctx sdk.Context, address sdk.AccAddress, groupID tss.GroupID) error

ActivateMember activates the member. This function returns an error if the given member is too soon to activate or the member is not in the given group.

func (Keeper) AddMember

func (k Keeper) AddMember(ctx sdk.Context, address sdk.AccAddress, groupID tss.GroupID) error

AddMember adds a new member to the group and return error if already exists

func (Keeper) AddMembers

func (k Keeper) AddMembers(ctx sdk.Context, groupID tss.GroupID) error

AddMembers adds all members of the group.

func (Keeper) AddSigning

func (k Keeper) AddSigning(
	ctx sdk.Context,
	feePerSigner sdk.Coins,
	sender sdk.AccAddress,
	currentGroupSigningID tss.SigningID,
	incomingGroupSigningID tss.SigningID,
) types.SigningID

AddSigning adds the signing data to the store and returns the new Signing ID.

func (Keeper) AllocateTokens

func (k Keeper) AllocateTokens(ctx sdk.Context) error

AllocateTokens allocates a portion of fee collected in the previous blocks to members in the current group. Note that this reward is also subjected to comm tax and this reward is calculate after allocation in oracle module.

func (Keeper) CreateDirectSigningRequest

func (k Keeper) CreateDirectSigningRequest(
	ctx sdk.Context,
	content tsstypes.Content,
	memo string,
	sender sdk.AccAddress,
	feeLimit sdk.Coins,
) (types.SigningID, error)

CreateDirectSigningRequest creates a new signing process and returns the result.

func (Keeper) CreateTransitionSigning

func (k Keeper) CreateTransitionSigning(
	ctx sdk.Context,
	groupPubKey tss.Point,
	transitionTime time.Time,
) (tss.SigningID, error)

CreateTransitionSigning creates a signing request for the group transition.

func (Keeper) CreateTunnelSigningRequest

func (k Keeper) CreateTunnelSigningRequest(
	ctx sdk.Context,
	tunnelID uint64,
	destinationChainID string,
	destinationContractAddr string,
	content tsstypes.Content,
	sender sdk.AccAddress,
	feeLimit sdk.Coins,
) (types.SigningID, error)

func (Keeper) DeactivateMember

func (k Keeper) DeactivateMember(ctx sdk.Context, address sdk.AccAddress, groupID tss.GroupID) error

DeactivateMember flags is_active to false. This function will return error if the given address isn't the member of the given group.

func (Keeper) DeleteGroupTransition

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

DeleteGroupTransition removes the group transition information from the store.

func (Keeper) DeleteMember

func (k Keeper) DeleteMember(ctx sdk.Context, address sdk.AccAddress, groupID tss.GroupID)

DeleteMember removes the status of the address of the group

func (Keeper) DeleteMembers

func (k Keeper) DeleteMembers(ctx sdk.Context, groupID tss.GroupID)

DeleteMembers removes all members of the group.

func (Keeper) DeleteSigningIDMapping

func (k Keeper) DeleteSigningIDMapping(ctx sdk.Context, signingID tss.SigningID)

DeleteSigningIDMapping removes the mapping between tss signingID and bandtss signing id of the given key

func (Keeper) EndGroupTransitionProcess

func (k Keeper) EndGroupTransitionProcess(ctx sdk.Context, transition types.GroupTransition, isSuccess bool)

EndGroupTransitionProcess ends the group transition process by removing the transition and emit an event.

func (Keeper) ExecuteGroupTransition

func (k Keeper) ExecuteGroupTransition(ctx sdk.Context, transition types.GroupTransition)

ExecuteGroupTransition executes the group transition by updating the current group ID and removing the members in the previous group if the status is waiting execution, or ends the process otherwise.

func (Keeper) ExportGenesis

func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState

ExportGenesis returns a GenesisState for a given context and keeper.

func (Keeper) ExtractEventAttributesFromTransition

func (k Keeper) ExtractEventAttributesFromTransition(transition types.GroupTransition) []sdk.Attribute

ExtractEventAttributesFromTransition returns the attributes for the group transition event.

func (Keeper) GetAuthority

func (k Keeper) GetAuthority() string

GetAuthority returns the x/bandtss module's authority.

func (Keeper) GetBandtssAccount

func (k Keeper) GetBandtssAccount(ctx sdk.Context) sdk.ModuleAccountI

GetBandtssAccount returns the bandtss ModuleAccount

func (Keeper) GetCurrentGroup

func (k Keeper) GetCurrentGroup(ctx sdk.Context) types.CurrentGroup

GetCurrentGroup retrieves a current group information of the bandtss module.

func (Keeper) GetGroupTransition

func (k Keeper) GetGroupTransition(ctx sdk.Context) (groupTransition types.GroupTransition, found bool)

GetGroupTransition retrieves a group transition information in the store.

func (Keeper) GetIncomingGroupID

func (k Keeper) GetIncomingGroupID(ctx sdk.Context) tss.GroupID

GetIncomingGroupID returns the incoming group ID from transition state. If the status is not WaitingExecution, it returns 0.

func (Keeper) GetMember

func (k Keeper) GetMember(ctx sdk.Context, address sdk.AccAddress, groupID tss.GroupID) (types.Member, error)

GetMember retrieves a member by address.

func (Keeper) GetMembers

func (k Keeper) GetMembers(ctx sdk.Context) []types.Member

GetMembers retrieves all statuses of the store.

func (Keeper) GetMembersIterator

func (k Keeper) GetMembersIterator(ctx sdk.Context) dbm.Iterator

GetMembersIterator gets an iterator all statuses of address.

func (Keeper) GetModuleBalance

func (k Keeper) GetModuleBalance(ctx sdk.Context) sdk.Coins

GetModuleBalance returns the balance of the bandtss ModuleAccount

func (Keeper) GetParams

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

GetParams returns the current x/bandtss module parameters.

func (Keeper) GetSigning

func (k Keeper) GetSigning(ctx sdk.Context, id types.SigningID) (types.Signing, error)

GetSigning retrieves a bandtss signing info.

func (Keeper) GetSigningCount

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

GetSigningCount returns the current number of all bandtss signing ever existed.

func (Keeper) GetSigningFee

func (k Keeper) GetSigningFee(ctx sdk.Context) (sdk.Coins, error)

GetSigningFee returns the fee required for signing a message.

func (Keeper) GetSigningIDMapping

func (k Keeper) GetSigningIDMapping(ctx sdk.Context, signingID tss.SigningID) types.SigningID

GetSigningIDMapping gets a signing id from the given tss signingID

func (Keeper) HasMember

func (k Keeper) HasMember(ctx sdk.Context, address sdk.AccAddress, groupID tss.GroupID) bool

HasMember checks that address is in the store or not.

func (Keeper) InitGenesis

func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState)

InitGenesis performs genesis initialization for this module.

func (Keeper) Logger

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

Logger gets logger object.

func (Keeper) MustGetSigning

func (k Keeper) MustGetSigning(ctx sdk.Context, id types.SigningID) types.Signing

MustGetSigning retrieves a bandtss signing. Panics error if not exists.

func (Keeper) SetCurrentGroup

func (k Keeper) SetCurrentGroup(ctx sdk.Context, currentGroup types.CurrentGroup)

SetCurrentGroup sets a current group information of the bandtss module.

func (Keeper) SetGroupTransition

func (k Keeper) SetGroupTransition(ctx sdk.Context, groupTransition types.GroupTransition)

SetGroupTransition sets a group transition information in the store.

func (Keeper) SetMember

func (k Keeper) SetMember(ctx sdk.Context, member types.Member)

SetMember sets a member information in the store.

func (Keeper) SetModuleAccount

func (k Keeper) SetModuleAccount(ctx sdk.Context, acc sdk.ModuleAccountI)

SetModuleAccount sets a module account in the account keeper.

func (Keeper) SetNewGroupTransition

func (k Keeper) SetNewGroupTransition(
	ctx sdk.Context,
	incomingGroupID tss.GroupID,
	execTime time.Time,
	isForceTransition bool,
) (types.GroupTransition, error)

SetNewGroupTransition sets a new group transition with the current group ID and public key.

func (Keeper) SetParams

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

SetParams sets the x/bandtss module parameters.

func (Keeper) SetSigning

func (k Keeper) SetSigning(ctx sdk.Context, signing types.Signing)

SetSigning sets a signing of the bandtss module.

func (Keeper) SetSigningCount

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

SetSigningCount sets the number of bandtss signing count to the given value.

func (Keeper) SetSigningIDMapping

func (k Keeper) SetSigningIDMapping(ctx sdk.Context, signingID tss.SigningID, signingInfoID types.SigningID)

SetSigningIDMapping sets a mapping between tss.signingID and bandtss signing id.

func (Keeper) ShouldExecuteGroupTransition

func (k Keeper) ShouldExecuteGroupTransition(ctx sdk.Context) (transition types.GroupTransition, ok bool)

ShouldExecuteGroupTransition checks if the group transition should be executed by comparing the block time with the transition execution time.

func (Keeper) ValidateTransitionExecTime

func (k Keeper) ValidateTransitionExecTime(ctx sdk.Context, execTime time.Time) error

ValidateTransitionExecTime validate the transition execution time if it is after the block time but not over the max duration.

func (Keeper) ValidateTransitionInProgress

func (k Keeper) ValidateTransitionInProgress(ctx sdk.Context) error

ValidateTransitionInProgress checks if there is a group transition in progress.

type TSSCallback

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

Wrapper struct

func NewTSSCallback

func NewTSSCallback(k Keeper) TSSCallback

func (TSSCallback) OnGroupCreationCompleted

func (cb TSSCallback) OnGroupCreationCompleted(ctx sdk.Context, groupID tss.GroupID)

func (TSSCallback) OnGroupCreationExpired

func (cb TSSCallback) OnGroupCreationExpired(ctx sdk.Context, groupID tss.GroupID)

func (TSSCallback) OnGroupCreationFailed

func (cb TSSCallback) OnGroupCreationFailed(ctx sdk.Context, groupID tss.GroupID)

func (TSSCallback) OnSigningCompleted

func (cb TSSCallback) OnSigningCompleted(
	ctx sdk.Context,
	signingID tss.SigningID,
	assignedMembers []sdk.AccAddress,
)

func (TSSCallback) OnSigningFailed

func (cb TSSCallback) OnSigningFailed(ctx sdk.Context, signingID tss.SigningID)

func (TSSCallback) OnSigningTimeout

func (cb TSSCallback) OnSigningTimeout(
	ctx sdk.Context,
	signingID tss.SigningID,
	idleMembers []sdk.AccAddress,
)

OnSignTimeout is called when the signing request is expired. It penalizes the members that do not sign a message.

Jump to

Keyboard shortcuts

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