types

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventTypeSmartAccountTx        = "smart_account_tx"
	EventTypeSmartAccountActivated = "smart_account_activated"
	EventTypeSmartAccountRecovery  = "smart_account_recovery"
	AttributeKeyCreator            = "creator"
	AttributeKeyCodeID             = "code_id"
	AttributeKeyContractAddr       = "contract_addr"
)
View Source
const (
	// ModuleName defines the module name
	ModuleName = "smartaccount"

	// StoreKey defines the primary module store key
	StoreKey = ModuleName

	// RouterKey is the message route for slashing
	RouterKey = ModuleName

	// QuerierRoute defines the module's query routing key
	QuerierRoute = ModuleName

	// MemStoreKey defines the in-memory store key
	MemStoreKey = "mem_smartaccount"

	AccountIDKey = "smartaccount_id"

	// In the AnteHandler, if the tx only has one sender and this sender is an
	// AbstractAccount, we store its address here. This way, in the PostHandler,
	// we know whether to call the after_tx method.
	SignerAddressKey = "smartaccount_signer"

	// free gas remaining in ante and post handlers
	// each smartaccount tx will have a limited amount of gas that can be used for free
	// the limitation will be determined by the government
	GasRemainingKey = "gas_remaining"
)

Variables

View Source
var (
	ErrBadInstantiateMsg         = errorsmod.Register(ModuleName, 1, "bad instantiate message")
	ErrInvalidPubKey             = errorsmod.Register(ModuleName, 2, "invalid publickey")
	ErrAccountNotFoundForAddress = errorsmod.Register(ModuleName, 3, "account not found for address")
	ErrInvalidAddress            = errorsmod.Register(ModuleName, 4, "invalid address")
	ErrInvalidBench32            = errorsmod.Register(ModuleName, 5, "invalid bench32")
	ErrInvalidTx                 = errorsmod.Register(ModuleName, 6, "invalid tx")
	ErrInvalidMsg                = errorsmod.Register(ModuleName, 7, "invalid smart-account messages")
	ErrNoSuchCodeID              = errorsmod.Register(ModuleName, 8, "code id not found")
	ErrNilPubkey                 = errorsmod.Register(ModuleName, 9, "nil pubkey")
	ErrAccountAlreadyExists      = errorsmod.Register(ModuleName, 10, "account already exists")
	ErrInstantiateDuplicate      = errorsmod.Register(ModuleName, 11, "instance with this code id, sender, salt and label exists")
	ErrInvalidCredentials        = errorsmod.Register(ModuleName, 12, "invalid credentials")
	ErrInvalidCodeID             = errorsmod.Register(ModuleName, 13, "invalid code id")
	ErrNotSupported              = errorsmod.Register(ModuleName, 14, "not supported")
	ErrNotAllowedMsg             = errorsmod.Register(ModuleName, 15, "not allowed message")
	ErrOutOfGas                  = errorsmod.Register(ModuleName, 16, "contract sudo execution ran out of gas")
	ErrContractExecutionPanic    = errorsmod.Register(ModuleName, 17, "contract sudo execution panicked")
)

x/aa module sentinel errors

View Source
var (
	ParamsKey = []byte{0x00}
)

Functions

func Instantiate2Address

func Instantiate2Address(
	ctx sdk.Context,
	wasmKeeper wasmkeeper.Keeper,
	codeId uint64,
	initMsg []byte,
	salt []byte,
	pubKey cryptotypes.PubKey,
) (sdk.AccAddress, error)

generate predictable contract address

func IsOutOfGasError added in v0.7.3

func IsOutOfGasError(err any) (bool, string)

Check if error is out of gas error

func KeyPrefix

func KeyPrefix(p string) []byte

Types

type AccountKeeper

type AccountKeeper interface {
	GetParams(ctx sdk.Context) (params authtypes.Params)
	GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI
	SetAccount(ctx sdk.Context, acc authtypes.AccountI)
	GetModuleAddress(moduleName string) sdk.AccAddress
}

AccountKeeper defines the expected account keeper used for simulations (noalias)

type AccountMsg

type AccountMsg struct {
	PreExecuteTx   *PreExecuteTx   `json:"pre_execute,omitempty"`
	AfterExecuteTx *AfterExecuteTx `json:"after_execute,omitempty"`
	RecoverTx      *RecoverTx      `json:"recover,omitempty"`
}

type AfterExecuteTx

type AfterExecuteTx struct {
	Msgs      []Any     `json:"msgs"`
	CallInfo  CallInfo  `json:"call_info"`
	AuthzInfo AuthzInfo `json:"authz_info"`
}

type Any

type Any struct {
	TypeURL string `json:"type_url"`
	Value   []byte `json:"value"`
}

func ParseMessagesString

func ParseMessagesString(msgs []sdk.Msg) ([]Any, error)

type AuthzInfo added in v0.7.3

type AuthzInfo struct {
	Grantee string `json:"grantee"`
}

type BankKeeper

type BankKeeper interface {
	SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
}

BankKeeper defines the expected interface needed to retrieve account balances.

type CallInfo

type CallInfo struct {
	Fee        sdk.Coins `json:"fee"`
	Gas        uint64    `json:"gas"`
	FeePayer   string    `json:"fee_payer"`
	FeeGranter string    `json:"fee_granter"`
}

type PreExecuteTx

type PreExecuteTx struct {
	Msgs      []Any     `json:"msgs"`
	CallInfo  CallInfo  `json:"call_info"`
	AuthzInfo AuthzInfo `json:"authz_info"`
}

type RecoverTx

type RecoverTx struct {
	Caller      string `json:"caller"`
	PubKey      []byte `json:"pub_key"`
	Credentials []byte `json:"credentials"`
}

Directories

Path Synopsis
Package v1beta1 is a reverse proxy.
Package v1beta1 is a reverse proxy.

Jump to

Keyboard shortcuts

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