Documentation ¶
Overview ¶
Package types is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func KeyPrefix(p string) []byte
- func ParamKeyTable() paramtypes.KeyTable
- func RegisterCodec(cdc *codec.LegacyAmino)
- func RegisterInterfaces(registry cdctypes.InterfaceRegistry)
- func RegisterMsgServer(s grpc1.Server, srv MsgServer)
- func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error
- func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error
- func RegisterQueryServer(s grpc1.Server, srv QueryServer)
- type AccountKeeper
- type BankKeeper
- type Challenge
- func (*Challenge) Descriptor() ([]byte, []int)
- func (m *Challenge) GetExpiredHeight() uint64
- func (m *Challenge) GetId() uint64
- func (m *Challenge) Marshal() (dAtA []byte, err error)
- func (m *Challenge) MarshalTo(dAtA []byte) (int, error)
- func (m *Challenge) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Challenge) ProtoMessage()
- func (m *Challenge) Reset()
- func (m *Challenge) Size() (n int)
- func (m *Challenge) String() string
- func (m *Challenge) Unmarshal(dAtA []byte) error
- func (m *Challenge) XXX_DiscardUnknown()
- func (m *Challenge) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Challenge) XXX_Merge(src proto.Message)
- func (m *Challenge) XXX_Size() int
- func (m *Challenge) XXX_Unmarshal(b []byte) error
- type EventAttestChallenge
- func (*EventAttestChallenge) Descriptor() ([]byte, []int)
- func (m *EventAttestChallenge) GetChallengeId() uint64
- func (m *EventAttestChallenge) GetChallengerAddress() string
- func (m *EventAttestChallenge) GetChallengerRewardAmount() string
- func (m *EventAttestChallenge) GetResult() VoteResult
- func (m *EventAttestChallenge) GetSlashAmount() string
- func (m *EventAttestChallenge) GetSpOperatorAddress() string
- func (m *EventAttestChallenge) GetSubmitterAddress() string
- func (m *EventAttestChallenge) GetSubmitterRewardAmount() string
- func (m *EventAttestChallenge) GetValidatorRewardAmount() string
- func (m *EventAttestChallenge) Marshal() (dAtA []byte, err error)
- func (m *EventAttestChallenge) MarshalTo(dAtA []byte) (int, error)
- func (m *EventAttestChallenge) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*EventAttestChallenge) ProtoMessage()
- func (m *EventAttestChallenge) Reset()
- func (m *EventAttestChallenge) Size() (n int)
- func (m *EventAttestChallenge) String() string
- func (m *EventAttestChallenge) Unmarshal(dAtA []byte) error
- func (m *EventAttestChallenge) XXX_DiscardUnknown()
- func (m *EventAttestChallenge) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *EventAttestChallenge) XXX_Merge(src proto.Message)
- func (m *EventAttestChallenge) XXX_Size() int
- func (m *EventAttestChallenge) XXX_Unmarshal(b []byte) error
- type EventStartChallenge
- func (*EventStartChallenge) Descriptor() ([]byte, []int)
- func (m *EventStartChallenge) GetChallengeId() uint64
- func (m *EventStartChallenge) GetChallengerAddress() string
- func (m *EventStartChallenge) GetExpiredHeight() uint64
- func (m *EventStartChallenge) GetRedundancyIndex() int32
- func (m *EventStartChallenge) GetSegmentIndex() uint32
- func (m *EventStartChallenge) GetSpOperatorAddress() string
- func (m *EventStartChallenge) Marshal() (dAtA []byte, err error)
- func (m *EventStartChallenge) MarshalTo(dAtA []byte) (int, error)
- func (m *EventStartChallenge) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*EventStartChallenge) ProtoMessage()
- func (m *EventStartChallenge) Reset()
- func (m *EventStartChallenge) Size() (n int)
- func (m *EventStartChallenge) String() string
- func (m *EventStartChallenge) Unmarshal(dAtA []byte) error
- func (m *EventStartChallenge) XXX_DiscardUnknown()
- func (m *EventStartChallenge) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *EventStartChallenge) XXX_Merge(src proto.Message)
- func (m *EventStartChallenge) XXX_Size() int
- func (m *EventStartChallenge) XXX_Unmarshal(b []byte) error
- type GenesisState
- func (*GenesisState) Descriptor() ([]byte, []int)
- func (m *GenesisState) GetParams() Params
- func (m *GenesisState) Marshal() (dAtA []byte, err error)
- func (m *GenesisState) MarshalTo(dAtA []byte) (int, error)
- func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*GenesisState) ProtoMessage()
- func (m *GenesisState) Reset()
- func (m *GenesisState) Size() (n int)
- func (m *GenesisState) String() string
- func (m *GenesisState) Unmarshal(dAtA []byte) error
- func (gs GenesisState) Validate() error
- func (m *GenesisState) XXX_DiscardUnknown()
- func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GenesisState) XXX_Merge(src proto.Message)
- func (m *GenesisState) XXX_Size() int
- func (m *GenesisState) XXX_Unmarshal(b []byte) error
- type Int
- type MsgAttest
- func (*MsgAttest) Descriptor() ([]byte, []int)
- func (msg *MsgAttest) GetBlsSignBytes() [32]byte
- func (m *MsgAttest) GetChallengeId() uint64
- func (m *MsgAttest) GetChallengerAddress() string
- func (msg *MsgAttest) GetSignBytes() []byte
- func (msg *MsgAttest) GetSigners() []sdk.AccAddress
- func (m *MsgAttest) GetSpOperatorAddress() string
- func (m *MsgAttest) GetSubmitter() string
- func (m *MsgAttest) GetVoteAggSignature() []byte
- func (m *MsgAttest) GetVoteResult() VoteResult
- func (m *MsgAttest) GetVoteValidatorSet() []uint64
- func (m *MsgAttest) Marshal() (dAtA []byte, err error)
- func (m *MsgAttest) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgAttest) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgAttest) ProtoMessage()
- func (m *MsgAttest) Reset()
- func (msg *MsgAttest) Route() string
- func (m *MsgAttest) Size() (n int)
- func (m *MsgAttest) String() string
- func (msg *MsgAttest) Type() string
- func (m *MsgAttest) Unmarshal(dAtA []byte) error
- func (msg *MsgAttest) ValidateBasic() error
- func (m *MsgAttest) XXX_DiscardUnknown()
- func (m *MsgAttest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgAttest) XXX_Merge(src proto.Message)
- func (m *MsgAttest) XXX_Size() int
- func (m *MsgAttest) XXX_Unmarshal(b []byte) error
- type MsgAttestResponse
- func (*MsgAttestResponse) Descriptor() ([]byte, []int)
- func (m *MsgAttestResponse) Marshal() (dAtA []byte, err error)
- func (m *MsgAttestResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgAttestResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgAttestResponse) ProtoMessage()
- func (m *MsgAttestResponse) Reset()
- func (m *MsgAttestResponse) Size() (n int)
- func (m *MsgAttestResponse) String() string
- func (m *MsgAttestResponse) Unmarshal(dAtA []byte) error
- func (m *MsgAttestResponse) XXX_DiscardUnknown()
- func (m *MsgAttestResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgAttestResponse) XXX_Merge(src proto.Message)
- func (m *MsgAttestResponse) XXX_Size() int
- func (m *MsgAttestResponse) XXX_Unmarshal(b []byte) error
- type MsgClient
- type MsgServer
- type MsgSubmit
- func (*MsgSubmit) Descriptor() ([]byte, []int)
- func (m *MsgSubmit) GetBucketName() string
- func (m *MsgSubmit) GetChallenger() string
- func (m *MsgSubmit) GetObjectName() string
- func (m *MsgSubmit) GetRandomIndex() bool
- func (m *MsgSubmit) GetSegmentIndex() uint32
- func (msg *MsgSubmit) GetSignBytes() []byte
- func (msg *MsgSubmit) GetSigners() []sdk.AccAddress
- func (m *MsgSubmit) GetSpOperatorAddress() string
- func (m *MsgSubmit) Marshal() (dAtA []byte, err error)
- func (m *MsgSubmit) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgSubmit) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgSubmit) ProtoMessage()
- func (m *MsgSubmit) Reset()
- func (msg *MsgSubmit) Route() string
- func (m *MsgSubmit) Size() (n int)
- func (m *MsgSubmit) String() string
- func (msg *MsgSubmit) Type() string
- func (m *MsgSubmit) Unmarshal(dAtA []byte) error
- func (msg *MsgSubmit) ValidateBasic() error
- func (m *MsgSubmit) XXX_DiscardUnknown()
- func (m *MsgSubmit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgSubmit) XXX_Merge(src proto.Message)
- func (m *MsgSubmit) XXX_Size() int
- func (m *MsgSubmit) XXX_Unmarshal(b []byte) error
- type MsgSubmitResponse
- func (*MsgSubmitResponse) Descriptor() ([]byte, []int)
- func (m *MsgSubmitResponse) Marshal() (dAtA []byte, err error)
- func (m *MsgSubmitResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgSubmitResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgSubmitResponse) ProtoMessage()
- func (m *MsgSubmitResponse) Reset()
- func (m *MsgSubmitResponse) Size() (n int)
- func (m *MsgSubmitResponse) String() string
- func (m *MsgSubmitResponse) Unmarshal(dAtA []byte) error
- func (m *MsgSubmitResponse) XXX_DiscardUnknown()
- func (m *MsgSubmitResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgSubmitResponse) XXX_Merge(src proto.Message)
- func (m *MsgSubmitResponse) XXX_Size() int
- func (m *MsgSubmitResponse) XXX_Unmarshal(b []byte) error
- type Params
- func (*Params) Descriptor() ([]byte, []int)
- func (m *Params) GetChallengeCountPerBlock() uint64
- func (m *Params) GetChallengeKeepAlivePeriod() uint64
- func (m *Params) GetHeartbeatInterval() uint64
- func (m *Params) GetSlashCoolingOffPeriod() uint64
- func (m *Params) Marshal() (dAtA []byte, err error)
- func (m *Params) MarshalTo(dAtA []byte) (int, error)
- func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs
- func (*Params) ProtoMessage()
- func (m *Params) Reset()
- func (m *Params) Size() (n int)
- func (p Params) String() string
- func (m *Params) Unmarshal(dAtA []byte) error
- func (p Params) Validate() error
- func (m *Params) XXX_DiscardUnknown()
- func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Params) XXX_Merge(src proto.Message)
- func (m *Params) XXX_Size() int
- func (m *Params) XXX_Unmarshal(b []byte) error
- type PaymentKeeper
- type QueryClient
- type QueryLatestAttestedChallengeRequest
- func (*QueryLatestAttestedChallengeRequest) Descriptor() ([]byte, []int)
- func (m *QueryLatestAttestedChallengeRequest) Marshal() (dAtA []byte, err error)
- func (m *QueryLatestAttestedChallengeRequest) MarshalTo(dAtA []byte) (int, error)
- func (m *QueryLatestAttestedChallengeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*QueryLatestAttestedChallengeRequest) ProtoMessage()
- func (m *QueryLatestAttestedChallengeRequest) Reset()
- func (m *QueryLatestAttestedChallengeRequest) Size() (n int)
- func (m *QueryLatestAttestedChallengeRequest) String() string
- func (m *QueryLatestAttestedChallengeRequest) Unmarshal(dAtA []byte) error
- func (m *QueryLatestAttestedChallengeRequest) XXX_DiscardUnknown()
- func (m *QueryLatestAttestedChallengeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueryLatestAttestedChallengeRequest) XXX_Merge(src proto.Message)
- func (m *QueryLatestAttestedChallengeRequest) XXX_Size() int
- func (m *QueryLatestAttestedChallengeRequest) XXX_Unmarshal(b []byte) error
- type QueryLatestAttestedChallengeResponse
- func (*QueryLatestAttestedChallengeResponse) Descriptor() ([]byte, []int)
- func (m *QueryLatestAttestedChallengeResponse) GetChallengeId() uint64
- func (m *QueryLatestAttestedChallengeResponse) Marshal() (dAtA []byte, err error)
- func (m *QueryLatestAttestedChallengeResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *QueryLatestAttestedChallengeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*QueryLatestAttestedChallengeResponse) ProtoMessage()
- func (m *QueryLatestAttestedChallengeResponse) Reset()
- func (m *QueryLatestAttestedChallengeResponse) Size() (n int)
- func (m *QueryLatestAttestedChallengeResponse) String() string
- func (m *QueryLatestAttestedChallengeResponse) Unmarshal(dAtA []byte) error
- func (m *QueryLatestAttestedChallengeResponse) XXX_DiscardUnknown()
- func (m *QueryLatestAttestedChallengeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueryLatestAttestedChallengeResponse) XXX_Merge(src proto.Message)
- func (m *QueryLatestAttestedChallengeResponse) XXX_Size() int
- func (m *QueryLatestAttestedChallengeResponse) XXX_Unmarshal(b []byte) error
- type QueryParamsRequest
- func (*QueryParamsRequest) Descriptor() ([]byte, []int)
- func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error)
- func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error)
- func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*QueryParamsRequest) ProtoMessage()
- func (m *QueryParamsRequest) Reset()
- func (m *QueryParamsRequest) Size() (n int)
- func (m *QueryParamsRequest) String() string
- func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error
- func (m *QueryParamsRequest) XXX_DiscardUnknown()
- func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueryParamsRequest) XXX_Merge(src proto.Message)
- func (m *QueryParamsRequest) XXX_Size() int
- func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error
- type QueryParamsResponse
- func (*QueryParamsResponse) Descriptor() ([]byte, []int)
- func (m *QueryParamsResponse) GetParams() Params
- func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error)
- func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*QueryParamsResponse) ProtoMessage()
- func (m *QueryParamsResponse) Reset()
- func (m *QueryParamsResponse) Size() (n int)
- func (m *QueryParamsResponse) String() string
- func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error
- func (m *QueryParamsResponse) XXX_DiscardUnknown()
- func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueryParamsResponse) XXX_Merge(src proto.Message)
- func (m *QueryParamsResponse) XXX_Size() int
- func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error
- type QueryServer
- type Slash
- func (*Slash) Descriptor() ([]byte, []int)
- func (m *Slash) GetHeight() uint64
- func (m *Slash) GetSpOperatorAddress() []byte
- func (m *Slash) Marshal() (dAtA []byte, err error)
- func (m *Slash) MarshalTo(dAtA []byte) (int, error)
- func (m *Slash) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Slash) ProtoMessage()
- func (m *Slash) Reset()
- func (m *Slash) Size() (n int)
- func (m *Slash) String() string
- func (m *Slash) Unmarshal(dAtA []byte) error
- func (m *Slash) XXX_DiscardUnknown()
- func (m *Slash) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Slash) XXX_Merge(src proto.Message)
- func (m *Slash) XXX_Size() int
- func (m *Slash) XXX_Unmarshal(b []byte) error
- type SpKeeper
- type StakingKeeper
- type StorageKeeper
- type Uint
- type UnimplementedMsgServer
- type UnimplementedQueryServer
- type VoteResult
Constants ¶
const ( // ModuleName defines the module name ModuleName = "challenge" // StoreKey defines the primary module store key StoreKey = ModuleName // RouterKey defines the module's message routing key RouterKey = ModuleName // MemStoreKey defines the in-memory store key MemStoreKey = "mem_challenge" // TStoreKey defines transient store key TStoreKey = "transient_challenge" )
const BlsSignatureLength = 96
BlsSignatureLength defines the length of bls signature
const DefaultIndex uint64 = 1
DefaultIndex is the default global index
const RedundancyIndexPrimary = int32(-1)
RedundancyIndexPrimary defines the redundancy index for primary storage provider (asked by storage provider api)
const TypeMsgAttest = "attest"
const TypeMsgSubmit = "submit"
Variables ¶
var ( Amino = codec.NewLegacyAmino() ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) )
var ( ErrUnknownSp = errors.Register(ModuleName, 1, "unknown storage provider") ErrUnknownObject = errors.Register(ModuleName, 2, "unknown object info") ErrInvalidSpStatus = errors.Register(ModuleName, 3, "invalid storage provider status") ErrInvalidObjectStatus = errors.Register(ModuleName, 4, "invalid object status to challenge") ErrNotStoredOnSp = errors.Register(ModuleName, 5, "the object is not stored on the storage provider") ErrExistsRecentSlash = errors.Register(ModuleName, 6, "the storage provider and object info had been slashed recently") ErrInvalidSegmentIndex = errors.Register(ModuleName, 7, "the segment/piece index is invalid") ErrInvalidChallengeId = errors.Register(ModuleName, 8, "invalid challenge id") ErrInvalidVoteResult = errors.Register(ModuleName, 9, "invalid vote result") ErrInvalidVoteValidatorSet = errors.Register(ModuleName, 10, "invalid validator set") ErrInvalidVoteAggSignature = errors.Register(ModuleName, 11, "invalid bls signature") ErrDuplicatedSlash = errors.Register(ModuleName, 12, "duplicated slash in cooling-off period") ErrInvalidBlsPubKey = errors.Register(ModuleName, 13, "invalid bls public key") ErrNotEnoughVotes = errors.Register(ModuleName, 14, "attest votes are not enough") )
x/challenge module sentinel errors
var ( ErrInvalidLengthEvents = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowEvents = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupEvents = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") )
var ( // ChallengeIdKey is the key to retrieve the id of challenge. ChallengeIdKey = []byte{0x11} // ChallengeKeyPrefix is the prefix to retrieve Challenge. ChallengeKeyPrefix = []byte{0x12} // AttestChallengeIdKey is the key to record the latest attest challenge id. AttestChallengeIdKey = []byte{0x13} // SlashKeyPrefix is the prefix to retrieve Slash. SlashKeyPrefix = []byte{0x14} // CurrentBlockChallengeCountKey is key to track the count of challenges in the current block. // The data is stored in transient store. CurrentBlockChallengeCountKey = []byte{0x15} )
var ( KeyChallengeCountPerBlock = []byte("ChallengeCountPerBlock") DefaultChallengeCountPerBlock uint64 = 1 )
var ( KeyChallengeKeepAlivePeriod = []byte("ChallengeKeepAlivePeriod") DefaultChallengeKeepAlivePeriod uint64 = 300 )
var ( KeySlashCoolingOffPeriod = []byte("SlashCoolingOffPeriod") DefaultSlashCoolingOffPeriod uint64 = 300 )
var ( KeySlashAmountSizeRate = []byte("SlashAmountSizeRate") DefaultSlashAmountSizeRate = sdk.NewDecWithPrec(85, 4) )
var ( KeySlashAmountMin = []byte("SlashAmountMin") DefaultSlashAmountMin = math.NewIntFromBigInt(big.NewInt(1e16)) )
var ( KeySlashAmountMax = []byte("SlashAmountMax") DefaultSlashAmountMax = math.NewIntFromBigInt(big.NewInt(1e18)) )
var ( KeyRewardValidatorRatio = []byte("RewardValidatorRatio") DefaultRewardValidatorRatio = sdk.NewDecWithPrec(9, 1) )
var ( KeyRewardSubmitterRatio = []byte("RewardSubmitterRatio") DefaultRewardSubmitterRatio = sdk.NewDecWithPrec(1, 3) )
var ( KeyRewardSubmitterThreshold = []byte("RewardSubmitterThreshold") DefaultRewardSubmitterThreshold = math.NewIntFromBigInt(big.NewInt(1e15)) )
var ( KeyHeartbeatInterval = []byte("HeartbeatInterval") DefaultHeartbeatInterval uint64 = 1000 )
var ( ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") )
var VoteResult_name = map[int32]string{
0: "CHALLENGE_FAILED",
1: "CHALLENGE_SUCCEED",
}
var VoteResult_value = map[string]int32{
"CHALLENGE_FAILED": 0,
"CHALLENGE_SUCCEED": 1,
}
Functions ¶
func ParamKeyTable ¶
func ParamKeyTable() paramtypes.KeyTable
ParamKeyTable the param key table for launch module
func RegisterCodec ¶
func RegisterCodec(cdc *codec.LegacyAmino)
func RegisterInterfaces ¶
func RegisterInterfaces(registry cdctypes.InterfaceRegistry)
func RegisterMsgServer ¶
func RegisterQueryHandler ¶
RegisterQueryHandler registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterQueryHandlerClient ¶
func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error
RegisterQueryHandlerClient registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "QueryClient" to call the correct interceptors.
func RegisterQueryHandlerFromEndpoint ¶
func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterQueryHandlerServer ¶
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error
RegisterQueryHandlerServer registers the http handlers for service Query to "mux". UnaryRPC :call QueryServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.
func RegisterQueryServer ¶
func RegisterQueryServer(s grpc1.Server, srv QueryServer)
Types ¶
type AccountKeeper ¶
AccountKeeper defines the expected account keeper used for simulations (noalias)
type BankKeeper ¶
BankKeeper defines the expected interface needed to retrieve account balances.
type Challenge ¶ added in v0.0.10
type Challenge struct { // The id of the challenge. Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // The height at which the challenge will be expired. ExpiredHeight uint64 `protobuf:"varint,2,opt,name=expired_height,json=expiredHeight,proto3" json:"expired_height,omitempty"` }
Challenge records the challenge which are not expired yet.
func (*Challenge) Descriptor ¶ added in v0.0.10
func (*Challenge) GetExpiredHeight ¶ added in v0.0.10
func (*Challenge) MarshalToSizedBuffer ¶ added in v0.0.10
func (*Challenge) ProtoMessage ¶ added in v0.0.10
func (*Challenge) ProtoMessage()
func (*Challenge) XXX_DiscardUnknown ¶ added in v0.0.10
func (m *Challenge) XXX_DiscardUnknown()
func (*Challenge) XXX_Marshal ¶ added in v0.0.10
func (*Challenge) XXX_Unmarshal ¶ added in v0.0.10
type EventAttestChallenge ¶
type EventAttestChallenge struct { // The id of challenge. ChallengeId uint64 `protobuf:"varint,1,opt,name=challenge_id,json=challengeId,proto3" json:"challenge_id,omitempty"` // The result of challenge. Result VoteResult `protobuf:"varint,2,opt,name=result,proto3,enum=bnbchain.greenfield.challenge.VoteResult" json:"result,omitempty"` // The slashed storage provider address. SpOperatorAddress string `protobuf:"bytes,3,opt,name=sp_operator_address,json=spOperatorAddress,proto3" json:"sp_operator_address,omitempty"` // The slashed amount from the storage provider. SlashAmount string `protobuf:"bytes,4,opt,name=slash_amount,json=slashAmount,proto3" json:"slash_amount,omitempty"` // The address of challenger. ChallengerAddress string `protobuf:"bytes,5,opt,name=challenger_address,json=challengerAddress,proto3" json:"challenger_address,omitempty"` // The reward amount to the challenger. ChallengerRewardAmount string `` /* 129-byte string literal not displayed */ // The submitter of the challenge attestation. SubmitterAddress string `protobuf:"bytes,7,opt,name=submitter_address,json=submitterAddress,proto3" json:"submitter_address,omitempty"` // The reward amount to the submitter. SubmitterRewardAmount string `` /* 126-byte string literal not displayed */ // The reward amount to all current validators. ValidatorRewardAmount string `` /* 127-byte string literal not displayed */ }
EventAttestChallenge to indicate a challenge has been attested.
func (*EventAttestChallenge) Descriptor ¶
func (*EventAttestChallenge) Descriptor() ([]byte, []int)
func (*EventAttestChallenge) GetChallengeId ¶
func (m *EventAttestChallenge) GetChallengeId() uint64
func (*EventAttestChallenge) GetChallengerAddress ¶
func (m *EventAttestChallenge) GetChallengerAddress() string
func (*EventAttestChallenge) GetChallengerRewardAmount ¶
func (m *EventAttestChallenge) GetChallengerRewardAmount() string
func (*EventAttestChallenge) GetResult ¶
func (m *EventAttestChallenge) GetResult() VoteResult
func (*EventAttestChallenge) GetSlashAmount ¶
func (m *EventAttestChallenge) GetSlashAmount() string
func (*EventAttestChallenge) GetSpOperatorAddress ¶
func (m *EventAttestChallenge) GetSpOperatorAddress() string
func (*EventAttestChallenge) GetSubmitterAddress ¶
func (m *EventAttestChallenge) GetSubmitterAddress() string
func (*EventAttestChallenge) GetSubmitterRewardAmount ¶
func (m *EventAttestChallenge) GetSubmitterRewardAmount() string
func (*EventAttestChallenge) GetValidatorRewardAmount ¶
func (m *EventAttestChallenge) GetValidatorRewardAmount() string
func (*EventAttestChallenge) Marshal ¶
func (m *EventAttestChallenge) Marshal() (dAtA []byte, err error)
func (*EventAttestChallenge) MarshalTo ¶
func (m *EventAttestChallenge) MarshalTo(dAtA []byte) (int, error)
func (*EventAttestChallenge) MarshalToSizedBuffer ¶
func (m *EventAttestChallenge) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*EventAttestChallenge) ProtoMessage ¶
func (*EventAttestChallenge) ProtoMessage()
func (*EventAttestChallenge) Reset ¶
func (m *EventAttestChallenge) Reset()
func (*EventAttestChallenge) Size ¶
func (m *EventAttestChallenge) Size() (n int)
func (*EventAttestChallenge) String ¶
func (m *EventAttestChallenge) String() string
func (*EventAttestChallenge) Unmarshal ¶
func (m *EventAttestChallenge) Unmarshal(dAtA []byte) error
func (*EventAttestChallenge) XXX_DiscardUnknown ¶
func (m *EventAttestChallenge) XXX_DiscardUnknown()
func (*EventAttestChallenge) XXX_Marshal ¶
func (m *EventAttestChallenge) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*EventAttestChallenge) XXX_Merge ¶
func (m *EventAttestChallenge) XXX_Merge(src proto.Message)
func (*EventAttestChallenge) XXX_Size ¶
func (m *EventAttestChallenge) XXX_Size() int
func (*EventAttestChallenge) XXX_Unmarshal ¶
func (m *EventAttestChallenge) XXX_Unmarshal(b []byte) error
type EventStartChallenge ¶
type EventStartChallenge struct { // The id of challenge, which is generated by blockchain. ChallengeId uint64 `protobuf:"varint,1,opt,name=challenge_id,json=challengeId,proto3" json:"challenge_id,omitempty"` // The id of object info to be challenged. ObjectId Uint `protobuf:"bytes,2,opt,name=object_id,json=objectId,proto3,customtype=Uint" json:"object_id"` // The segment/piece index of the object info. SegmentIndex uint32 `protobuf:"varint,3,opt,name=segment_index,json=segmentIndex,proto3" json:"segment_index,omitempty"` // The storage provider to be challenged. SpOperatorAddress string `protobuf:"bytes,4,opt,name=sp_operator_address,json=spOperatorAddress,proto3" json:"sp_operator_address,omitempty"` // The redundancy index, which comes from the index of storage providers. RedundancyIndex int32 `protobuf:"varint,5,opt,name=redundancy_index,json=redundancyIndex,proto3" json:"redundancy_index,omitempty"` // The challenger who submits the challenge. ChallengerAddress string `protobuf:"bytes,6,opt,name=challenger_address,json=challengerAddress,proto3" json:"challenger_address,omitempty"` // The challenge will be expired after this height ExpiredHeight uint64 `protobuf:"varint,7,opt,name=expired_height,json=expiredHeight,proto3" json:"expired_height,omitempty"` }
EventStartChallenge to indicate a challenge has bee created.
func (*EventStartChallenge) Descriptor ¶
func (*EventStartChallenge) Descriptor() ([]byte, []int)
func (*EventStartChallenge) GetChallengeId ¶
func (m *EventStartChallenge) GetChallengeId() uint64
func (*EventStartChallenge) GetChallengerAddress ¶
func (m *EventStartChallenge) GetChallengerAddress() string
func (*EventStartChallenge) GetExpiredHeight ¶ added in v0.0.10
func (m *EventStartChallenge) GetExpiredHeight() uint64
func (*EventStartChallenge) GetRedundancyIndex ¶
func (m *EventStartChallenge) GetRedundancyIndex() int32
func (*EventStartChallenge) GetSegmentIndex ¶
func (m *EventStartChallenge) GetSegmentIndex() uint32
func (*EventStartChallenge) GetSpOperatorAddress ¶
func (m *EventStartChallenge) GetSpOperatorAddress() string
func (*EventStartChallenge) Marshal ¶
func (m *EventStartChallenge) Marshal() (dAtA []byte, err error)
func (*EventStartChallenge) MarshalTo ¶
func (m *EventStartChallenge) MarshalTo(dAtA []byte) (int, error)
func (*EventStartChallenge) MarshalToSizedBuffer ¶
func (m *EventStartChallenge) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*EventStartChallenge) ProtoMessage ¶
func (*EventStartChallenge) ProtoMessage()
func (*EventStartChallenge) Reset ¶
func (m *EventStartChallenge) Reset()
func (*EventStartChallenge) Size ¶
func (m *EventStartChallenge) Size() (n int)
func (*EventStartChallenge) String ¶
func (m *EventStartChallenge) String() string
func (*EventStartChallenge) Unmarshal ¶
func (m *EventStartChallenge) Unmarshal(dAtA []byte) error
func (*EventStartChallenge) XXX_DiscardUnknown ¶
func (m *EventStartChallenge) XXX_DiscardUnknown()
func (*EventStartChallenge) XXX_Marshal ¶
func (m *EventStartChallenge) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*EventStartChallenge) XXX_Merge ¶
func (m *EventStartChallenge) XXX_Merge(src proto.Message)
func (*EventStartChallenge) XXX_Size ¶
func (m *EventStartChallenge) XXX_Size() int
func (*EventStartChallenge) XXX_Unmarshal ¶
func (m *EventStartChallenge) XXX_Unmarshal(b []byte) error
type GenesisState ¶
type GenesisState struct {
Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
}
GenesisState defines the challenge module's genesis state.
func DefaultGenesis ¶
func DefaultGenesis() *GenesisState
DefaultGenesis returns the default genesis state
func (*GenesisState) Descriptor ¶
func (*GenesisState) Descriptor() ([]byte, []int)
func (*GenesisState) GetParams ¶
func (m *GenesisState) GetParams() Params
func (*GenesisState) Marshal ¶
func (m *GenesisState) Marshal() (dAtA []byte, err error)
func (*GenesisState) MarshalToSizedBuffer ¶
func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*GenesisState) ProtoMessage ¶
func (*GenesisState) ProtoMessage()
func (*GenesisState) Reset ¶
func (m *GenesisState) Reset()
func (*GenesisState) Size ¶
func (m *GenesisState) Size() (n int)
func (*GenesisState) String ¶
func (m *GenesisState) String() string
func (*GenesisState) Unmarshal ¶
func (m *GenesisState) Unmarshal(dAtA []byte) error
func (GenesisState) Validate ¶
func (gs GenesisState) Validate() error
Validate performs basic genesis state validation returning an error upon any failure.
func (*GenesisState) XXX_DiscardUnknown ¶
func (m *GenesisState) XXX_DiscardUnknown()
func (*GenesisState) XXX_Marshal ¶
func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GenesisState) XXX_Merge ¶
func (m *GenesisState) XXX_Merge(src proto.Message)
func (*GenesisState) XXX_Size ¶
func (m *GenesisState) XXX_Size() int
func (*GenesisState) XXX_Unmarshal ¶
func (m *GenesisState) XXX_Unmarshal(b []byte) error
type MsgAttest ¶
type MsgAttest struct { // The submitter address. Submitter string `protobuf:"bytes,1,opt,name=submitter,proto3" json:"submitter,omitempty"` // The id of the challenge. ChallengeId uint64 `protobuf:"varint,2,opt,name=challenge_id,json=challengeId,proto3" json:"challenge_id,omitempty"` // The id of the object info. ObjectId Uint `protobuf:"bytes,3,opt,name=object_id,json=objectId,proto3,customtype=Uint" json:"object_id"` // The storage provider to be challenged. SpOperatorAddress string `protobuf:"bytes,4,opt,name=sp_operator_address,json=spOperatorAddress,proto3" json:"sp_operator_address,omitempty"` // Vote result of the attestation. VoteResult VoteResult `` /* 138-byte string literal not displayed */ // The challenger who submits the challenge, which can be empty. ChallengerAddress string `protobuf:"bytes,6,opt,name=challenger_address,json=challengerAddress,proto3" json:"challenger_address,omitempty"` // The validators participated in the attestation. VoteValidatorSet []uint64 `protobuf:"fixed64,7,rep,packed,name=vote_validator_set,json=voteValidatorSet,proto3" json:"vote_validator_set,omitempty"` // The aggregated BLS signature from the validators. VoteAggSignature []byte `protobuf:"bytes,8,opt,name=vote_agg_signature,json=voteAggSignature,proto3" json:"vote_agg_signature,omitempty"` }
MsgSubmit defines the message for attesting challenges.
func NewMsgAttest ¶
func NewMsgAttest(submitter sdk.AccAddress, challengeId uint64, objectId Uint, spOperatorAddress string, voteResult VoteResult, challenger string, voteValidatorSet []uint64, voteAggSignature []byte) *MsgAttest
func (*MsgAttest) Descriptor ¶
func (*MsgAttest) GetBlsSignBytes ¶
func (*MsgAttest) GetChallengeId ¶
func (*MsgAttest) GetChallengerAddress ¶
func (*MsgAttest) GetSignBytes ¶
func (*MsgAttest) GetSigners ¶
func (msg *MsgAttest) GetSigners() []sdk.AccAddress
func (*MsgAttest) GetSpOperatorAddress ¶
func (*MsgAttest) GetSubmitter ¶
func (*MsgAttest) GetVoteAggSignature ¶
func (*MsgAttest) GetVoteResult ¶
func (m *MsgAttest) GetVoteResult() VoteResult
func (*MsgAttest) GetVoteValidatorSet ¶
func (*MsgAttest) MarshalToSizedBuffer ¶
func (*MsgAttest) ProtoMessage ¶
func (*MsgAttest) ProtoMessage()
func (*MsgAttest) ValidateBasic ¶
func (*MsgAttest) XXX_DiscardUnknown ¶
func (m *MsgAttest) XXX_DiscardUnknown()
func (*MsgAttest) XXX_Marshal ¶
func (*MsgAttest) XXX_Unmarshal ¶
type MsgAttestResponse ¶
type MsgAttestResponse struct { }
MsgAttest defines the response of MsgAttestResponse.
func (*MsgAttestResponse) Descriptor ¶
func (*MsgAttestResponse) Descriptor() ([]byte, []int)
func (*MsgAttestResponse) Marshal ¶
func (m *MsgAttestResponse) Marshal() (dAtA []byte, err error)
func (*MsgAttestResponse) MarshalTo ¶
func (m *MsgAttestResponse) MarshalTo(dAtA []byte) (int, error)
func (*MsgAttestResponse) MarshalToSizedBuffer ¶
func (m *MsgAttestResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgAttestResponse) ProtoMessage ¶
func (*MsgAttestResponse) ProtoMessage()
func (*MsgAttestResponse) Reset ¶
func (m *MsgAttestResponse) Reset()
func (*MsgAttestResponse) Size ¶
func (m *MsgAttestResponse) Size() (n int)
func (*MsgAttestResponse) String ¶
func (m *MsgAttestResponse) String() string
func (*MsgAttestResponse) Unmarshal ¶
func (m *MsgAttestResponse) Unmarshal(dAtA []byte) error
func (*MsgAttestResponse) XXX_DiscardUnknown ¶
func (m *MsgAttestResponse) XXX_DiscardUnknown()
func (*MsgAttestResponse) XXX_Marshal ¶
func (m *MsgAttestResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgAttestResponse) XXX_Merge ¶
func (m *MsgAttestResponse) XXX_Merge(src proto.Message)
func (*MsgAttestResponse) XXX_Size ¶
func (m *MsgAttestResponse) XXX_Size() int
func (*MsgAttestResponse) XXX_Unmarshal ¶
func (m *MsgAttestResponse) XXX_Unmarshal(b []byte) error
type MsgClient ¶
type MsgClient interface { Submit(ctx context.Context, in *MsgSubmit, opts ...grpc.CallOption) (*MsgSubmitResponse, error) Attest(ctx context.Context, in *MsgAttest, opts ...grpc.CallOption) (*MsgAttestResponse, error) }
MsgClient is the client API for Msg service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewMsgClient ¶
func NewMsgClient(cc grpc1.ClientConn) MsgClient
type MsgServer ¶
type MsgServer interface { Submit(context.Context, *MsgSubmit) (*MsgSubmitResponse, error) Attest(context.Context, *MsgAttest) (*MsgAttestResponse, error) }
MsgServer is the server API for Msg service.
type MsgSubmit ¶
type MsgSubmit struct { // The challenger address. Challenger string `protobuf:"bytes,1,opt,name=challenger,proto3" json:"challenger,omitempty"` // The storage provider to be challenged. SpOperatorAddress string `protobuf:"bytes,2,opt,name=sp_operator_address,json=spOperatorAddress,proto3" json:"sp_operator_address,omitempty"` // The bucket of the object info to be challenged. BucketName string `protobuf:"bytes,3,opt,name=bucket_name,json=bucketName,proto3" json:"bucket_name,omitempty"` // The name of the object info to be challenged. ObjectName string `protobuf:"bytes,4,opt,name=object_name,json=objectName,proto3" json:"object_name,omitempty"` // The index of segment/piece to challenge, start from zero. SegmentIndex uint32 `protobuf:"varint,5,opt,name=segment_index,json=segmentIndex,proto3" json:"segment_index,omitempty"` // Randomly pick a segment/piece to challenge or not. RandomIndex bool `protobuf:"varint,6,opt,name=random_index,json=randomIndex,proto3" json:"random_index,omitempty"` }
MsgSubmit defines the message for submitting challenges.
func NewMsgSubmit ¶
func NewMsgSubmit(challenger sdk.AccAddress, spOperatorAddress sdk.AccAddress, bucketName, objectName string, randomIndex bool, segmentIndex uint32) *MsgSubmit
func (*MsgSubmit) Descriptor ¶
func (*MsgSubmit) GetBucketName ¶
func (*MsgSubmit) GetChallenger ¶
func (*MsgSubmit) GetObjectName ¶
func (*MsgSubmit) GetRandomIndex ¶
func (*MsgSubmit) GetSegmentIndex ¶
func (*MsgSubmit) GetSignBytes ¶
func (*MsgSubmit) GetSigners ¶
func (msg *MsgSubmit) GetSigners() []sdk.AccAddress
func (*MsgSubmit) GetSpOperatorAddress ¶
func (*MsgSubmit) MarshalToSizedBuffer ¶
func (*MsgSubmit) ProtoMessage ¶
func (*MsgSubmit) ProtoMessage()
func (*MsgSubmit) ValidateBasic ¶
func (*MsgSubmit) XXX_DiscardUnknown ¶
func (m *MsgSubmit) XXX_DiscardUnknown()
func (*MsgSubmit) XXX_Marshal ¶
func (*MsgSubmit) XXX_Unmarshal ¶
type MsgSubmitResponse ¶
type MsgSubmitResponse struct { }
MsgSubmitResponse defines the response of MsgSubmit.
func (*MsgSubmitResponse) Descriptor ¶
func (*MsgSubmitResponse) Descriptor() ([]byte, []int)
func (*MsgSubmitResponse) Marshal ¶
func (m *MsgSubmitResponse) Marshal() (dAtA []byte, err error)
func (*MsgSubmitResponse) MarshalTo ¶
func (m *MsgSubmitResponse) MarshalTo(dAtA []byte) (int, error)
func (*MsgSubmitResponse) MarshalToSizedBuffer ¶
func (m *MsgSubmitResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgSubmitResponse) ProtoMessage ¶
func (*MsgSubmitResponse) ProtoMessage()
func (*MsgSubmitResponse) Reset ¶
func (m *MsgSubmitResponse) Reset()
func (*MsgSubmitResponse) Size ¶
func (m *MsgSubmitResponse) Size() (n int)
func (*MsgSubmitResponse) String ¶
func (m *MsgSubmitResponse) String() string
func (*MsgSubmitResponse) Unmarshal ¶
func (m *MsgSubmitResponse) Unmarshal(dAtA []byte) error
func (*MsgSubmitResponse) XXX_DiscardUnknown ¶
func (m *MsgSubmitResponse) XXX_DiscardUnknown()
func (*MsgSubmitResponse) XXX_Marshal ¶
func (m *MsgSubmitResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgSubmitResponse) XXX_Merge ¶
func (m *MsgSubmitResponse) XXX_Merge(src proto.Message)
func (*MsgSubmitResponse) XXX_Size ¶
func (m *MsgSubmitResponse) XXX_Size() int
func (*MsgSubmitResponse) XXX_Unmarshal ¶
func (m *MsgSubmitResponse) XXX_Unmarshal(b []byte) error
type Params ¶
type Params struct { // Challenges which will be emitted in each block, including user submitted or randomly triggered. ChallengeCountPerBlock uint64 `` /* 165-byte string literal not displayed */ // Challenges will be expired after the period, including user submitted or randomly triggered. ChallengeKeepAlivePeriod uint64 `` /* 173-byte string literal not displayed */ // The count of blocks to stand for the period in which the same storage and object info cannot be slashed again. SlashCoolingOffPeriod uint64 `` /* 161-byte string literal not displayed */ // The slash coin amount will be calculated from the size of object info, and adjusted by this rate. SlashAmountSizeRate github_com_cosmos_cosmos_sdk_types.Dec `` /* 192-byte string literal not displayed */ // The minimal slash amount. SlashAmountMin github_com_cosmos_cosmos_sdk_types.Int `` /* 145-byte string literal not displayed */ // The maximum slash amount. SlashAmountMax github_com_cosmos_cosmos_sdk_types.Int `` /* 145-byte string literal not displayed */ // The ratio of slash amount to reward all current validators. RewardValidatorRatio github_com_cosmos_cosmos_sdk_types.Dec `` /* 193-byte string literal not displayed */ // The ratio of reward amount to reward attestation submitter. RewardSubmitterRatio github_com_cosmos_cosmos_sdk_types.Dec `` /* 194-byte string literal not displayed */ // The reward amount to submitter will be adjusted by the threshold. RewardSubmitterThreshold github_com_cosmos_cosmos_sdk_types.Int `` /* 175-byte string literal not displayed */ // Heartbeat interval, based on challenge id, defines the frequency of heartbeat attestation. HeartbeatInterval uint64 `` /* 140-byte string literal not displayed */ }
Params defines the parameters for the module.
func NewParams ¶
func NewParams( challengeCountPerBlock uint64, challengeKeepAlivePeriod uint64, slashCoolingOffPeriod uint64, slashAmountSizeRate sdk.Dec, slashAmountMin math.Int, slashAmountMax math.Int, rewardValidatorRatio sdk.Dec, rewardSubmitterRatio sdk.Dec, rewardSubmitterThreshold math.Int, heartbeatInterval uint64, ) Params
NewParams creates a new Params instance
func (*Params) Descriptor ¶
func (*Params) GetChallengeCountPerBlock ¶
func (*Params) GetChallengeKeepAlivePeriod ¶ added in v0.0.10
func (*Params) GetHeartbeatInterval ¶
func (*Params) GetSlashCoolingOffPeriod ¶
func (*Params) MarshalToSizedBuffer ¶
func (*Params) ParamSetPairs ¶
func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs
ParamSetPairs get the params.ParamSet
func (*Params) ProtoMessage ¶
func (*Params) ProtoMessage()
func (*Params) XXX_DiscardUnknown ¶
func (m *Params) XXX_DiscardUnknown()
func (*Params) XXX_Marshal ¶
func (*Params) XXX_Unmarshal ¶
type PaymentKeeper ¶
type QueryClient ¶
type QueryClient interface { // Parameters queries the parameters of the module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) // Queries the latest attested challenge id. LatestAttestedChallenge(ctx context.Context, in *QueryLatestAttestedChallengeRequest, opts ...grpc.CallOption) (*QueryLatestAttestedChallengeResponse, error) }
QueryClient is the client API for Query service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewQueryClient ¶
func NewQueryClient(cc grpc1.ClientConn) QueryClient
type QueryLatestAttestedChallengeRequest ¶
type QueryLatestAttestedChallengeRequest struct { }
QueryParamsRequest is request type for the Query/LatestAttestedChallenge RPC method.
func (*QueryLatestAttestedChallengeRequest) Descriptor ¶
func (*QueryLatestAttestedChallengeRequest) Descriptor() ([]byte, []int)
func (*QueryLatestAttestedChallengeRequest) Marshal ¶
func (m *QueryLatestAttestedChallengeRequest) Marshal() (dAtA []byte, err error)
func (*QueryLatestAttestedChallengeRequest) MarshalTo ¶
func (m *QueryLatestAttestedChallengeRequest) MarshalTo(dAtA []byte) (int, error)
func (*QueryLatestAttestedChallengeRequest) MarshalToSizedBuffer ¶
func (m *QueryLatestAttestedChallengeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*QueryLatestAttestedChallengeRequest) ProtoMessage ¶
func (*QueryLatestAttestedChallengeRequest) ProtoMessage()
func (*QueryLatestAttestedChallengeRequest) Reset ¶
func (m *QueryLatestAttestedChallengeRequest) Reset()
func (*QueryLatestAttestedChallengeRequest) Size ¶
func (m *QueryLatestAttestedChallengeRequest) Size() (n int)
func (*QueryLatestAttestedChallengeRequest) String ¶
func (m *QueryLatestAttestedChallengeRequest) String() string
func (*QueryLatestAttestedChallengeRequest) Unmarshal ¶
func (m *QueryLatestAttestedChallengeRequest) Unmarshal(dAtA []byte) error
func (*QueryLatestAttestedChallengeRequest) XXX_DiscardUnknown ¶
func (m *QueryLatestAttestedChallengeRequest) XXX_DiscardUnknown()
func (*QueryLatestAttestedChallengeRequest) XXX_Marshal ¶
func (m *QueryLatestAttestedChallengeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QueryLatestAttestedChallengeRequest) XXX_Merge ¶
func (m *QueryLatestAttestedChallengeRequest) XXX_Merge(src proto.Message)
func (*QueryLatestAttestedChallengeRequest) XXX_Size ¶
func (m *QueryLatestAttestedChallengeRequest) XXX_Size() int
func (*QueryLatestAttestedChallengeRequest) XXX_Unmarshal ¶
func (m *QueryLatestAttestedChallengeRequest) XXX_Unmarshal(b []byte) error
type QueryLatestAttestedChallengeResponse ¶
type QueryLatestAttestedChallengeResponse struct {
ChallengeId uint64 `protobuf:"varint,1,opt,name=challengeId,proto3" json:"challengeId,omitempty"`
}
QueryParamsResponse is response type for the Query/LatestAttestedChallenge RPC method.
func (*QueryLatestAttestedChallengeResponse) Descriptor ¶
func (*QueryLatestAttestedChallengeResponse) Descriptor() ([]byte, []int)
func (*QueryLatestAttestedChallengeResponse) GetChallengeId ¶
func (m *QueryLatestAttestedChallengeResponse) GetChallengeId() uint64
func (*QueryLatestAttestedChallengeResponse) Marshal ¶
func (m *QueryLatestAttestedChallengeResponse) Marshal() (dAtA []byte, err error)
func (*QueryLatestAttestedChallengeResponse) MarshalTo ¶
func (m *QueryLatestAttestedChallengeResponse) MarshalTo(dAtA []byte) (int, error)
func (*QueryLatestAttestedChallengeResponse) MarshalToSizedBuffer ¶
func (m *QueryLatestAttestedChallengeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*QueryLatestAttestedChallengeResponse) ProtoMessage ¶
func (*QueryLatestAttestedChallengeResponse) ProtoMessage()
func (*QueryLatestAttestedChallengeResponse) Reset ¶
func (m *QueryLatestAttestedChallengeResponse) Reset()
func (*QueryLatestAttestedChallengeResponse) Size ¶
func (m *QueryLatestAttestedChallengeResponse) Size() (n int)
func (*QueryLatestAttestedChallengeResponse) String ¶
func (m *QueryLatestAttestedChallengeResponse) String() string
func (*QueryLatestAttestedChallengeResponse) Unmarshal ¶
func (m *QueryLatestAttestedChallengeResponse) Unmarshal(dAtA []byte) error
func (*QueryLatestAttestedChallengeResponse) XXX_DiscardUnknown ¶
func (m *QueryLatestAttestedChallengeResponse) XXX_DiscardUnknown()
func (*QueryLatestAttestedChallengeResponse) XXX_Marshal ¶
func (m *QueryLatestAttestedChallengeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QueryLatestAttestedChallengeResponse) XXX_Merge ¶
func (m *QueryLatestAttestedChallengeResponse) XXX_Merge(src proto.Message)
func (*QueryLatestAttestedChallengeResponse) XXX_Size ¶
func (m *QueryLatestAttestedChallengeResponse) XXX_Size() int
func (*QueryLatestAttestedChallengeResponse) XXX_Unmarshal ¶
func (m *QueryLatestAttestedChallengeResponse) XXX_Unmarshal(b []byte) error
type QueryParamsRequest ¶
type QueryParamsRequest struct { }
QueryParamsRequest is request type for the Query/Params RPC method.
func (*QueryParamsRequest) Descriptor ¶
func (*QueryParamsRequest) Descriptor() ([]byte, []int)
func (*QueryParamsRequest) Marshal ¶
func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error)
func (*QueryParamsRequest) MarshalTo ¶
func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error)
func (*QueryParamsRequest) MarshalToSizedBuffer ¶
func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*QueryParamsRequest) ProtoMessage ¶
func (*QueryParamsRequest) ProtoMessage()
func (*QueryParamsRequest) Reset ¶
func (m *QueryParamsRequest) Reset()
func (*QueryParamsRequest) Size ¶
func (m *QueryParamsRequest) Size() (n int)
func (*QueryParamsRequest) String ¶
func (m *QueryParamsRequest) String() string
func (*QueryParamsRequest) Unmarshal ¶
func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error
func (*QueryParamsRequest) XXX_DiscardUnknown ¶
func (m *QueryParamsRequest) XXX_DiscardUnknown()
func (*QueryParamsRequest) XXX_Marshal ¶
func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QueryParamsRequest) XXX_Merge ¶
func (m *QueryParamsRequest) XXX_Merge(src proto.Message)
func (*QueryParamsRequest) XXX_Size ¶
func (m *QueryParamsRequest) XXX_Size() int
func (*QueryParamsRequest) XXX_Unmarshal ¶
func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error
type QueryParamsResponse ¶
type QueryParamsResponse struct { // params holds all the parameters of this module. Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` }
QueryParamsResponse is response type for the Query/Params RPC method.
func (*QueryParamsResponse) Descriptor ¶
func (*QueryParamsResponse) Descriptor() ([]byte, []int)
func (*QueryParamsResponse) GetParams ¶
func (m *QueryParamsResponse) GetParams() Params
func (*QueryParamsResponse) Marshal ¶
func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error)
func (*QueryParamsResponse) MarshalTo ¶
func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error)
func (*QueryParamsResponse) MarshalToSizedBuffer ¶
func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*QueryParamsResponse) ProtoMessage ¶
func (*QueryParamsResponse) ProtoMessage()
func (*QueryParamsResponse) Reset ¶
func (m *QueryParamsResponse) Reset()
func (*QueryParamsResponse) Size ¶
func (m *QueryParamsResponse) Size() (n int)
func (*QueryParamsResponse) String ¶
func (m *QueryParamsResponse) String() string
func (*QueryParamsResponse) Unmarshal ¶
func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error
func (*QueryParamsResponse) XXX_DiscardUnknown ¶
func (m *QueryParamsResponse) XXX_DiscardUnknown()
func (*QueryParamsResponse) XXX_Marshal ¶
func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QueryParamsResponse) XXX_Merge ¶
func (m *QueryParamsResponse) XXX_Merge(src proto.Message)
func (*QueryParamsResponse) XXX_Size ¶
func (m *QueryParamsResponse) XXX_Size() int
func (*QueryParamsResponse) XXX_Unmarshal ¶
func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error
type QueryServer ¶
type QueryServer interface { // Parameters queries the parameters of the module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) // Queries the latest attested challenge id. LatestAttestedChallenge(context.Context, *QueryLatestAttestedChallengeRequest) (*QueryLatestAttestedChallengeResponse, error) }
QueryServer is the server API for Query service.
type Slash ¶
type Slash struct { // The slashed storage provider. SpOperatorAddress []byte `protobuf:"bytes,1,opt,name=sp_operator_address,json=spOperatorAddress,proto3" json:"sp_operator_address,omitempty"` // The slashed object info. ObjectId Uint `protobuf:"bytes,2,opt,name=object_id,json=objectId,proto3,customtype=Uint" json:"object_id"` // The height when the slash happened, which is used for prune purpose. Height uint64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` }
Slash records the storage provider slashes, which will be pruned periodically.
func (*Slash) Descriptor ¶
func (*Slash) GetSpOperatorAddress ¶
func (*Slash) ProtoMessage ¶
func (*Slash) ProtoMessage()
func (*Slash) XXX_DiscardUnknown ¶
func (m *Slash) XXX_DiscardUnknown()
func (*Slash) XXX_Marshal ¶
func (*Slash) XXX_Unmarshal ¶
type SpKeeper ¶
type SpKeeper interface { GetStorageProvider(ctx sdk.Context, addr sdk.AccAddress) (sp *sp.StorageProvider, found bool) DepositDenomForSP(ctx sdk.Context) (res string) Slash(ctx sdk.Context, spAcc sdk.AccAddress, rewardInfos []sp.RewardInfo) error }
type StakingKeeper ¶
type StorageKeeper ¶
type StorageKeeper interface { GetObjectInfo(ctx sdk.Context, bucketName string, objectName string) (*storage.ObjectInfo, bool) GetObjectInfoById(ctx sdk.Context, objectId sdkmath.Uint) (*storage.ObjectInfo, bool) GetObjectInfoCount(ctx sdk.Context) sdkmath.Uint GetBucketInfo(ctx sdk.Context, bucketName string) (*storage.BucketInfo, bool) MaxSegmentSize(ctx sdk.Context) (res uint64) }
type UnimplementedMsgServer ¶
type UnimplementedMsgServer struct { }
UnimplementedMsgServer can be embedded to have forward compatible implementations.
func (*UnimplementedMsgServer) Attest ¶
func (*UnimplementedMsgServer) Attest(ctx context.Context, req *MsgAttest) (*MsgAttestResponse, error)
func (*UnimplementedMsgServer) Submit ¶
func (*UnimplementedMsgServer) Submit(ctx context.Context, req *MsgSubmit) (*MsgSubmitResponse, error)
type UnimplementedQueryServer ¶
type UnimplementedQueryServer struct { }
UnimplementedQueryServer can be embedded to have forward compatible implementations.
func (*UnimplementedQueryServer) LatestAttestedChallenge ¶
func (*UnimplementedQueryServer) LatestAttestedChallenge(ctx context.Context, req *QueryLatestAttestedChallengeRequest) (*QueryLatestAttestedChallengeResponse, error)
func (*UnimplementedQueryServer) Params ¶
func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error)
type VoteResult ¶
type VoteResult int32
VoteResult defines the result attestation for a challenge.
const ( // The challenge failed. CHALLENGE_FAILED VoteResult = 0 // The challenge succeed. CHALLENGE_SUCCEED VoteResult = 1 )
func (VoteResult) EnumDescriptor ¶
func (VoteResult) EnumDescriptor() ([]byte, []int)
func (VoteResult) String ¶
func (x VoteResult) String() string