Documentation ¶
Index ¶
- Constants
- Variables
- func GetRequestKey(channelId []byte, peerFrom string) []byte
- func GetSubscriptionKey(ethAddress string) []byte
- func RegisterCodec(cdc *codec.Codec)
- type MsgGuardProof
- type MsgIntendSettle
- type MsgRequestGuard
- type MsgSubscribe
- type Params
- type QueryRequestParams
- type QuerySubscriptionParams
- type Request
- type Subscription
Constants ¶
const ( // module name ModuleName = "subscribe" // StoreKey to be used when creating the KVStore StoreKey = ModuleName )
const ( QuerySubscription = "subscription" QueryRequest = "request" QueryParameters = "parameters" )
const ( // Default number of guards for guarding request DefaultRequestGuardCount uint64 = 3 )
subscribe params default values
const RouterKey = ModuleName // this was defined in your key.go file
Variables ¶
var ( SubscriptionKeyPrefix = []byte{0x01} // Key prefix for subscription RequestKeyPrefix = []byte{0x21} // Key prefix for request RequestGuardIdKey = []byte{0x22} // Key for request guard id )
var ( KeyRequestGuardCount = []byte("RequestGuardCount") KeyRequestCost = []byte("RequestCost") )
nolint - Keys for parameter access
var ( // Default cost per request DefaultRequestCost = sdk.NewInt(1000000000000000000) )
var ModuleCdc = codec.New()
Functions ¶
func GetRequestKey ¶
get request key from channelID
func GetSubscriptionKey ¶
get guardian key from eth address
func RegisterCodec ¶
RegisterCodec registers concrete types on the Amino codec
Types ¶
type MsgGuardProof ¶
type MsgGuardProof struct { ChannelId []byte `json:"channelId"` PeerFrom string `json:"peerFrom"` TxHash string `json:"txHash"` // intendSettle tx to guard user's state proof Sender sdk.AccAddress `json:"sender"` }
MsgGuardProof defines a Subscribe message
func NewMsgGuardProof ¶
func NewMsgGuardProof(channelId []byte, peerFrom string, txHash string, sender sdk.AccAddress) MsgGuardProof
NewMsgGuardProof is a constructor function for MsgGuardProof
func (MsgGuardProof) GetSignBytes ¶
func (msg MsgGuardProof) GetSignBytes() []byte
GetSignBytes encodes the message for signing
func (MsgGuardProof) GetSigners ¶
func (msg MsgGuardProof) GetSigners() []sdk.AccAddress
GetSigners defines whose signature is required
func (MsgGuardProof) Route ¶
func (msg MsgGuardProof) Route() string
Route should return the name of the module
func (MsgGuardProof) ValidateBasic ¶
func (msg MsgGuardProof) ValidateBasic() sdk.Error
ValidateBasic runs stateless checks on the message
type MsgIntendSettle ¶
type MsgIntendSettle struct { ChannelId []byte `json:"channelId"` PeerFrom string `json:"peerFrom"` TxHash string `json:"txHash"` // intendSettle tx with lower sequence number Sender sdk.AccAddress `json:"sender"` }
MsgIntendSettle defines a Subscribe message
func NewMsgIntendSettle ¶
func NewMsgIntendSettle(channelId []byte, peerFrom string, txHash string, sender sdk.AccAddress) MsgIntendSettle
NewMsgIntendSettle is a constructor function for MsgIntendSettle
func (MsgIntendSettle) GetSignBytes ¶
func (msg MsgIntendSettle) GetSignBytes() []byte
GetSignBytes encodes the message for signing
func (MsgIntendSettle) GetSigners ¶
func (msg MsgIntendSettle) GetSigners() []sdk.AccAddress
GetSigners defines whose signature is required
func (MsgIntendSettle) Route ¶
func (msg MsgIntendSettle) Route() string
Route should return the name of the module
func (MsgIntendSettle) Type ¶
func (msg MsgIntendSettle) Type() string
Type should return the action
func (MsgIntendSettle) ValidateBasic ¶
func (msg MsgIntendSettle) ValidateBasic() sdk.Error
ValidateBasic runs stateless checks on the message
type MsgRequestGuard ¶
type MsgRequestGuard struct { EthAddress string `json:"ethAddress"` SignedSimplexStateBytes []byte `json:"signedSimplexStateBytes"` Sender sdk.AccAddress `json:"sender"` }
func NewMsgRequestGuard ¶
func NewMsgRequestGuard(ethAddress string, signedSimplexStateBytes []byte, sender sdk.AccAddress) MsgRequestGuard
NewMsgRequestGuard is a constructor function for MsgRequestGuard
func (MsgRequestGuard) GetSignBytes ¶
func (msg MsgRequestGuard) GetSignBytes() []byte
GetSignBytes encodes the message for signing
func (MsgRequestGuard) GetSigners ¶
func (msg MsgRequestGuard) GetSigners() []sdk.AccAddress
GetSigners defines whose signature is required
func (MsgRequestGuard) Route ¶
func (msg MsgRequestGuard) Route() string
Route should return the name of the module
func (MsgRequestGuard) Type ¶
func (msg MsgRequestGuard) Type() string
Type should return the action
func (MsgRequestGuard) ValidateBasic ¶
func (msg MsgRequestGuard) ValidateBasic() sdk.Error
ValidateBasic runs stateless checks on the message
type MsgSubscribe ¶
type MsgSubscribe struct { EthAddress string `json:"ethAddress"` Sender sdk.AccAddress `json:"sender"` }
MsgSubscribe defines a Subscribe message
func NewMsgSubscribe ¶
func NewMsgSubscribe(ethAddress string, sender sdk.AccAddress) MsgSubscribe
NewMsgSubscribe is a constructor function for MsgSubscribe
func (MsgSubscribe) GetSignBytes ¶
func (msg MsgSubscribe) GetSignBytes() []byte
GetSignBytes encodes the message for signing
func (MsgSubscribe) GetSigners ¶
func (msg MsgSubscribe) GetSigners() []sdk.AccAddress
GetSigners defines whose signature is required
func (MsgSubscribe) Route ¶
func (msg MsgSubscribe) Route() string
Route should return the name of the module
func (MsgSubscribe) ValidateBasic ¶
func (msg MsgSubscribe) ValidateBasic() sdk.Error
ValidateBasic runs stateless checks on the message
type Params ¶
type Params struct { RequestGuardCount uint64 `json:"requestGuardCount" yaml:"requestGuardCount"` // request guard count RequestCost sdk.Int `json:"requestCost" yaml:"requestCost"` // request limit per epoch }
Params defines the high level settings for subscribe
func MustUnmarshalParams ¶
unmarshal the current subscribe params value from store key or panic
func UnmarshalParams ¶
unmarshal the current subscribe params value from store key
func (*Params) ParamSetPairs ¶
func (p *Params) ParamSetPairs() params.ParamSetPairs
Implements params.ParamSet
type QueryRequestParams ¶
func NewQueryRequestParams ¶
func NewQueryRequestParams(channelId []byte, peerFrom string) QueryRequestParams
type QuerySubscriptionParams ¶
type QuerySubscriptionParams struct {
EthAddress string
}
func NewQuerySubscriptionParams ¶
func NewQuerySubscriptionParams(addr string) QuerySubscriptionParams
type Request ¶
type Request struct { ChannelId []byte `json:"channelId"` SeqNum uint64 `json:"seqNum"` PeerAddresses []string `json:"peerAddresses"` PeerFromIndex uint8 `json:"peerFromIndex"` DisputeTimeout uint64 `json:"disputeTimeout"` RequestGuards []sdk.AccAddress `json:"requestGuards"` SignedSimplexStateBytes []byte `json:"signedSimplexStateBytes"` TriggerTxHash string `json:"triggerTxHash"` GuardTxHash string `json:"guardTxHash"` }
func NewRequest ¶
func (Request) GetPeerAddress ¶
type Subscription ¶
type Subscription struct { EthAddress string `json:"ethAddress"` Deposit sdk.Int `json:"deposit"` Spend sdk.Int `json:"spend"` }
func NewSubscription ¶
func NewSubscription(ethAddress string) Subscription