Documentation
¶
Index ¶
- Variables
- func ErrAccountNotFound() sdk.Error
- func ErrDeveloperAlreadyExist(username types.AccountKey) sdk.Error
- func ErrDeveloperNotFound() sdk.Error
- func ErrGrantPermissionTooHigh() sdk.Error
- func ErrInsufficientDeveloperDeposit() sdk.Error
- func ErrInvalidAppMetadata() sdk.Error
- func ErrInvalidAuthorizedApp() sdk.Error
- func ErrInvalidDescription() sdk.Error
- func ErrInvalidUsername() sdk.Error
- func ErrInvalidValidityPeriod() sdk.Error
- func ErrInvalidWebsite() sdk.Error
- func FindAccountInList(me types.AccountKey, lst []types.AccountKey) int
- func InitGlobalManager(ctx sdk.Context, gm global.GlobalManager) error
- func NewHandler(dm DeveloperManager, am acc.AccountManager, gm global.GlobalManager) sdk.Handler
- func RegisterWire(cdc *wire.Codec)
- type DeveloperManager
- func (dm DeveloperManager) AddToDeveloperList(ctx sdk.Context, username types.AccountKey) sdk.Error
- func (dm DeveloperManager) ClearConsumption(ctx sdk.Context) sdk.Error
- func (dm DeveloperManager) DoesDeveloperExist(ctx sdk.Context, username types.AccountKey) bool
- func (dm DeveloperManager) GetConsumptionWeight(ctx sdk.Context, username types.AccountKey) (sdk.Rat, sdk.Error)
- func (dm DeveloperManager) GetDeveloperList(ctx sdk.Context) (*model.DeveloperList, sdk.Error)
- func (dm DeveloperManager) InitGenesis(ctx sdk.Context) error
- func (dm DeveloperManager) RegisterDeveloper(ctx sdk.Context, username types.AccountKey, deposit types.Coin, ...) sdk.Error
- func (dm DeveloperManager) RemoveFromDeveloperList(ctx sdk.Context, username types.AccountKey) sdk.Error
- func (dm DeveloperManager) ReportConsumption(ctx sdk.Context, username types.AccountKey, consumption types.Coin) sdk.Error
- func (dm DeveloperManager) UpdateDeveloper(ctx sdk.Context, username types.AccountKey, ...) sdk.Error
- func (dm DeveloperManager) Withdraw(ctx sdk.Context, username types.AccountKey, coin types.Coin) sdk.Error
- func (dm DeveloperManager) WithdrawAll(ctx sdk.Context, username types.AccountKey) (types.Coin, sdk.Error)
- type DeveloperRegisterMsg
- func (msg DeveloperRegisterMsg) GetConsumeAmount() types.Coin
- func (msg DeveloperRegisterMsg) GetPermission() types.Permission
- func (msg DeveloperRegisterMsg) GetSignBytes() []byte
- func (msg DeveloperRegisterMsg) GetSigners() []sdk.AccAddress
- func (msg DeveloperRegisterMsg) String() string
- func (msg DeveloperRegisterMsg) Type() string
- func (msg DeveloperRegisterMsg) ValidateBasic() sdk.Error
- type DeveloperRevokeMsg
- func (msg DeveloperRevokeMsg) GetConsumeAmount() types.Coin
- func (msg DeveloperRevokeMsg) GetPermission() types.Permission
- func (msg DeveloperRevokeMsg) GetSignBytes() []byte
- func (msg DeveloperRevokeMsg) GetSigners() []sdk.AccAddress
- func (msg DeveloperRevokeMsg) String() string
- func (msg DeveloperRevokeMsg) Type() string
- func (msg DeveloperRevokeMsg) ValidateBasic() sdk.Error
- type DeveloperUpdateMsg
- func (msg DeveloperUpdateMsg) GetConsumeAmount() types.Coin
- func (msg DeveloperUpdateMsg) GetPermission() types.Permission
- func (msg DeveloperUpdateMsg) GetSignBytes() []byte
- func (msg DeveloperUpdateMsg) GetSigners() []sdk.AccAddress
- func (msg DeveloperUpdateMsg) String() string
- func (msg DeveloperUpdateMsg) Type() string
- func (msg DeveloperUpdateMsg) ValidateBasic() sdk.Error
- type GrantPermissionMsg
- func (msg GrantPermissionMsg) GetConsumeAmount() types.Coin
- func (msg GrantPermissionMsg) GetPermission() types.Permission
- func (msg GrantPermissionMsg) GetSignBytes() []byte
- func (msg GrantPermissionMsg) GetSigners() []sdk.AccAddress
- func (msg GrantPermissionMsg) String() string
- func (msg GrantPermissionMsg) Type() string
- func (msg GrantPermissionMsg) ValidateBasic() sdk.Error
- type PreAuthorizationMsg
- func (msg PreAuthorizationMsg) GetConsumeAmount() types.Coin
- func (msg PreAuthorizationMsg) GetPermission() types.Permission
- func (msg PreAuthorizationMsg) GetSignBytes() []byte
- func (msg PreAuthorizationMsg) GetSigners() []sdk.AccAddress
- func (msg PreAuthorizationMsg) String() string
- func (msg PreAuthorizationMsg) Type() string
- func (msg PreAuthorizationMsg) ValidateBasic() sdk.Error
- type RevokePermissionMsg
- func (msg RevokePermissionMsg) GetConsumeAmount() types.Coin
- func (msg RevokePermissionMsg) GetPermission() types.Permission
- func (msg RevokePermissionMsg) GetSignBytes() []byte
- func (msg RevokePermissionMsg) GetSigners() []sdk.AccAddress
- func (msg RevokePermissionMsg) String() string
- func (msg RevokePermissionMsg) Type() string
- func (msg RevokePermissionMsg) ValidateBasic() sdk.Error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( TestInfraKVStoreKey = sdk.NewKVStoreKey("infra") TestAccountKVStoreKey = sdk.NewKVStoreKey("account") TestGlobalKVStoreKey = sdk.NewKVStoreKey("global") TestParamKVStoreKey = sdk.NewKVStoreKey("param") )
Functions ¶
func ErrDeveloperAlreadyExist ¶
func ErrDeveloperAlreadyExist(username types.AccountKey) sdk.Error
func ErrDeveloperNotFound ¶
func ErrInvalidAppMetadata ¶
func ErrInvalidAuthorizedApp ¶
func ErrInvalidDescription ¶
func ErrInvalidUsername ¶
func ErrInvalidWebsite ¶
func FindAccountInList ¶
func FindAccountInList(me types.AccountKey, lst []types.AccountKey) int
func InitGlobalManager ¶
func InitGlobalManager(ctx sdk.Context, gm global.GlobalManager) error
func NewHandler ¶
func NewHandler(dm DeveloperManager, am acc.AccountManager, gm global.GlobalManager) sdk.Handler
Types ¶
type DeveloperManager ¶
type DeveloperManager struct {
// contains filtered or unexported fields
}
func NewDeveloperManager ¶
func NewDeveloperManager(key sdk.StoreKey, holder param.ParamHolder) DeveloperManager
create NewDeveloperManager
func (DeveloperManager) AddToDeveloperList ¶
func (dm DeveloperManager) AddToDeveloperList( ctx sdk.Context, username types.AccountKey) sdk.Error
func (DeveloperManager) ClearConsumption ¶
func (dm DeveloperManager) ClearConsumption(ctx sdk.Context) sdk.Error
func (DeveloperManager) DoesDeveloperExist ¶
func (dm DeveloperManager) DoesDeveloperExist(ctx sdk.Context, username types.AccountKey) bool
func (DeveloperManager) GetConsumptionWeight ¶
func (dm DeveloperManager) GetConsumptionWeight( ctx sdk.Context, username types.AccountKey) (sdk.Rat, sdk.Error)
func (DeveloperManager) GetDeveloperList ¶
func (dm DeveloperManager) GetDeveloperList(ctx sdk.Context) (*model.DeveloperList, sdk.Error)
func (DeveloperManager) InitGenesis ¶
func (dm DeveloperManager) InitGenesis(ctx sdk.Context) error
func (DeveloperManager) RegisterDeveloper ¶
func (dm DeveloperManager) RegisterDeveloper( ctx sdk.Context, username types.AccountKey, deposit types.Coin, website, description, appMetaData string) sdk.Error
func (DeveloperManager) RemoveFromDeveloperList ¶
func (dm DeveloperManager) RemoveFromDeveloperList( ctx sdk.Context, username types.AccountKey) sdk.Error
func (DeveloperManager) ReportConsumption ¶
func (dm DeveloperManager) ReportConsumption( ctx sdk.Context, username types.AccountKey, consumption types.Coin) sdk.Error
func (DeveloperManager) UpdateDeveloper ¶
func (dm DeveloperManager) UpdateDeveloper( ctx sdk.Context, username types.AccountKey, website, description, appMetadata string) sdk.Error
func (DeveloperManager) Withdraw ¶
func (dm DeveloperManager) Withdraw( ctx sdk.Context, username types.AccountKey, coin types.Coin) sdk.Error
this method won't check if it is a legal withdraw, caller should check by itself
func (DeveloperManager) WithdrawAll ¶
func (dm DeveloperManager) WithdrawAll( ctx sdk.Context, username types.AccountKey) (types.Coin, sdk.Error)
type DeveloperRegisterMsg ¶
type DeveloperRegisterMsg struct {
Username types.AccountKey `json:"username"`
Deposit types.LNO `json:"deposit"`
Website string `json:"website"`
Description string `json:"description"`
AppMetaData string `json:"app_meta_data"`
}
func NewDeveloperRegisterMsg ¶
func NewDeveloperRegisterMsg(developer string, deposit types.LNO, website string, description string, appMetaData string) DeveloperRegisterMsg
DeveloperRegisterMsg Msg Implementations
func (DeveloperRegisterMsg) GetConsumeAmount ¶
func (msg DeveloperRegisterMsg) GetConsumeAmount() types.Coin
Implements Msg.
func (DeveloperRegisterMsg) GetPermission ¶
func (msg DeveloperRegisterMsg) GetPermission() types.Permission
func (DeveloperRegisterMsg) GetSignBytes ¶
func (msg DeveloperRegisterMsg) GetSignBytes() []byte
func (DeveloperRegisterMsg) GetSigners ¶
func (msg DeveloperRegisterMsg) GetSigners() []sdk.AccAddress
func (DeveloperRegisterMsg) String ¶
func (msg DeveloperRegisterMsg) String() string
func (DeveloperRegisterMsg) Type ¶
func (msg DeveloperRegisterMsg) Type() string
func (DeveloperRegisterMsg) ValidateBasic ¶
func (msg DeveloperRegisterMsg) ValidateBasic() sdk.Error
type DeveloperRevokeMsg ¶
type DeveloperRevokeMsg struct {
Username types.AccountKey `json:"username"`
}
func NewDeveloperRevokeMsg ¶
func NewDeveloperRevokeMsg(developer string) DeveloperRevokeMsg
DeveloperRevokeMsg Msg Implementations
func (DeveloperRevokeMsg) GetConsumeAmount ¶
func (msg DeveloperRevokeMsg) GetConsumeAmount() types.Coin
Implements Msg.
func (DeveloperRevokeMsg) GetPermission ¶
func (msg DeveloperRevokeMsg) GetPermission() types.Permission
func (DeveloperRevokeMsg) GetSignBytes ¶
func (msg DeveloperRevokeMsg) GetSignBytes() []byte
func (DeveloperRevokeMsg) GetSigners ¶
func (msg DeveloperRevokeMsg) GetSigners() []sdk.AccAddress
func (DeveloperRevokeMsg) String ¶
func (msg DeveloperRevokeMsg) String() string
func (DeveloperRevokeMsg) Type ¶
func (msg DeveloperRevokeMsg) Type() string
func (DeveloperRevokeMsg) ValidateBasic ¶
func (msg DeveloperRevokeMsg) ValidateBasic() sdk.Error
type DeveloperUpdateMsg ¶
type DeveloperUpdateMsg struct {
Username types.AccountKey `json:"username"`
Website string `json:"website"`
Description string `json:"description"`
AppMetaData string `json:"app_meta_data"`
}
func NewDeveloperUpdateMsg ¶
func NewDeveloperUpdateMsg(developer string, website string, description string, appMetaData string) DeveloperUpdateMsg
DeveloperUpdateMsg Msg Implementations
func (DeveloperUpdateMsg) GetConsumeAmount ¶
func (msg DeveloperUpdateMsg) GetConsumeAmount() types.Coin
Implements Msg.
func (DeveloperUpdateMsg) GetPermission ¶
func (msg DeveloperUpdateMsg) GetPermission() types.Permission
func (DeveloperUpdateMsg) GetSignBytes ¶
func (msg DeveloperUpdateMsg) GetSignBytes() []byte
func (DeveloperUpdateMsg) GetSigners ¶
func (msg DeveloperUpdateMsg) GetSigners() []sdk.AccAddress
func (DeveloperUpdateMsg) String ¶
func (msg DeveloperUpdateMsg) String() string
func (DeveloperUpdateMsg) Type ¶
func (msg DeveloperUpdateMsg) Type() string
func (DeveloperUpdateMsg) ValidateBasic ¶
func (msg DeveloperUpdateMsg) ValidateBasic() sdk.Error
type GrantPermissionMsg ¶
type GrantPermissionMsg struct {
Username types.AccountKey `json:"username"`
AuthorizedApp types.AccountKey `json:"authorized_app"`
ValidityPeriodSec int64 `json:"validity_period_second"`
GrantLevel types.Permission `json:"grant_level"`
}
func NewGrantPermissionMsg ¶
func NewGrantPermissionMsg( user, app string, validityPeriodSec int64, grantLevel types.Permission) GrantPermissionMsg
Grant Msg Implementations
func (GrantPermissionMsg) GetConsumeAmount ¶
func (msg GrantPermissionMsg) GetConsumeAmount() types.Coin
Implements Msg.
func (GrantPermissionMsg) GetPermission ¶
func (msg GrantPermissionMsg) GetPermission() types.Permission
func (GrantPermissionMsg) GetSignBytes ¶
func (msg GrantPermissionMsg) GetSignBytes() []byte
func (GrantPermissionMsg) GetSigners ¶
func (msg GrantPermissionMsg) GetSigners() []sdk.AccAddress
func (GrantPermissionMsg) String ¶
func (msg GrantPermissionMsg) String() string
func (GrantPermissionMsg) Type ¶
func (msg GrantPermissionMsg) Type() string
func (GrantPermissionMsg) ValidateBasic ¶
func (msg GrantPermissionMsg) ValidateBasic() sdk.Error
type PreAuthorizationMsg ¶
type PreAuthorizationMsg struct {
Username types.AccountKey `json:"username"`
AuthorizedApp types.AccountKey `json:"authorized_app"`
ValidityPeriodSec int64 `json:"validity_period_second"`
Amount types.LNO `json:"amount"`
}
func NewPreAuthorizationMsg ¶
func NewPreAuthorizationMsg( user string, authorizedApp string, validityPeriodSec int64, amount types.LNO) PreAuthorizationMsg
PreAuthorization Msg Implementations
func (PreAuthorizationMsg) GetConsumeAmount ¶
func (msg PreAuthorizationMsg) GetConsumeAmount() types.Coin
Implements Msg.
func (PreAuthorizationMsg) GetPermission ¶
func (msg PreAuthorizationMsg) GetPermission() types.Permission
func (PreAuthorizationMsg) GetSignBytes ¶
func (msg PreAuthorizationMsg) GetSignBytes() []byte
func (PreAuthorizationMsg) GetSigners ¶
func (msg PreAuthorizationMsg) GetSigners() []sdk.AccAddress
func (PreAuthorizationMsg) String ¶
func (msg PreAuthorizationMsg) String() string
func (PreAuthorizationMsg) Type ¶
func (msg PreAuthorizationMsg) Type() string
func (PreAuthorizationMsg) ValidateBasic ¶
func (msg PreAuthorizationMsg) ValidateBasic() sdk.Error
type RevokePermissionMsg ¶
type RevokePermissionMsg struct {
Username types.AccountKey `json:"username"`
PubKey crypto.PubKey `json:"public_key"`
}
func NewRevokePermissionMsg ¶
func NewRevokePermissionMsg(user string, pubKey crypto.PubKey) RevokePermissionMsg
Revoke Msg Implementations
func (RevokePermissionMsg) GetConsumeAmount ¶
func (msg RevokePermissionMsg) GetConsumeAmount() types.Coin
Implements Msg.
func (RevokePermissionMsg) GetPermission ¶
func (msg RevokePermissionMsg) GetPermission() types.Permission
func (RevokePermissionMsg) GetSignBytes ¶
func (msg RevokePermissionMsg) GetSignBytes() []byte
func (RevokePermissionMsg) GetSigners ¶
func (msg RevokePermissionMsg) GetSigners() []sdk.AccAddress
func (RevokePermissionMsg) String ¶
func (msg RevokePermissionMsg) String() string
func (RevokePermissionMsg) Type ¶
func (msg RevokePermissionMsg) Type() string
func (RevokePermissionMsg) ValidateBasic ¶
func (msg RevokePermissionMsg) ValidateBasic() sdk.Error
Click to show internal directories.
Click to hide internal directories.