v1_0_0

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2025 License: Apache-2.0 Imports: 45 Imported by: 0

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

View Source
const (
	UpgradeName = "v1.0.0"
)

Variables

View Source
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

func ProviderKey

func ProviderKey(id sdk.Address) []byte

Types

type AccountKeeper

type AccountKeeper interface {
	NewAccount(sdk.Context, sdk.AccountI) sdk.AccountI

	GetAccount(ctx sdk.Context, addr sdk.AccAddress) sdk.AccountI
	SetAccount(ctx sdk.Context, acc sdk.AccountI)
}

Jump to

Keyboard shortcuts

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