v038

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

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 Migrate

func Migrate(authGenState v036auth.GenesisState, genAccountsGenState v036genaccounts.GenesisState) GenesisState

Migrate accepts exported genesis state from v0.34 and migrates it to v0.38 genesis state.

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