Documentation ¶
Index ¶
- Constants
- Variables
- func FileStoreKey(sender []byte) []byte
- func MustMarshalFileInfo(cdc *codec.Codec, file FileInfo) []byte
- func ParamKeyTable() params.KeyTable
- func PrepayBalanceKey(acc []byte) []byte
- func RegisterCodec(cdc *codec.Codec)
- func ValidateGenesis(data GenesisState) error
- type FileInfo
- type GenesisState
- type MsgFileUpload
- type MsgPrepay
- type ParamSubspace
- type Params
- type QueryUploadedFileParams
Constants ¶
const ( EventTypeFileUpload = "FileUpload" EventTypePrepay = "Prepay" AttributeKeyReporter = "reporter" AttributeKeyFileHash = "file_hash" AttributeKeyUploader = "uploader" AttributeKeyRecipient = "recipient" AttributeKeyCoins = "coins" AttributeKeyPurchasedUoz = "purchased" AttributeValueCategory = ModuleName )
sds module event types
const ( // ModuleName is the name of the module ModuleName = "sds" // StoreKey to be used when creating the KVStore StoreKey = ModuleName // RouterKey to be used for routing msgs RouterKey = ModuleName // QuerierRoute to be used for querier msgs QuerierRoute = ModuleName )
const ( ConstFileUpload = "FileUploadTx" ConstSdsPrepay = "SdsPrepayTx" )
const ( QueryParams = "params" QueryUploadedFile = "uploaded_file" QueryPrepay = "prepay" QuerySimulatePrepay = "simulate_prepay" QueryCurrUozPrice = "curr_uoz_price" QueryUozSupply = "uoz_supply" )
querier keys
const (
DefaultParamSpace = ModuleName
)
Default parameter namespace
Variables ¶
var ( // Acc Balance prefix for sds store PrepayBalancePrefix = []byte{0x01} // FileStorage prefix for sds store FileStoreKeyPrefix = []byte{0x02} )
var (
ErrInvalid = sdkerrors.Register(ModuleName, 1, "error invalid")
)
var ModuleCdc *codec.Codec
ModuleCdc defines the module codec
Functions ¶
func FileStoreKey ¶
FileStoreKey turn an address to key used to get it from the account store
func MustMarshalFileInfo ¶
MustMarshalFileInfo returns the fileInfo's bytes. Panics if fails
func PrepayBalanceKey ¶
PrepayBalanceKey turn an address to key used to get prepaid balance from the sds store
func RegisterCodec ¶
RegisterCodec registers concrete types on codec
func ValidateGenesis ¶
func ValidateGenesis(data GenesisState) error
ValidateGenesis validates the sds genesis parameters
Types ¶
type FileInfo ¶
type FileInfo struct { Height sdk.Int Reporter sdk.AccAddress Uploader sdk.AccAddress }
func MustUnmarshalFileInfo ¶
MustUnmarshalFileInfo unmarshal a file's info from a store value. Panics if fails
func NewFileInfo ¶
func NewFileInfo(height sdk.Int, reporter, uploader sdk.AccAddress) FileInfo
constructor
func UnmarshalFileInfo ¶
UnmarshalResourceNode unmarshal a file's info from a store value
type GenesisState ¶
type GenesisState struct { }
GenesisState - all sds state that must be provided at genesis
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
DefaultGenesisState - default GenesisState used by Cosmos Hub
func NewGenesisState ¶
func NewGenesisState() GenesisState
NewGenesisState creates a new GenesisState object
type MsgFileUpload ¶
type MsgFileUpload struct { FileHash []byte `json:"file_hash" yaml:"file_hash"` // hash of file Reporter sdk.AccAddress `json:"reporter" yaml:"reporter"` // sp node who reports this tx Uploader sdk.AccAddress `json:"uploader" yaml:"uploader` // who uploads the file }
func NewMsgUpload ¶
func NewMsgUpload(fileHash []byte, reporter, uploader sdk.AccAddress) MsgFileUpload
NewMsg<Action> creates a new Msg<Action> instance
func (MsgFileUpload) GetSignBytes ¶
func (msg MsgFileUpload) GetSignBytes() []byte
GetSignBytes gets the bytes for the message signer to sign on
func (MsgFileUpload) GetSigners ¶
func (msg MsgFileUpload) GetSigners() []sdk.AccAddress
func (MsgFileUpload) Type ¶
func (msg MsgFileUpload) Type() string
func (MsgFileUpload) ValidateBasic ¶
func (msg MsgFileUpload) ValidateBasic() error
ValidateBasic validity check for the AnteHandler
type MsgPrepay ¶
type MsgPrepay struct { Sender sdk.AccAddress `json:"sender" yaml:"sender"` // sender of tx Coins sdk.Coins `json:"coins" yaml:"coins"` // coins to send }
func NewMsgPrepay ¶
func NewMsgPrepay(sender sdk.AccAddress, coins sdk.Coins) MsgPrepay
NewMsg<Action> creates a new Msg<Action> instance
func (MsgPrepay) GetSignBytes ¶
GetSignBytes gets the bytes for the message signer to sign on
func (MsgPrepay) GetSigners ¶
func (msg MsgPrepay) GetSigners() []sdk.AccAddress
func (MsgPrepay) ValidateBasic ¶
ValidateBasic validity check for the AnteHandler
type ParamSubspace ¶
type ParamSubspace interface { SetUploadFile(ctx sdk.Context, key []byte, value string) GetUploadFile(ctx sdk.Context, key []byte) MsgFileUpload }
ParamSubspace defines the expected Subspace interfacace
type Params ¶
type Params struct { }
Params - used for initializing default parameter for sds at genesis
func DefaultParams ¶
func DefaultParams() Params
DefaultParams defines the parameters for this module
func (*Params) ParamSetPairs ¶
func (p *Params) ParamSetPairs() params.ParamSetPairs
ParamSetPairs - Implements params.ParamSet
type QueryUploadedFileParams ¶
type QueryUploadedFileParams struct {
Sender types.AccAddress `json:"sender" yaml:"sender"`
}
params for query 'custom/distr/validator_outstanding_rewards'
func NewQueryUploadedFileParams ¶
func NewQueryUploadedFileParams(sender types.AccAddress) QueryUploadedFileParams
creates a new instance of QueryValidatorSlashesParams