keeper

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2025 License: AGPL-3.0, Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const MaxTimeInFutureMs = 30000
View Source
const MaxTimeInPastMs = 30000
View Source
const MaxTimestampNonceArrSize = 20
View Source
const TimestampNonceSequenceCutoff uint64 = 1 << 40 // 2^40

Variables

This section is empty.

Functions

func AccountStateFromTimestampNonceDetails

func AccountStateFromTimestampNonceDetails(
	address sdk.AccAddress,
	tsNonce uint64,
) types.AccountState

func AttemptTimestampNonceUpdate

func AttemptTimestampNonceUpdate(
	tsNonce uint64,
	accountState *types.AccountState,
) bool

Check if the new tsNonce should be accepted. If satisfies conditions, inplace update AccountState. Returns bool indicating if new tsNonce was accepted (update was made).

func EjectStaleTimestampNonces

func EjectStaleTimestampNonces(accountState *types.AccountState, referenceTs uint64)

Inplace eject all stale timestamps.

func IsTimestampNonce

func IsTimestampNonce(ts uint64) bool

func IsValidTimestampNonce

func IsValidTimestampNonce(tsNonce uint64, referenceTs uint64) bool

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) 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,
	key storetypes.StoreKey,
	authenticatorManager *authenticator.AuthenticatorManager,
	authorities []string,
) *Keeper

func (Keeper) AccountState

func (k Keeper) AccountState(
	ctx context.Context,
	request *types.AccountStateRequest,
) (*types.AccountStateResponse, error)

AccountState returns the x/accountplus account state for an address

func (Keeper) AddAuthenticator

func (k Keeper) AddAuthenticator(
	ctx sdk.Context,
	account sdk.AccAddress,
	authenticatorType string,
	config []byte,
) (uint64, error)

AddAuthenticator adds an authenticator to an account, this function is used to add multiple authenticators such as SignatureVerifications and AllOfs

func (Keeper) GetAccountState

func (k Keeper) GetAccountState(
	ctx sdk.Context,
	address sdk.AccAddress,
) (types.AccountState, bool)

Get the AccountState from KVStore for a given account address

func (Keeper) GetAllAccountStates

func (k Keeper) GetAllAccountStates(ctx sdk.Context) ([]types.AccountState, error)

Get all AccountStates from kvstore

func (Keeper) GetAllAuthenticatorData

func (k Keeper) GetAllAuthenticatorData(ctx sdk.Context) ([]types.AuthenticatorData, error)

GetAllAuthenticatorData is used in genesis export to export all the authenticator for all accounts

func (Keeper) GetAuthenticator

func (k Keeper) GetAuthenticator(
	ctx context.Context,
	request *types.GetAuthenticatorRequest,
) (*types.GetAuthenticatorResponse, error)

GetAuthenticator returns a specific authenticator for an account given its authenticator id.

func (Keeper) GetAuthenticatorDataForAccount

func (k Keeper) GetAuthenticatorDataForAccount(
	ctx sdk.Context,
	account sdk.AccAddress,
) ([]*types.AccountAuthenticator, error)

GetAuthenticatorDataForAccount gets all authenticators AccAddressFromBech32 with an account from the store.

func (Keeper) GetAuthenticators

func (k Keeper) GetAuthenticators(
	ctx context.Context,
	request *types.GetAuthenticatorsRequest,
) (*types.GetAuthenticatorsResponse, error)

GetAuthenticators returns all authenticators for an account.

func (Keeper) GetCdc

func (k Keeper) GetCdc() codec.BinaryCodec

func (Keeper) GetInitializedAuthenticatorForAccount

func (k Keeper) GetInitializedAuthenticatorForAccount(
	ctx sdk.Context,
	account sdk.AccAddress,
	selectedAuthenticator uint64,
) (types.InitializedAuthenticator, error)

GetInitializedAuthenticatorForAccount returns a single initialized authenticator for the account. It fetches the authenticator data from the store, gets the authenticator struct from the manager, then calls initialize on the authenticator data

func (*Keeper) GetIsSmartAccountActive

func (k *Keeper) GetIsSmartAccountActive(ctx sdk.Context) bool

GetIsSmartAccountActive returns the value of the isSmartAccountActive parameter. If the value has not been set, it will return false.

func (Keeper) GetParams

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

GetParams get all parameters as types.Params

func (Keeper) GetSelectedAuthenticatorData

func (k Keeper) GetSelectedAuthenticatorData(
	ctx sdk.Context,
	account sdk.AccAddress,
	selectedAuthenticator uint64,
) (*types.AccountAuthenticator, error)

GetSelectedAuthenticatorData gets a single authenticator for the account from the store.

func (Keeper) GetStoreKey

func (k Keeper) GetStoreKey() storetypes.StoreKey

func (Keeper) HasAuthority

func (k Keeper) HasAuthority(authority string) bool

func (Keeper) InitializeForGenesis

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

Func required for test setup

func (Keeper) InitializeOrGetNextAuthenticatorId

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

InitializeOrGetNextAuthenticatorId returns the next authenticator id.

func (Keeper) Logger

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

func (Keeper) MaybeValidateAuthenticators

func (k Keeper) MaybeValidateAuthenticators(ctx sdk.Context, tx sdk.Tx) error

MaybeValidateAuthenticators checks if the transaction has authenticators specified and if so, validates them. It returns an error if the authenticators are not valid or removed from state.

func (Keeper) Params

GetParams returns the parameters for the accountplus module.

func (Keeper) ProcessTimestampNonce

func (k Keeper) ProcessTimestampNonce(ctx sdk.Context, acc sdk.AccountI, tsNonce uint64) error

func (Keeper) RemoveAuthenticator

func (k Keeper) RemoveAuthenticator(ctx sdk.Context, account sdk.AccAddress, authenticatorId uint64) error

RemoveAuthenticator removes an authenticator from an account

func (Keeper) SetAccountState

func (k Keeper) SetAccountState(
	ctx sdk.Context,
	address sdk.AccAddress,
	accountState types.AccountState,
)

Set the AccountState into KVStore for a given account address

func (Keeper) SetActiveState

func (k Keeper) SetActiveState(ctx sdk.Context, active bool)

SetActiveState sets the active state of the smart account module.

func (Keeper) SetAuthenticator

func (k Keeper) SetAuthenticator(
	ctx sdk.Context,
	account string,
	authenticatorId uint64,
	authenticator types.AccountAuthenticator,
)

func (Keeper) SetGenesisState

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

Set genesis state

func (Keeper) SetNextAuthenticatorId

func (k Keeper) SetNextAuthenticatorId(ctx sdk.Context, authenticatorId uint64)

SetNextAuthenticatorId sets next authenticator id.

func (Keeper) SetParams

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

SetParams set the params

Jump to

Keyboard shortcuts

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