Documentation
¶
Index ¶
- Constants
- func AccountStateFromTimestampNonceDetails(address sdk.AccAddress, tsNonce uint64) types.AccountState
- func AttemptTimestampNonceUpdate(tsNonce uint64, accountState *types.AccountState) bool
- func EjectStaleTimestampNonces(accountState *types.AccountState, referenceTs uint64)
- func IsTimestampNonce(ts uint64) bool
- func IsValidTimestampNonce(tsNonce uint64, referenceTs uint64) bool
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- type Keeper
- func (k Keeper) AccountState(ctx context.Context, request *types.AccountStateRequest) (*types.AccountStateResponse, error)
- func (k Keeper) AddAuthenticator(ctx sdk.Context, account sdk.AccAddress, authenticatorType string, ...) (uint64, error)
- func (k Keeper) GetAccountState(ctx sdk.Context, address sdk.AccAddress) (types.AccountState, bool)
- func (k Keeper) GetAllAccountStates(ctx sdk.Context) ([]types.AccountState, error)
- func (k Keeper) GetAllAuthenticatorData(ctx sdk.Context) ([]types.AuthenticatorData, error)
- func (k Keeper) GetAuthenticator(ctx context.Context, request *types.GetAuthenticatorRequest) (*types.GetAuthenticatorResponse, error)
- func (k Keeper) GetAuthenticatorDataForAccount(ctx sdk.Context, account sdk.AccAddress) ([]*types.AccountAuthenticator, error)
- func (k Keeper) GetAuthenticators(ctx context.Context, request *types.GetAuthenticatorsRequest) (*types.GetAuthenticatorsResponse, error)
- func (k Keeper) GetCdc() codec.BinaryCodec
- func (k Keeper) GetInitializedAuthenticatorForAccount(ctx sdk.Context, account sdk.AccAddress, selectedAuthenticator uint64) (types.InitializedAuthenticator, error)
- func (k *Keeper) GetIsSmartAccountActive(ctx sdk.Context) bool
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetSelectedAuthenticatorData(ctx sdk.Context, account sdk.AccAddress, selectedAuthenticator uint64) (*types.AccountAuthenticator, error)
- func (k Keeper) GetStoreKey() storetypes.StoreKey
- func (k Keeper) HasAuthority(authority string) bool
- func (k Keeper) InitializeForGenesis(ctx sdk.Context)
- func (k Keeper) InitializeOrGetNextAuthenticatorId(ctx sdk.Context) uint64
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MaybeValidateAuthenticators(ctx sdk.Context, tx sdk.Tx) error
- func (k Keeper) Params(goCtx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) ProcessTimestampNonce(ctx sdk.Context, acc sdk.AccountI, tsNonce uint64) error
- func (k Keeper) RemoveAuthenticator(ctx sdk.Context, account sdk.AccAddress, authenticatorId uint64) error
- func (k Keeper) SetAccountState(ctx sdk.Context, address sdk.AccAddress, accountState types.AccountState)
- func (k Keeper) SetActiveState(ctx sdk.Context, active bool)
- func (k Keeper) SetAuthenticator(ctx sdk.Context, account string, authenticatorId uint64, ...)
- func (k Keeper) SetGenesisState(ctx sdk.Context, data types.GenesisState) error
- func (k Keeper) SetNextAuthenticatorId(ctx sdk.Context, authenticatorId uint64)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
Constants ¶
const MaxTimeInFutureMs = 30000
const MaxTimeInPastMs = 30000
const MaxTimestampNonceArrSize = 20
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 IsValidTimestampNonce ¶
func NewMsgServerImpl ¶
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 ¶
Get all AccountStates from kvstore
func (Keeper) GetAllAuthenticatorData ¶
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 ¶
GetIsSmartAccountActive returns the value of the isSmartAccountActive parameter. If the value has not been set, it will return false.
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 (Keeper) InitializeForGenesis ¶
Func required for test setup
func (Keeper) InitializeOrGetNextAuthenticatorId ¶
InitializeOrGetNextAuthenticatorId returns the next authenticator id.
func (Keeper) MaybeValidateAuthenticators ¶
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 ¶
func (k Keeper) Params(goCtx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
GetParams returns the parameters for the accountplus module.
func (Keeper) ProcessTimestampNonce ¶
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 ¶
SetActiveState sets the active state of the smart account module.
func (Keeper) SetAuthenticator ¶
func (Keeper) SetGenesisState ¶
Set genesis state
func (Keeper) SetNextAuthenticatorId ¶
SetNextAuthenticatorId sets next authenticator id.