Documentation
¶
Overview ¶
Package v1_0_0 nolint revive
Package v1_0_0 nolint revive
Package v1_0_0 nolint revive
Package v1_0_0 nolint revive
Package v1_0_0 nolint revive
Package v1_0_0 nolint revive
Package v1_0_0 nolint revive
Package v1_0_0 nolint revive
Package v1_0_0 nolint revive
Index ¶
Constants ¶
const (
UpgradeName = "v1.0.0"
)
Variables ¶
var AkashUtilsExtraAccountTypes map[reflect.Type]struct{}
AkashUtilsExtraAccountTypes is a map of extra account types that can be overridden. This is defined as a global variable, so it can be modified in the chain's app.go and used here without having to import the chain. Specifically, this is used for compatibility with Akash' Cosmos SDK fork
Functions ¶
func CanCreateModuleAccountAtAddr ¶
func CanCreateModuleAccountAtAddr(ctx sdk.Context, ak AccountKeeper, addr sdk.AccAddress) error
CanCreateModuleAccountAtAddr tells us if we can safely make a module account at a given address. By collision resistance of the address (given API safe construction), the only way for an account to be already be at this address is if its claimed by the same pre-image from the correct module, or some SDK command breaks assumptions and creates an account at designated address. This function checks if there is an account at that address, and runs some safety checks to be extra-sure its not a user account (e.g. non-zero sequence, pubkey, of fore-seen account types). If there is no account, or if we believe its not a user-spendable account, we allow module account creation at the address. else, we do not.
TODO: This is generally from an SDK design flaw code based off wasmd code: https://github.com/CosmWasm/wasmd/pull/996 Its _mandatory_ that the caller do the API safe construction to generate a module account addr, namely, address.Module(ModuleName, {key})
func CreateModuleAccountByName ¶
func CreateModuleAccountByName(ctx sdk.Context, ak AccountKeeper, name string) error
CreateModuleAccountByName creates a module account at the provided name