v038

package
v0.45.17 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package v038 is used for legacy migration scripts. Actual migration scripts for v038 have been removed, but the v039->v042 migration script still references types from this file, so we're keeping it for now.

Index

Constants

View Source
const (
	ModuleName = "auth"
)

Variables

This section is empty.

Functions

func NewModuleAddress

func NewModuleAddress(name string) sdk.AccAddress

func RegisterLegacyAminoCodec

func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)

func ValidateGenAccounts

func ValidateGenAccounts(genAccounts GenesisAccounts) error

func ValidatePermissions

func ValidatePermissions(permissions ...string) error

Types

type Account

type Account interface {
	GetAddress() sdk.AccAddress
	GetAccountNumber() uint64
	GetCoins() sdk.Coins
	SetCoins(sdk.Coins) error
}

partial interface needed only for amino encoding and sanitization

type BaseAccount

type BaseAccount struct {
	Address       sdk.AccAddress     `json:"address" yaml:"address"`
	Coins         sdk.Coins          `json:"coins,omitempty" yaml:"coins,omitempty"`
	PubKey        cryptotypes.PubKey `json:"public_key" yaml:"public_key"`
	AccountNumber uint64             `json:"account_number" yaml:"account_number"`
	Sequence      uint64             `json:"sequence" yaml:"sequence"`
}

func NewBaseAccount

func NewBaseAccount(
	address sdk.AccAddress, coins sdk.Coins, pk cryptotypes.PubKey, accountNumber, sequence uint64,
) *BaseAccount

func NewBaseAccountWithAddress

func NewBaseAccountWithAddress(addr sdk.AccAddress) BaseAccount

func (*BaseAccount) GetAccountNumber

func (acc *BaseAccount) GetAccountNumber() uint64

func (BaseAccount) GetAddress

func (acc BaseAccount) GetAddress() sdk.AccAddress

func (*BaseAccount) GetCoins

func (acc *BaseAccount) GetCoins() sdk.Coins

func (BaseAccount) MarshalJSON

func (acc BaseAccount) MarshalJSON() ([]byte, error)

func (*BaseAccount) SetCoins

func (acc *BaseAccount) SetCoins(coins sdk.Coins) error

func (*BaseAccount) UnmarshalJSON

func (acc *BaseAccount) UnmarshalJSON(bz []byte) error

UnmarshalJSON unmarshals raw JSON bytes into a BaseAccount.

func (BaseAccount) Validate

func (acc BaseAccount) Validate() error

type BaseVestingAccount

type BaseVestingAccount struct {
	*BaseAccount

	OriginalVesting  sdk.Coins `json:"original_vesting"`
	DelegatedFree    sdk.Coins `json:"delegated_free"`
	DelegatedVesting sdk.Coins `json:"delegated_vesting"`

	EndTime int64 `json:"end_time"`
}

func NewBaseVestingAccount

func NewBaseVestingAccount(
	baseAccount *BaseAccount, originalVesting, delegatedFree, delegatedVesting sdk.Coins, endTime int64,
) *BaseVestingAccount

func (BaseVestingAccount) MarshalJSON

func (bva BaseVestingAccount) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON representation of a BaseVestingAccount.

func (*BaseVestingAccount) UnmarshalJSON

func (bva *BaseVestingAccount) UnmarshalJSON(bz []byte) error

UnmarshalJSON unmarshals raw JSON bytes into a BaseVestingAccount.

func (BaseVestingAccount) Validate

func (bva BaseVestingAccount) Validate() error

type ContinuousVestingAccount

type ContinuousVestingAccount struct {
	*BaseVestingAccount

	StartTime int64 `json:"start_time"`
}

func NewContinuousVestingAccountRaw

func NewContinuousVestingAccountRaw(bva *BaseVestingAccount, startTime int64) *ContinuousVestingAccount

func (ContinuousVestingAccount) MarshalJSON

func (cva ContinuousVestingAccount) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON representation of a ContinuousVestingAccount.

func (*ContinuousVestingAccount) UnmarshalJSON

func (cva *ContinuousVestingAccount) UnmarshalJSON(bz []byte) error

UnmarshalJSON unmarshals raw JSON bytes into a ContinuousVestingAccount.

func (ContinuousVestingAccount) Validate

func (cva ContinuousVestingAccount) Validate() error

type DelayedVestingAccount

type DelayedVestingAccount struct {
	*BaseVestingAccount
}

func NewDelayedVestingAccountRaw

func NewDelayedVestingAccountRaw(bva *BaseVestingAccount) *DelayedVestingAccount

func (DelayedVestingAccount) MarshalJSON

func (dva DelayedVestingAccount) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON representation of a DelayedVestingAccount.

func (*DelayedVestingAccount) UnmarshalJSON

func (dva *DelayedVestingAccount) UnmarshalJSON(bz []byte) error

UnmarshalJSON unmarshals raw JSON bytes into a DelayedVestingAccount.

func (DelayedVestingAccount) Validate

func (dva DelayedVestingAccount) Validate() error

type GenesisAccount

type GenesisAccount interface {
	Account

	Validate() error
}

type GenesisAccounts

type GenesisAccounts []GenesisAccount

func SanitizeGenesisAccounts

func SanitizeGenesisAccounts(genAccounts GenesisAccounts) GenesisAccounts

type GenesisState

type GenesisState struct {
	Params   v034auth.Params `json:"params" yaml:"params"`
	Accounts GenesisAccounts `json:"accounts" yaml:"accounts"`
}

func NewGenesisState

func NewGenesisState(params v034auth.Params, accounts GenesisAccounts) GenesisState

type ModuleAccount

type ModuleAccount struct {
	*BaseAccount

	Name        string   `json:"name" yaml:"name"`
	Permissions []string `json:"permissions" yaml:"permissions"`
}

func NewModuleAccount

func NewModuleAccount(baseAccount *BaseAccount, name string, permissions ...string) *ModuleAccount

func (ModuleAccount) MarshalJSON

func (ma ModuleAccount) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON representation of a ModuleAccount.

func (*ModuleAccount) UnmarshalJSON

func (ma *ModuleAccount) UnmarshalJSON(bz []byte) error

UnmarshalJSON unmarshals raw JSON bytes into a ModuleAccount.

func (ModuleAccount) Validate

func (ma ModuleAccount) Validate() error

Jump to

Keyboard shortcuts

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