Documentation ¶
Index ¶
- Constants
- Variables
- func Set(p *MintBasePermissions, ty MintPermFlag, value bool) error
- type Account
- type AccountType
- type Chain
- type ChainType
- type Do
- type MintAccount
- type MintAccountPermissions
- type MintBasePermissions
- type MintGenesis
- type MintPermFlag
- type MintPrivValidator
- type MintTxOutput
- type MintValidator
Constants ¶
View Source
const ( // chain permissions MintRoot MintPermFlag = 1 << iota // 1 MintSend // 2 MintCall // 4 MintCreateContract // 8 MintCreateAccount // 16 MintBond // 32 MintName // 64 // application permissions MintHasBase MintSetBase MintUnsetBase MintSetGlobal MintHasRole MintAddRole MintRmRole MintNumPermissions uint = 14 // NOTE Adjust this too. We can support upto 64 MintTopPermFlag MintPermFlag = 1 << (MintNumPermissions - 1) MintAllPermFlags MintPermFlag = MintTopPermFlag | (MintTopPermFlag - 1) MintDefaultPermFlags MintPermFlag = MintSend | MintCall | MintCreateContract | MintCreateAccount | MintBond | MintName | MintHasBase | MintHasRole )
Base permission references are like unix (the index is already bit shifted)
Variables ¶
View Source
var ( MintZeroBasePermissions = &MintBasePermissions{zeroPerm, zeroPerm} MintZeroAccountPermissions = MintAccountPermissions{ MintBase: MintZeroBasePermissions, } )
Functions ¶
func Set ¶
func Set(p *MintBasePermissions, ty MintPermFlag, value bool) error
Set a permission bit. Will set the permission's set bit to true.
Types ¶
type Account ¶
type Account struct { Name string `mapstructure:"," json:"," yaml:"," toml:","` Address string `mapstructure:"," json:"," yaml:"," toml:","` PubKey string `mapstructure:"," json:"," yaml:"," toml:","` Tokens int `mapstructure:"," json:"," yaml:"," toml:","` ToBond int `mapstructure:"," json:"," yaml:"," toml:","` Validator bool PermissionsMap map[string]int MintPermissions *MintAccountPermissions MintKey *MintPrivValidator }
type AccountType ¶
type AccountType struct { Name string `mapstructure:"name" json:"name" yaml:"name" toml:"name"` Definition string `mapstructure:"definition" json:"definition" yaml:"definition" toml:"definition"` TypicalUser string `mapstructure:"typical_user" json:"typical_user" yaml:"typical_user" toml:"typical_user"` Number int `mapstructure:"default_number" json:"default_number" yaml:"default_number" toml:"default_number"` Tokens int `mapstructure:"default_tokens" json:"default_tokens" yaml:"default_tokens" toml:"default_tokens"` ToBond int `mapstructure:"default_bond" json:"default_bond" yaml:"default_bond" toml:"default_bond"` Perms map[string]int `mapstructure:"perms" json:"perms" yaml:"perms" toml:"perms"` }
func BlankAccountType ¶
func BlankAccountType() *AccountType
type Chain ¶
func BlankChain ¶
func BlankChain() *Chain
type ChainType ¶
type ChainType struct { Name string `mapstructure:"name" json:"name" yaml:"name" toml:"name"` AccountTypes map[string]int `mapstructure:"account_types" json:"account_types" yaml:"account_types" toml:"account_types"` // currently unused ConsensusEngine map[string]string `mapstructure:"consensus" json:"consensus" yaml:"consensus" toml:"consensus"` ApplicationManager map[string]string `mapstructure:"manager" json:"manager" yaml:"manager" toml:"manager"` Messenger map[string]string `mapstructure:"messenger" json:"messenger" yaml:"messenger" toml:"messenger"` }
func BlankChainType ¶
func BlankChainType() *ChainType
type Do ¶
type MintAccount ¶
type MintAccount struct { Address string `json:"address"` Amount int `json:"amount"` Name string `json:"name"` Permissions *MintAccountPermissions `json:"permissions"` }
type MintAccountPermissions ¶
type MintAccountPermissions struct { MintBase *MintBasePermissions `json:"base"` MintRoles []string `json:"roles"` }
type MintBasePermissions ¶
type MintBasePermissions struct { MintPerms MintPermFlag `json:"perms"` MintSetBit MintPermFlag `json:"set"` }
type MintGenesis ¶
type MintGenesis struct { ChainID string `json:"chain_id"` Accounts []*MintAccount `json:"accounts"` Validators []*MintValidator `json:"validators"` }
func BlankGenesis ¶
func BlankGenesis() *MintGenesis
type MintPermFlag ¶
type MintPermFlag uint64
type MintPrivValidator ¶
type MintTxOutput ¶
type MintValidator ¶
type MintValidator struct { PubKey []interface{} `json:"pub_key"` Name string `json:"name"` Amount int `json:"amount"` UnbondTo []*MintTxOutput `json:"unbond_to"` }
Click to show internal directories.
Click to hide internal directories.