x/ibc: move solo machine sequence to client state (#7271)
* update proto * move solo machine sequence to client state Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>
This commit is contained in:
co-authored by
Christopher Goes
parent
93dd06ad4c
commit
ec74416276
@@ -106,6 +106,7 @@ func local_request_ReflectionService_ListImplementations_0(ctx context.Context,
|
||||
// RegisterReflectionServiceHandlerServer registers the http handlers for service ReflectionService to "mux".
|
||||
// UnaryRPC :call ReflectionServiceServer 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 (such as grpc.SendHeader, etc) to stop working. Consider using RegisterReflectionServiceHandlerFromEndpoint instead.
|
||||
func RegisterReflectionServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ReflectionServiceServer) error {
|
||||
|
||||
mux.Handle("GET", pattern_ReflectionService_ListAllInterfaces_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
|
||||
@@ -70,6 +70,7 @@ func local_request_SimulateService_Simulate_0(ctx context.Context, marshaler run
|
||||
// RegisterSimulateServiceHandlerServer registers the http handlers for service SimulateService to "mux".
|
||||
// UnaryRPC :call SimulateServiceServer 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 (such as grpc.SendHeader, etc) to stop working. Consider using RegisterSimulateServiceHandlerFromEndpoint instead.
|
||||
func RegisterSimulateServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SimulateServiceServer) error {
|
||||
|
||||
mux.Handle("POST", pattern_SimulateService_Simulate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
|
||||
@@ -13,25 +13,26 @@ import "google/protobuf/any.proto";
|
||||
// state and if the client is frozen.
|
||||
message ClientState {
|
||||
option (gogoproto.goproto_getters) = false;
|
||||
// latest sequence of the client state
|
||||
uint64 sequence = 1;
|
||||
// frozen sequence of the solo machine
|
||||
uint64 frozen_sequence = 1 [(gogoproto.moretags) = "yaml:\"frozen_sequence\""];
|
||||
ConsensusState consensus_state = 2 [(gogoproto.moretags) = "yaml:\"consensus_state\""];
|
||||
uint64 frozen_sequence = 2 [(gogoproto.moretags) = "yaml:\"frozen_sequence\""];
|
||||
ConsensusState consensus_state = 3 [(gogoproto.moretags) = "yaml:\"consensus_state\""];
|
||||
// when set to true, will allow governance to update a solo machine client.
|
||||
// The client will be unfrozen if it is frozen.
|
||||
bool allow_update_after_proposal = 3 [(gogoproto.moretags) = "yaml:\"allow_update_after_proposal\""];
|
||||
bool allow_update_after_proposal = 4 [(gogoproto.moretags) = "yaml:\"allow_update_after_proposal\""];
|
||||
}
|
||||
|
||||
// ConsensusState defines a solo machine consensus state
|
||||
// ConsensusState defines a solo machine consensus state. The sequence of a consensus state
|
||||
// is contained in the "height" key used in storing the consensus state.
|
||||
message ConsensusState {
|
||||
option (gogoproto.goproto_getters) = false;
|
||||
// current sequence of the consensus state
|
||||
uint64 sequence = 1;
|
||||
// public key of the solo machine
|
||||
cosmos.base.crypto.v1beta1.PublicKey public_key = 2 [(gogoproto.moretags) = "yaml:\"public_key\""];
|
||||
cosmos.base.crypto.v1beta1.PublicKey public_key = 1 [(gogoproto.moretags) = "yaml:\"public_key\""];
|
||||
// diversifier allows the same public key to be re-used across different solo machine clients
|
||||
// (potentially on different chains) without being considered misbehaviour.
|
||||
string diversifier = 3;
|
||||
uint64 timestamp = 4;
|
||||
string diversifier = 2;
|
||||
uint64 timestamp = 3;
|
||||
}
|
||||
|
||||
// Header defines a solo machine consensus header
|
||||
@@ -148,4 +149,4 @@ message PacketAcknowledgementAbsenseData {
|
||||
message NextSequenceRecvData {
|
||||
bytes path = 1;
|
||||
uint64 next_seq_recv = 2 [(gogoproto.moretags) = "yaml:\"next_seq_recv\""];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,6 +106,7 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal
|
||||
// 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 (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.
|
||||
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
|
||||
|
||||
mux.Handle("GET", pattern_Query_Account_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
|
||||
@@ -272,6 +272,7 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal
|
||||
// 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 (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.
|
||||
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
|
||||
|
||||
mux.Handle("GET", pattern_Query_Balance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
|
||||
@@ -488,6 +488,7 @@ func local_request_Query_CommunityPool_0(ctx context.Context, marshaler runtime.
|
||||
// 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 (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.
|
||||
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
|
||||
|
||||
mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
|
||||
@@ -124,6 +124,7 @@ func local_request_Query_AllEvidence_0(ctx context.Context, marshaler runtime.Ma
|
||||
// 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 (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.
|
||||
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
|
||||
|
||||
mux.Handle("GET", pattern_Query_Evidence_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
|
||||
@@ -528,6 +528,7 @@ func local_request_Query_TallyResult_0(ctx context.Context, marshaler runtime.Ma
|
||||
// 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 (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.
|
||||
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
|
||||
|
||||
mux.Handle("GET", pattern_Query_Proposal_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
|
||||
@@ -142,6 +142,7 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal
|
||||
// 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 (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.
|
||||
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
|
||||
|
||||
mux.Handle("GET", pattern_Query_DenomTrace_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
|
||||
@@ -312,6 +312,7 @@ func local_request_Query_ConsensusStates_0(ctx context.Context, marshaler runtim
|
||||
// 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 (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.
|
||||
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
|
||||
|
||||
mux.Handle("GET", pattern_Query_ClientState_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
|
||||
@@ -330,6 +330,7 @@ func local_request_Query_ConnectionConsensusState_0(ctx context.Context, marshal
|
||||
// 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 (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.
|
||||
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
|
||||
|
||||
mux.Handle("GET", pattern_Query_Connection_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
|
||||
@@ -900,6 +900,7 @@ func local_request_Query_NextSequenceReceive_0(ctx context.Context, marshaler ru
|
||||
// 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 (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.
|
||||
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
|
||||
|
||||
mux.Handle("GET", pattern_Query_Channel_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
|
||||
@@ -3,6 +3,7 @@ package cli
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"strconv"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
@@ -24,11 +25,11 @@ const (
|
||||
// NewCreateClientCmd defines the command to create a new solo machine client.
|
||||
func NewCreateClientCmd() *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "create [client-id] [path/to/consensus_state.json]",
|
||||
Use: "create [client-id] [sequence] [path/to/consensus_state.json]",
|
||||
Short: "create new solo machine client",
|
||||
Long: "create a new solo machine client with the specified identifier and consensus state",
|
||||
Example: fmt.Sprintf("%s tx ibc %s create [client-id] [path/to/consensus_state.json] --from node0 --home ../node0/<app>cli --chain-id $CID", version.AppName, types.SubModuleName),
|
||||
Args: cobra.ExactArgs(2),
|
||||
Example: fmt.Sprintf("%s tx ibc %s create [client-id] [sequence] [path/to/consensus_state.json] --from node0 --home ../node0/<app>cli --chain-id $CID", version.AppName, types.SubModuleName),
|
||||
Args: cobra.ExactArgs(3),
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
clientCtx := client.GetClientContextFromCmd(cmd)
|
||||
clientCtx, err := client.ReadTxCommandFlags(clientCtx, cmd.Flags())
|
||||
@@ -38,10 +39,15 @@ func NewCreateClientCmd() *cobra.Command {
|
||||
|
||||
clientID := args[0]
|
||||
|
||||
sequence, err := strconv.ParseUint(args[1], 10, 64)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
cdc := codec.NewProtoCodec(clientCtx.InterfaceRegistry)
|
||||
|
||||
var consensusState *types.ConsensusState
|
||||
if err := cdc.UnmarshalJSON([]byte(args[1]), consensusState); err != nil {
|
||||
if err := cdc.UnmarshalJSON([]byte(args[2]), consensusState); err != nil {
|
||||
// check for file path if JSON input is not provided
|
||||
contents, err := ioutil.ReadFile(args[1])
|
||||
if err != nil {
|
||||
@@ -54,7 +60,7 @@ func NewCreateClientCmd() *cobra.Command {
|
||||
|
||||
allowUpdateAfterProposal, _ := cmd.Flags().GetBool(flagAllowUpdateAfterProposal)
|
||||
|
||||
clientState := types.NewClientState(consensusState, allowUpdateAfterProposal)
|
||||
clientState := types.NewClientState(sequence, consensusState, allowUpdateAfterProposal)
|
||||
msg, err := clienttypes.NewMsgCreateClient(clientID, clientState, consensusState, clientCtx.GetFromAddress())
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -15,8 +15,9 @@ import (
|
||||
var _ exported.ClientState = (*ClientState)(nil)
|
||||
|
||||
// NewClientState creates a new ClientState instance.
|
||||
func NewClientState(consensusState *ConsensusState, allowUpdateAfterProposal bool) *ClientState {
|
||||
func NewClientState(latestSequence uint64, consensusState *ConsensusState, allowUpdateAfterProposal bool) *ClientState {
|
||||
return &ClientState{
|
||||
Sequence: latestSequence,
|
||||
FrozenSequence: 0,
|
||||
ConsensusState: consensusState,
|
||||
AllowUpdateAfterProposal: allowUpdateAfterProposal,
|
||||
@@ -29,10 +30,10 @@ func (cs ClientState) ClientType() exported.ClientType {
|
||||
}
|
||||
|
||||
// GetLatestHeight returns the latest sequence number.
|
||||
// Return exported.Height to satisfy interface
|
||||
// Epoch number is always 0 for a solo-machine
|
||||
// Return exported.Height to satisfy ClientState interface
|
||||
// Epoch number is always 0 for a solo-machine.
|
||||
func (cs ClientState) GetLatestHeight() exported.Height {
|
||||
return clienttypes.NewHeight(0, cs.ConsensusState.Sequence)
|
||||
return clienttypes.NewHeight(0, cs.Sequence)
|
||||
}
|
||||
|
||||
// IsFrozen returns true if the client is frozen.
|
||||
@@ -54,6 +55,9 @@ func (cs ClientState) GetProofSpecs() []*ics23.ProofSpec {
|
||||
|
||||
// Validate performs basic validation of the client state fields.
|
||||
func (cs ClientState) Validate() error {
|
||||
if cs.Sequence == 0 {
|
||||
return sdkerrors.Wrap(clienttypes.ErrInvalidClient, "sequence cannot be 0")
|
||||
}
|
||||
if cs.ConsensusState == nil {
|
||||
return sdkerrors.Wrap(clienttypes.ErrInvalidConsensus, "consensus state cannot be nil")
|
||||
}
|
||||
@@ -92,7 +96,7 @@ func (cs ClientState) VerifyClientState(
|
||||
return err
|
||||
}
|
||||
|
||||
cs.ConsensusState.Sequence++
|
||||
cs.Sequence++
|
||||
cs.ConsensusState.Timestamp = signature.Timestamp
|
||||
setClientState(store, cdc, &cs)
|
||||
return nil
|
||||
@@ -131,7 +135,7 @@ func (cs ClientState) VerifyClientConsensusState(
|
||||
return err
|
||||
}
|
||||
|
||||
cs.ConsensusState.Sequence++
|
||||
cs.Sequence++
|
||||
cs.ConsensusState.Timestamp = signature.Timestamp
|
||||
setClientState(store, cdc, &cs)
|
||||
return nil
|
||||
@@ -167,7 +171,7 @@ func (cs ClientState) VerifyConnectionState(
|
||||
return err
|
||||
}
|
||||
|
||||
cs.ConsensusState.Sequence++
|
||||
cs.Sequence++
|
||||
cs.ConsensusState.Timestamp = signature.Timestamp
|
||||
setClientState(store, cdc, &cs)
|
||||
return nil
|
||||
@@ -204,7 +208,7 @@ func (cs ClientState) VerifyChannelState(
|
||||
return err
|
||||
}
|
||||
|
||||
cs.ConsensusState.Sequence++
|
||||
cs.Sequence++
|
||||
cs.ConsensusState.Timestamp = signature.Timestamp
|
||||
setClientState(store, cdc, &cs)
|
||||
return nil
|
||||
@@ -242,7 +246,7 @@ func (cs ClientState) VerifyPacketCommitment(
|
||||
return err
|
||||
}
|
||||
|
||||
cs.ConsensusState.Sequence++
|
||||
cs.Sequence++
|
||||
cs.ConsensusState.Timestamp = signature.Timestamp
|
||||
setClientState(store, cdc, &cs)
|
||||
return nil
|
||||
@@ -280,7 +284,7 @@ func (cs ClientState) VerifyPacketAcknowledgement(
|
||||
return err
|
||||
}
|
||||
|
||||
cs.ConsensusState.Sequence++
|
||||
cs.Sequence++
|
||||
cs.ConsensusState.Timestamp = signature.Timestamp
|
||||
setClientState(store, cdc, &cs)
|
||||
return nil
|
||||
@@ -318,7 +322,7 @@ func (cs ClientState) VerifyPacketAcknowledgementAbsence(
|
||||
return err
|
||||
}
|
||||
|
||||
cs.ConsensusState.Sequence++
|
||||
cs.Sequence++
|
||||
cs.ConsensusState.Timestamp = signature.Timestamp
|
||||
setClientState(store, cdc, &cs)
|
||||
return nil
|
||||
@@ -355,7 +359,7 @@ func (cs ClientState) VerifyNextSequenceRecv(
|
||||
return err
|
||||
}
|
||||
|
||||
cs.ConsensusState.Sequence++
|
||||
cs.Sequence++
|
||||
cs.ConsensusState.Timestamp = signature.Timestamp
|
||||
setClientState(store, cdc, &cs)
|
||||
return nil
|
||||
|
||||
@@ -40,22 +40,22 @@ func (suite *SoloMachineTestSuite) TestClientStateValidateBasic() {
|
||||
},
|
||||
{
|
||||
"sequence is zero",
|
||||
types.NewClientState(&types.ConsensusState{0, suite.solomachine.ConsensusState().PublicKey, suite.solomachine.Diversifier, suite.solomachine.Time}, false),
|
||||
types.NewClientState(0, &types.ConsensusState{suite.solomachine.ConsensusState().PublicKey, suite.solomachine.Diversifier, suite.solomachine.Time}, false),
|
||||
false,
|
||||
},
|
||||
{
|
||||
"timestamp is zero",
|
||||
types.NewClientState(&types.ConsensusState{1, suite.solomachine.ConsensusState().PublicKey, suite.solomachine.Diversifier, 0}, false),
|
||||
types.NewClientState(1, &types.ConsensusState{suite.solomachine.ConsensusState().PublicKey, suite.solomachine.Diversifier, 0}, false),
|
||||
false,
|
||||
},
|
||||
{
|
||||
"diversifier is blank",
|
||||
types.NewClientState(&types.ConsensusState{1, suite.solomachine.ConsensusState().PublicKey, " ", 1}, false),
|
||||
types.NewClientState(1, &types.ConsensusState{suite.solomachine.ConsensusState().PublicKey, " ", 1}, false),
|
||||
false,
|
||||
},
|
||||
{
|
||||
"pubkey is empty",
|
||||
types.NewClientState(&types.ConsensusState{suite.solomachine.Sequence, nil, suite.solomachine.Diversifier, suite.solomachine.Time}, false),
|
||||
types.NewClientState(1, &types.ConsensusState{nil, suite.solomachine.Diversifier, suite.solomachine.Time}, false),
|
||||
false,
|
||||
},
|
||||
}
|
||||
@@ -122,23 +122,27 @@ func (suite *SoloMachineTestSuite) TestVerifyClientState() {
|
||||
},
|
||||
{
|
||||
"client is frozen",
|
||||
&types.ClientState{1, suite.solomachine.ConsensusState(), false},
|
||||
&types.ClientState{
|
||||
Sequence: 1,
|
||||
FrozenSequence: 1,
|
||||
ConsensusState: suite.solomachine.ConsensusState(),
|
||||
AllowUpdateAfterProposal: false,
|
||||
},
|
||||
prefix,
|
||||
proof,
|
||||
false,
|
||||
},
|
||||
{
|
||||
"consensus state in client state is nil",
|
||||
types.NewClientState(nil, false),
|
||||
types.NewClientState(1, nil, false),
|
||||
prefix,
|
||||
proof,
|
||||
false,
|
||||
},
|
||||
{
|
||||
"client state latest height is less than sequence",
|
||||
types.NewClientState(
|
||||
types.NewClientState(suite.solomachine.Sequence-1,
|
||||
&types.ConsensusState{
|
||||
Sequence: suite.solomachine.Sequence - 1,
|
||||
Timestamp: suite.solomachine.Time,
|
||||
PublicKey: suite.solomachine.ConsensusState().PublicKey,
|
||||
}, false),
|
||||
@@ -148,9 +152,8 @@ func (suite *SoloMachineTestSuite) TestVerifyClientState() {
|
||||
},
|
||||
{
|
||||
"consensus state timestamp is greater than signature",
|
||||
types.NewClientState(
|
||||
types.NewClientState(suite.solomachine.Sequence,
|
||||
&types.ConsensusState{
|
||||
Sequence: suite.solomachine.Sequence,
|
||||
Timestamp: suite.solomachine.Time + 1,
|
||||
PublicKey: suite.solomachine.ConsensusState().PublicKey,
|
||||
}, false),
|
||||
@@ -182,7 +185,7 @@ func (suite *SoloMachineTestSuite) TestVerifyClientState() {
|
||||
|
||||
var expSeq uint64
|
||||
if tc.clientState.ConsensusState != nil {
|
||||
expSeq = tc.clientState.ConsensusState.Sequence + 1
|
||||
expSeq = tc.clientState.Sequence + 1
|
||||
}
|
||||
|
||||
err := tc.clientState.VerifyClientState(
|
||||
@@ -247,23 +250,27 @@ func (suite *SoloMachineTestSuite) TestVerifyClientConsensusState() {
|
||||
},
|
||||
{
|
||||
"client is frozen",
|
||||
&types.ClientState{1, suite.solomachine.ConsensusState(), false},
|
||||
&types.ClientState{
|
||||
Sequence: 1,
|
||||
FrozenSequence: 1,
|
||||
ConsensusState: suite.solomachine.ConsensusState(),
|
||||
AllowUpdateAfterProposal: false,
|
||||
},
|
||||
prefix,
|
||||
proof,
|
||||
false,
|
||||
},
|
||||
{
|
||||
"consensus state in client state is nil",
|
||||
types.NewClientState(nil, false),
|
||||
types.NewClientState(1, nil, false),
|
||||
prefix,
|
||||
proof,
|
||||
false,
|
||||
},
|
||||
{
|
||||
"client state latest height is less than sequence",
|
||||
types.NewClientState(
|
||||
types.NewClientState(suite.solomachine.Sequence-1,
|
||||
&types.ConsensusState{
|
||||
Sequence: suite.solomachine.Sequence - 1,
|
||||
Timestamp: suite.solomachine.Time,
|
||||
PublicKey: suite.solomachine.ConsensusState().PublicKey,
|
||||
}, false),
|
||||
@@ -273,9 +280,8 @@ func (suite *SoloMachineTestSuite) TestVerifyClientConsensusState() {
|
||||
},
|
||||
{
|
||||
"consensus state timestamp is greater than signature",
|
||||
types.NewClientState(
|
||||
types.NewClientState(suite.solomachine.Sequence,
|
||||
&types.ConsensusState{
|
||||
Sequence: suite.solomachine.Sequence,
|
||||
Timestamp: suite.solomachine.Time + 1,
|
||||
PublicKey: suite.solomachine.ConsensusState().PublicKey,
|
||||
}, false),
|
||||
@@ -307,7 +313,7 @@ func (suite *SoloMachineTestSuite) TestVerifyClientConsensusState() {
|
||||
|
||||
var expSeq uint64
|
||||
if tc.clientState.ConsensusState != nil {
|
||||
expSeq = tc.clientState.ConsensusState.Sequence + 1
|
||||
expSeq = tc.clientState.Sequence + 1
|
||||
}
|
||||
|
||||
err := tc.clientState.VerifyClientConsensusState(
|
||||
@@ -368,7 +374,12 @@ func (suite *SoloMachineTestSuite) TestVerifyConnectionState() {
|
||||
},
|
||||
{
|
||||
"client is frozen",
|
||||
&types.ClientState{1, suite.solomachine.ConsensusState(), false},
|
||||
&types.ClientState{
|
||||
Sequence: 1,
|
||||
FrozenSequence: 1,
|
||||
ConsensusState: suite.solomachine.ConsensusState(),
|
||||
AllowUpdateAfterProposal: false,
|
||||
},
|
||||
prefix,
|
||||
proof,
|
||||
false,
|
||||
@@ -392,7 +403,7 @@ func (suite *SoloMachineTestSuite) TestVerifyConnectionState() {
|
||||
for i, tc := range testCases {
|
||||
tc := tc
|
||||
|
||||
expSeq := tc.clientState.ConsensusState.Sequence + 1
|
||||
expSeq := tc.clientState.Sequence + 1
|
||||
|
||||
err := tc.clientState.VerifyConnectionState(
|
||||
suite.store, suite.chainA.Codec, suite.solomachine.GetHeight(), tc.prefix, tc.proof, testConnectionID, conn,
|
||||
@@ -451,7 +462,12 @@ func (suite *SoloMachineTestSuite) TestVerifyChannelState() {
|
||||
},
|
||||
{
|
||||
"client is frozen",
|
||||
&types.ClientState{1, suite.solomachine.ConsensusState(), false},
|
||||
&types.ClientState{
|
||||
Sequence: 1,
|
||||
FrozenSequence: 1,
|
||||
ConsensusState: suite.solomachine.ConsensusState(),
|
||||
AllowUpdateAfterProposal: false,
|
||||
},
|
||||
prefix,
|
||||
proof,
|
||||
false,
|
||||
@@ -475,7 +491,7 @@ func (suite *SoloMachineTestSuite) TestVerifyChannelState() {
|
||||
for i, tc := range testCases {
|
||||
tc := tc
|
||||
|
||||
expSeq := tc.clientState.ConsensusState.Sequence + 1
|
||||
expSeq := tc.clientState.Sequence + 1
|
||||
|
||||
err := tc.clientState.VerifyChannelState(
|
||||
suite.store, suite.chainA.Codec, suite.solomachine.GetHeight(), tc.prefix, tc.proof, testPortID, testChannelID, ch,
|
||||
@@ -532,7 +548,12 @@ func (suite *SoloMachineTestSuite) TestVerifyPacketCommitment() {
|
||||
},
|
||||
{
|
||||
"client is frozen",
|
||||
&types.ClientState{1, suite.solomachine.ConsensusState(), false},
|
||||
&types.ClientState{
|
||||
Sequence: 1,
|
||||
FrozenSequence: 1,
|
||||
ConsensusState: suite.solomachine.ConsensusState(),
|
||||
AllowUpdateAfterProposal: false,
|
||||
},
|
||||
prefix,
|
||||
proof,
|
||||
false,
|
||||
@@ -556,7 +577,7 @@ func (suite *SoloMachineTestSuite) TestVerifyPacketCommitment() {
|
||||
for i, tc := range testCases {
|
||||
tc := tc
|
||||
|
||||
expSeq := tc.clientState.ConsensusState.Sequence + 1
|
||||
expSeq := tc.clientState.Sequence + 1
|
||||
|
||||
err := tc.clientState.VerifyPacketCommitment(
|
||||
suite.store, suite.chainA.Codec, suite.solomachine.GetHeight(), tc.prefix, tc.proof, testPortID, testChannelID, suite.solomachine.Sequence, commitmentBytes,
|
||||
@@ -613,7 +634,12 @@ func (suite *SoloMachineTestSuite) TestVerifyPacketAcknowledgement() {
|
||||
},
|
||||
{
|
||||
"client is frozen",
|
||||
&types.ClientState{1, suite.solomachine.ConsensusState(), false},
|
||||
&types.ClientState{
|
||||
Sequence: 1,
|
||||
FrozenSequence: 1,
|
||||
ConsensusState: suite.solomachine.ConsensusState(),
|
||||
AllowUpdateAfterProposal: false,
|
||||
},
|
||||
prefix,
|
||||
proof,
|
||||
false,
|
||||
@@ -637,7 +663,7 @@ func (suite *SoloMachineTestSuite) TestVerifyPacketAcknowledgement() {
|
||||
for i, tc := range testCases {
|
||||
tc := tc
|
||||
|
||||
expSeq := tc.clientState.ConsensusState.Sequence + 1
|
||||
expSeq := tc.clientState.Sequence + 1
|
||||
|
||||
err := tc.clientState.VerifyPacketAcknowledgement(
|
||||
suite.store, suite.chainA.Codec, suite.solomachine.GetHeight(), tc.prefix, tc.proof, testPortID, testChannelID, suite.solomachine.Sequence, ack,
|
||||
@@ -693,7 +719,12 @@ func (suite *SoloMachineTestSuite) TestVerifyPacketAcknowledgementAbsence() {
|
||||
},
|
||||
{
|
||||
"client is frozen",
|
||||
&types.ClientState{1, suite.solomachine.ConsensusState(), false},
|
||||
&types.ClientState{
|
||||
Sequence: 1,
|
||||
FrozenSequence: 1,
|
||||
ConsensusState: suite.solomachine.ConsensusState(),
|
||||
AllowUpdateAfterProposal: false,
|
||||
},
|
||||
prefix,
|
||||
proof,
|
||||
false,
|
||||
@@ -717,7 +748,7 @@ func (suite *SoloMachineTestSuite) TestVerifyPacketAcknowledgementAbsence() {
|
||||
for i, tc := range testCases {
|
||||
tc := tc
|
||||
|
||||
expSeq := tc.clientState.ConsensusState.Sequence + 1
|
||||
expSeq := tc.clientState.Sequence + 1
|
||||
|
||||
err := tc.clientState.VerifyPacketAcknowledgementAbsence(
|
||||
suite.store, suite.chainA.Codec, suite.solomachine.GetHeight(), tc.prefix, tc.proof, testPortID, testChannelID, suite.solomachine.Sequence,
|
||||
@@ -774,7 +805,12 @@ func (suite *SoloMachineTestSuite) TestVerifyNextSeqRecv() {
|
||||
},
|
||||
{
|
||||
"client is frozen",
|
||||
&types.ClientState{1, suite.solomachine.ConsensusState(), false},
|
||||
&types.ClientState{
|
||||
Sequence: 1,
|
||||
FrozenSequence: 1,
|
||||
ConsensusState: suite.solomachine.ConsensusState(),
|
||||
AllowUpdateAfterProposal: false,
|
||||
},
|
||||
prefix,
|
||||
proof,
|
||||
false,
|
||||
@@ -798,7 +834,7 @@ func (suite *SoloMachineTestSuite) TestVerifyNextSeqRecv() {
|
||||
for i, tc := range testCases {
|
||||
tc := tc
|
||||
|
||||
expSeq := tc.clientState.ConsensusState.Sequence + 1
|
||||
expSeq := tc.clientState.Sequence + 1
|
||||
|
||||
err := tc.clientState.VerifyNextSequenceRecv(
|
||||
suite.store, suite.chainA.Codec, suite.solomachine.GetHeight(), tc.prefix, tc.proof, testPortID, testChannelID, nextSeqRecv,
|
||||
|
||||
@@ -18,11 +18,10 @@ func (ConsensusState) ClientType() exported.ClientType {
|
||||
return exported.SoloMachine
|
||||
}
|
||||
|
||||
// GetHeight returns the sequence number.
|
||||
// Return clientexported.Height to satisfy interface
|
||||
// Epoch number is always 0 for a solo-machine
|
||||
// GetHeight satisfies the ConsensusState interface
|
||||
// NOTE: this function will be deprecated.
|
||||
func (cs ConsensusState) GetHeight() exported.Height {
|
||||
return clienttypes.NewHeight(0, cs.Sequence)
|
||||
return clienttypes.Height{}
|
||||
}
|
||||
|
||||
// GetTimestamp returns zero.
|
||||
@@ -47,9 +46,6 @@ func (cs ConsensusState) GetPubKey() tmcrypto.PubKey {
|
||||
|
||||
// ValidateBasic defines basic validation for the solo machine consensus state.
|
||||
func (cs ConsensusState) ValidateBasic() error {
|
||||
if cs.Sequence == 0 {
|
||||
return sdkerrors.Wrap(clienttypes.ErrInvalidConsensus, "sequence cannot be 0")
|
||||
}
|
||||
if cs.Timestamp == 0 {
|
||||
return sdkerrors.Wrap(clienttypes.ErrInvalidConsensus, "timestamp cannot be 0")
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package types_test
|
||||
|
||||
import (
|
||||
clienttypes "github.com/cosmos/cosmos-sdk/x/ibc/02-client/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/ibc/exported"
|
||||
"github.com/cosmos/cosmos-sdk/x/ibc/light-clients/solomachine/types"
|
||||
)
|
||||
@@ -9,8 +10,7 @@ func (suite *SoloMachineTestSuite) TestConsensusState() {
|
||||
consensusState := suite.solomachine.ConsensusState()
|
||||
|
||||
suite.Require().Equal(exported.SoloMachine, consensusState.ClientType())
|
||||
suite.Require().Equal(uint64(0), consensusState.GetHeight().GetEpochNumber())
|
||||
suite.Require().Equal(suite.solomachine.Sequence, consensusState.GetHeight().GetEpochHeight())
|
||||
suite.Require().Equal(clienttypes.Height{}, consensusState.GetHeight())
|
||||
suite.Require().Equal(suite.solomachine.Time, consensusState.GetTimestamp())
|
||||
suite.Require().Nil(consensusState.GetRoot())
|
||||
}
|
||||
@@ -26,20 +26,9 @@ func (suite *SoloMachineTestSuite) TestConsensusStateValidateBasic() {
|
||||
suite.solomachine.ConsensusState(),
|
||||
true,
|
||||
},
|
||||
{
|
||||
"sequence is zero",
|
||||
&types.ConsensusState{
|
||||
Sequence: 0,
|
||||
PublicKey: suite.solomachine.ConsensusState().PublicKey,
|
||||
Timestamp: suite.solomachine.Time,
|
||||
Diversifier: suite.solomachine.Diversifier,
|
||||
},
|
||||
false,
|
||||
},
|
||||
{
|
||||
"timestamp is zero",
|
||||
&types.ConsensusState{
|
||||
Sequence: suite.solomachine.Sequence,
|
||||
PublicKey: suite.solomachine.ConsensusState().PublicKey,
|
||||
Timestamp: 0,
|
||||
Diversifier: suite.solomachine.Diversifier,
|
||||
@@ -49,7 +38,6 @@ func (suite *SoloMachineTestSuite) TestConsensusStateValidateBasic() {
|
||||
{
|
||||
"diversifier is blank",
|
||||
&types.ConsensusState{
|
||||
Sequence: suite.solomachine.Sequence,
|
||||
PublicKey: suite.solomachine.ConsensusState().PublicKey,
|
||||
Timestamp: suite.solomachine.Time,
|
||||
Diversifier: " ",
|
||||
@@ -59,7 +47,6 @@ func (suite *SoloMachineTestSuite) TestConsensusStateValidateBasic() {
|
||||
{
|
||||
"pubkey is nil",
|
||||
&types.ConsensusState{
|
||||
Sequence: suite.solomachine.Sequence,
|
||||
Timestamp: suite.solomachine.Time,
|
||||
Diversifier: suite.solomachine.Diversifier,
|
||||
PublicKey: nil,
|
||||
|
||||
@@ -42,10 +42,10 @@ func (cs ClientState) CheckProposedHeaderAndUpdateState(
|
||||
clientState := &cs
|
||||
|
||||
consensusState := &ConsensusState{
|
||||
Sequence: smHeader.Sequence,
|
||||
PublicKey: smHeader.NewPublicKey,
|
||||
}
|
||||
|
||||
clientState.Sequence = smHeader.Sequence
|
||||
clientState.ConsensusState = consensusState
|
||||
clientState.FrozenSequence = 0
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ func (suite *SoloMachineTestSuite) TestCheckProposedHeaderAndUpdateState() {
|
||||
suite.Require().NoError(err)
|
||||
suite.Require().Equal(header.(*types.Header).GetPubKey(), consState.(*types.ConsensusState).GetPubKey())
|
||||
suite.Require().Equal(cs.(*types.ClientState).ConsensusState, consState)
|
||||
suite.Require().Equal(header.GetHeight().GetEpochHeight(), consState.(*types.ConsensusState).Sequence)
|
||||
suite.Require().Equal(header.GetHeight().GetEpochHeight(), cs.(*types.ClientState).Sequence)
|
||||
} else {
|
||||
suite.Require().Error(err)
|
||||
suite.Require().Nil(cs)
|
||||
|
||||
@@ -30,12 +30,14 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||
// ClientState defines a solo machine client that tracks the current consensus
|
||||
// state and if the client is frozen.
|
||||
type ClientState struct {
|
||||
// latest sequence of the client state
|
||||
Sequence uint64 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"`
|
||||
// frozen sequence of the solo machine
|
||||
FrozenSequence uint64 `protobuf:"varint,1,opt,name=frozen_sequence,json=frozenSequence,proto3" json:"frozen_sequence,omitempty" yaml:"frozen_sequence"`
|
||||
ConsensusState *ConsensusState `protobuf:"bytes,2,opt,name=consensus_state,json=consensusState,proto3" json:"consensus_state,omitempty" yaml:"consensus_state"`
|
||||
FrozenSequence uint64 `protobuf:"varint,2,opt,name=frozen_sequence,json=frozenSequence,proto3" json:"frozen_sequence,omitempty" yaml:"frozen_sequence"`
|
||||
ConsensusState *ConsensusState `protobuf:"bytes,3,opt,name=consensus_state,json=consensusState,proto3" json:"consensus_state,omitempty" yaml:"consensus_state"`
|
||||
// when set to true, will allow governance to update a solo machine client.
|
||||
// The client will be unfrozen if it is frozen.
|
||||
AllowUpdateAfterProposal bool `protobuf:"varint,3,opt,name=allow_update_after_proposal,json=allowUpdateAfterProposal,proto3" json:"allow_update_after_proposal,omitempty" yaml:"allow_update_after_proposal"`
|
||||
AllowUpdateAfterProposal bool `protobuf:"varint,4,opt,name=allow_update_after_proposal,json=allowUpdateAfterProposal,proto3" json:"allow_update_after_proposal,omitempty" yaml:"allow_update_after_proposal"`
|
||||
}
|
||||
|
||||
func (m *ClientState) Reset() { *m = ClientState{} }
|
||||
@@ -71,16 +73,15 @@ func (m *ClientState) XXX_DiscardUnknown() {
|
||||
|
||||
var xxx_messageInfo_ClientState proto.InternalMessageInfo
|
||||
|
||||
// ConsensusState defines a solo machine consensus state
|
||||
// ConsensusState defines a solo machine consensus state. The sequence of a consensus state
|
||||
// is contained in the "height" key used in storing the consensus state.
|
||||
type ConsensusState struct {
|
||||
// current sequence of the consensus state
|
||||
Sequence uint64 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"`
|
||||
// public key of the solo machine
|
||||
PublicKey *types.PublicKey `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty" yaml:"public_key"`
|
||||
PublicKey *types.PublicKey `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty" yaml:"public_key"`
|
||||
// diversifier allows the same public key to be re-used across different solo machine clients
|
||||
// (potentially on different chains) without being considered misbehaviour.
|
||||
Diversifier string `protobuf:"bytes,3,opt,name=diversifier,proto3" json:"diversifier,omitempty"`
|
||||
Timestamp uint64 `protobuf:"varint,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
|
||||
Diversifier string `protobuf:"bytes,2,opt,name=diversifier,proto3" json:"diversifier,omitempty"`
|
||||
Timestamp uint64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
|
||||
}
|
||||
|
||||
func (m *ConsensusState) Reset() { *m = ConsensusState{} }
|
||||
@@ -749,71 +750,72 @@ func init() {
|
||||
}
|
||||
|
||||
var fileDescriptor_6cc2ee18f7f86d4e = []byte{
|
||||
// 1023 bytes of a gzipped FileDescriptorProto
|
||||
// 1030 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x41, 0x6f, 0xe3, 0x44,
|
||||
0x14, 0xae, 0x43, 0x58, 0x9a, 0x97, 0x6c, 0x5b, 0xbc, 0xd9, 0x25, 0x2d, 0x10, 0x57, 0x96, 0x80,
|
||||
0x5e, 0xd6, 0x56, 0x16, 0x89, 0x43, 0x05, 0x87, 0x24, 0x8b, 0x04, 0x8b, 0x80, 0xca, 0x5d, 0x24,
|
||||
0x16, 0x16, 0x59, 0x63, 0xfb, 0x25, 0xb1, 0xea, 0xcc, 0x18, 0x7b, 0x92, 0x34, 0x48, 0x1c, 0xb8,
|
||||
0xc1, 0x0d, 0x89, 0x0b, 0x47, 0xfe, 0x04, 0xfc, 0x06, 0x24, 0x0e, 0xec, 0x91, 0x53, 0x84, 0xda,
|
||||
0x7f, 0x90, 0x5f, 0x80, 0x3c, 0x1e, 0x27, 0x76, 0x68, 0x52, 0x15, 0xf6, 0xe4, 0x99, 0xf7, 0xde,
|
||||
0x7c, 0xef, 0xcd, 0x37, 0xef, 0xf9, 0x3d, 0x68, 0xf9, 0x8e, 0x6b, 0x06, 0x7e, 0x7f, 0xc0, 0xdd,
|
||||
0xc0, 0x47, 0xca, 0x63, 0x33, 0x66, 0x01, 0x1b, 0x12, 0x77, 0xe0, 0x53, 0x34, 0xc7, 0xad, 0xfc,
|
||||
0xd6, 0x08, 0x23, 0xc6, 0x99, 0xaa, 0xf9, 0x8e, 0x6b, 0xe4, 0x8f, 0x18, 0x79, 0x9b, 0x71, 0xeb,
|
||||
0xe0, 0x2d, 0x97, 0xc5, 0x43, 0x16, 0x9b, 0x0e, 0x89, 0xd1, 0x74, 0xa3, 0x69, 0xc8, 0x99, 0x39,
|
||||
0x6e, 0x39, 0xc8, 0x49, 0x4b, 0x6e, 0x53, 0xa4, 0x83, 0x04, 0xc9, 0x74, 0x19, 0xa5, 0xe8, 0x72,
|
||||
0x9f, 0xd1, 0xdc, 0x52, 0x1a, 0xec, 0x0b, 0x83, 0x01, 0xa1, 0x14, 0x83, 0xec, 0x2b, 0x55, 0xf5,
|
||||
0x3e, 0xeb, 0x33, 0xb1, 0x34, 0x93, 0x55, 0x76, 0xa0, 0xcf, 0x58, 0x3f, 0x40, 0x53, 0xec, 0x9c,
|
||||
0x51, 0xcf, 0x24, 0x74, 0x9a, 0xaa, 0xf4, 0x5f, 0x4b, 0x50, 0xed, 0x8a, 0x80, 0x4f, 0x39, 0xe1,
|
||||
0xa8, 0x76, 0x61, 0xb7, 0x17, 0xb1, 0x6f, 0x90, 0xda, 0x31, 0x7e, 0x3d, 0x42, 0xea, 0x62, 0x43,
|
||||
0x39, 0x54, 0x8e, 0xca, 0x9d, 0x83, 0xf9, 0x4c, 0xbb, 0x37, 0x25, 0xc3, 0xe0, 0x58, 0x5f, 0x31,
|
||||
0xd0, 0xad, 0x9d, 0x54, 0x72, 0x2a, 0x05, 0x2a, 0x87, 0x5d, 0x97, 0xd1, 0x18, 0x69, 0x3c, 0x8a,
|
||||
0xed, 0x38, 0xc1, 0x6d, 0x94, 0x0e, 0x95, 0xa3, 0xea, 0x03, 0xd3, 0xb8, 0x86, 0x25, 0xa3, 0x9b,
|
||||
0x9d, 0x13, 0xe1, 0xe4, 0xbd, 0xae, 0x20, 0xea, 0xd6, 0x8e, 0x5b, 0xb0, 0x55, 0x11, 0x5e, 0x25,
|
||||
0x41, 0xc0, 0x26, 0xf6, 0x28, 0xf4, 0x08, 0x47, 0x9b, 0xf4, 0x38, 0x46, 0x76, 0x18, 0xb1, 0x90,
|
||||
0xc5, 0x24, 0x68, 0xbc, 0x70, 0xa8, 0x1c, 0x6d, 0x77, 0xde, 0x9c, 0xcf, 0x34, 0x3d, 0x05, 0xdc,
|
||||
0x60, 0xac, 0x5b, 0x0d, 0xa1, 0xfd, 0x4c, 0x28, 0xdb, 0x89, 0xee, 0x44, 0xaa, 0x8e, 0xcb, 0xdf,
|
||||
0xff, 0xa2, 0x6d, 0xe9, 0x7f, 0x2a, 0xb0, 0x53, 0x8c, 0x55, 0x3d, 0x80, 0xed, 0x22, 0x67, 0xd6,
|
||||
0x62, 0xaf, 0x7e, 0x09, 0x10, 0x8e, 0x9c, 0xc0, 0x77, 0xed, 0x33, 0x9c, 0x4a, 0x32, 0xde, 0x30,
|
||||
0xd2, 0x8c, 0x30, 0x92, 0x8c, 0x30, 0x64, 0x0a, 0xc8, 0x8c, 0x30, 0x4e, 0x84, 0xf5, 0x47, 0x38,
|
||||
0xed, 0xdc, 0x9d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|
||||
0x3a, 0x95, 0xd1, 0xa6, 0xd3, 0xce, 0x2b, 0xf3, 0x99, 0x76, 0xa7, 0x50, 0x5f, 0xb2, 0x03, 0x54,
|
||||
0xdd, 0xa5, 0x27, 0xe9, 0xfe, 0x07, 0x05, 0xd4, 0xe2, 0x7f, 0x79, 0x6d, 0x08, 0x4f, 0xd6, 0x75,
|
||||
0xa9, 0xab, 0xa3, 0xb8, 0x41, 0x2b, 0x92, 0xb1, 0x50, 0xb8, 0xd3, 0x5d, 0xf4, 0xee, 0xcd, 0xb1,
|
||||
0xbc, 0x07, 0xb0, 0x6c, 0xf3, 0x32, 0x8c, 0xd7, 0x45, 0x45, 0xe6, 0xba, 0xff, 0x12, 0xec, 0x7d,
|
||||
0xea, 0x59, 0xb9, 0x03, 0xd2, 0xdf, 0x53, 0xd8, 0xeb, 0xa6, 0xd3, 0xc0, 0x66, 0x67, 0x06, 0xbc,
|
||||
0x24, 0xa7, 0x86, 0xc5, 0x85, 0x85, 0x27, 0x39, 0x49, 0x48, 0x0c, 0x2b, 0x33, 0x92, 0xe8, 0x8f,
|
||||
0xa0, 0x7e, 0x42, 0xdc, 0x33, 0xe4, 0x5d, 0x36, 0x1c, 0xfa, 0x7c, 0x88, 0x94, 0xaf, 0xf5, 0xd0,
|
||||
0x4c, 0xae, 0x93, 0x59, 0xc9, 0xda, 0xcd, 0x49, 0xf4, 0x27, 0xb0, 0x9f, 0x62, 0xb5, 0xdd, 0x33,
|
||||
0xca, 0x26, 0x01, 0x7a, 0x7d, 0xdc, 0x08, 0x78, 0x04, 0xbb, 0xa4, 0x68, 0x2a, 0x51, 0x57, 0xc5,
|
||||
0xfa, 0x3b, 0x70, 0x78, 0x25, 0x74, 0xdb, 0x49, 0x1e, 0x68, 0x2d, 0x29, 0xfa, 0x00, 0xea, 0x9f,
|
||||
0xe0, 0x39, 0xcf, 0x66, 0x18, 0x0b, 0xdd, 0xf1, 0xda, 0x68, 0xde, 0x85, 0xdb, 0x14, 0xcf, 0x79,
|
||||
0x32, 0x01, 0xd9, 0x11, 0xba, 0xe3, 0xb4, 0xf4, 0xf3, 0xff, 0xc3, 0x82, 0x5a, 0xb7, 0xaa, 0x34,
|
||||
0x85, 0x4e, 0x50, 0x3b, 0x4f, 0x7f, 0xbf, 0x68, 0x2a, 0xcf, 0x2e, 0x9a, 0xca, 0xdf, 0x17, 0x4d,
|
||||
0xe5, 0xc7, 0xcb, 0xe6, 0xd6, 0xb3, 0xcb, 0xe6, 0xd6, 0x5f, 0x97, 0xcd, 0xad, 0x2f, 0x3a, 0x7d,
|
||||
0x9f, 0x0f, 0x46, 0x8e, 0xe1, 0xb2, 0xa1, 0x29, 0xa7, 0xc5, 0xf4, 0x73, 0x3f, 0xf6, 0xce, 0xcc,
|
||||
0x73, 0x73, 0x31, 0x95, 0xde, 0xbf, 0x6a, 0x2c, 0xe5, 0xd3, 0x10, 0x63, 0xe7, 0x96, 0x48, 0xda,
|
||||
0xb7, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0xe9, 0x98, 0xb3, 0x9b, 0xc3, 0x0a, 0x00, 0x00,
|
||||
0x14, 0xae, 0xb3, 0x61, 0x69, 0x5e, 0xb2, 0x6d, 0xf1, 0x66, 0x97, 0xb4, 0x40, 0x1c, 0x59, 0x02,
|
||||
0x7a, 0x59, 0x5b, 0x59, 0x24, 0x0e, 0x15, 0x1c, 0x92, 0x2c, 0x12, 0x2c, 0x02, 0x2a, 0x77, 0x91,
|
||||
0x58, 0x58, 0x64, 0x8d, 0xed, 0x49, 0x62, 0xd5, 0x99, 0x31, 0xf6, 0x24, 0x69, 0x90, 0x38, 0x70,
|
||||
0x83, 0x1b, 0x12, 0x17, 0x8e, 0xfc, 0x07, 0x24, 0x7e, 0x03, 0x12, 0x97, 0xe5, 0xc6, 0x29, 0x42,
|
||||
0xed, 0x3f, 0xc8, 0x2f, 0x40, 0x9e, 0x19, 0x27, 0xb6, 0xdb, 0xa4, 0x2a, 0xec, 0xc9, 0xe3, 0x99,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e1, 0x98, 0xa1, 0x51, 0xc8,
|
||||
0xe5, 0x2e, 0x5b, 0xab, 0x09, 0xe9, 0xf5, 0xcf, 0x25, 0xb8, 0xfd, 0x21, 0x46, 0x1e, 0x8e, 0x36,
|
||||
0x06, 0x41, 0x8e, 0xaa, 0x54, 0xa0, 0x4a, 0x56, 0x63, 0x7f, 0x40, 0x10, 0x1b, 0x47, 0xe2, 0x5e,
|
||||
0x6b, 0xd6, 0x6a, 0x42, 0xed, 0xc3, 0x0e, 0xc1, 0x53, 0x3b, 0xa3, 0x44, 0xf9, 0x26, 0x4a, 0xec,
|
||||
0x2f, 0xe6, 0xda, 0x3d, 0xa1, 0x44, 0x9e, 0x46, 0xb7, 0x6a, 0x04, 0x4f, 0x97, 0xc0, 0x24, 0x50,
|
||||
0x13, 0x40, 0x56, 0x94, 0x97, 0x12, 0x51, 0xb2, 0x21, 0x53, 0x00, 0xe8, 0x56, 0xe2, 0xda, 0xa3,
|
||||
0xd5, 0x84, 0x54, 0xe5, 0xcf, 0x12, 0xd4, 0x3e, 0xf1, 0x63, 0x07, 0x0f, 0xd1, 0xc4, 0xa7, 0xe3,
|
||||
0x48, 0x6d, 0x43, 0x45, 0x84, 0xa7, 0xed, 0x7b, 0x5c, 0x9c, 0x4a, 0xb7, 0xbe, 0x98, 0x6b, 0x7b,
|
||||
0x32, 0x10, 0xd3, 0x25, 0xdd, 0xda, 0x16, 0xe3, 0x8f, 0xbc, 0x9c, 0x9c, 0xa5, 0x82, 0x9c, 0x21,
|
||||
0xdc, 0x59, 0xea, 0x63, 0x53, 0x92, 0x26, 0x43, 0xfb, 0xda, 0x64, 0x38, 0x49, 0x77, 0x75, 0x88,
|
||||
0xf7, 0x08, 0x31, 0xd4, 0x6d, 0x2c, 0xe6, 0x5a, 0x5d, 0x78, 0x91, 0x63, 0xd4, 0xad, 0xda, 0xf2,
|
||||
0xff, 0x33, 0x52, 0xb0, 0xc8, 0xa6, 0x54, 0xde, 0xc1, 0x8b, 0xb2, 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0x2f, 0x6e, 0x50, 0x6e, 0xa4, 0x2f, 0x04,
|
||||
0xee, 0xf6, 0x96, 0xb5, 0x7b, 0xb3, 0x2f, 0xef, 0x03, 0xac, 0xca, 0xbc, 0x74, 0xe3, 0x0d, 0x9e,
|
||||
0x91, 0x99, 0xea, 0xbf, 0x22, 0xfb, 0x80, 0x78, 0x56, 0x66, 0x83, 0xb4, 0xf7, 0x0c, 0xf6, 0x7a,
|
||||
0xa2, 0x1b, 0xd8, 0x6c, 0xcc, 0x80, 0x97, 0x65, 0xd7, 0xb0, 0x3c, 0x30, 0xb7, 0x24, 0x3b, 0x09,
|
||||
0xc9, 0x61, 0xa5, 0x20, 0xc9, 0xfe, 0x18, 0xea, 0xc7, 0xc8, 0x3d, 0xc5, 0xac, 0x47, 0x47, 0x23,
|
||||
0x9f, 0x8d, 0x30, 0x61, 0x6b, 0x2d, 0x34, 0x93, 0xe3, 0xa4, 0x28, 0x99, 0xbb, 0x99, 0x19, 0xfd,
|
||||
0x29, 0xec, 0x0b, 0xae, 0x8e, 0x7b, 0x4a, 0xe8, 0x34, 0xc0, 0xde, 0x00, 0x6f, 0x24, 0x3c, 0x84,
|
||||
0x5d, 0x94, 0x87, 0x4a, 0xd6, 0xe2, 0xb4, 0xfe, 0x2e, 0xb4, 0xae, 0xa4, 0xee, 0x38, 0xc9, 0x05,
|
||||
0xad, 0x15, 0x45, 0x1f, 0x42, 0xfd, 0x53, 0x7c, 0xc6, 0xd2, 0x3e, 0xc5, 0xc2, 0xee, 0x64, 0xad,
|
||||
0x37, 0xef, 0xc1, 0x1d, 0x82, 0xcf, 0x58, 0xd2, 0xe5, 0xd8, 0x11, 0x76, 0x27, 0xb2, 0x0d, 0xca,
|
||||
0xbc, 0x87, 0xb9, 0x65, 0xdd, 0xaa, 0x12, 0x41, 0x9d, 0xb0, 0x76, 0x9f, 0xfd, 0x71, 0xde, 0x54,
|
||||
0x9e, 0x9f, 0x37, 0x95, 0x7f, 0xce, 0x9b, 0xca, 0x4f, 0x17, 0xcd, 0xad, 0xe7, 0x17, 0xcd, 0xad,
|
||||
0xbf, 0x2f, 0x9a, 0x5b, 0x5f, 0x76, 0x07, 0x3e, 0x1b, 0x8e, 0x1d, 0xc3, 0xa5, 0x23, 0x53, 0x76,
|
||||
0x8b, 0xe2, 0xf3, 0x20, 0xf6, 0x4e, 0xcd, 0x33, 0x73, 0xd9, 0x95, 0x3e, 0xb8, 0xaa, 0x2d, 0x65,
|
||||
0xb3, 0x10, 0xc7, 0xce, 0x6d, 0x1e, 0xb4, 0xef, 0xfc, 0x1b, 0x00, 0x00, 0xff, 0xff, 0xc5, 0x29,
|
||||
0x18, 0x98, 0xc3, 0x0a, 0x00, 0x00,
|
||||
}
|
||||
|
||||
func (m *ClientState) Marshal() (dAtA []byte, err error) {
|
||||
@@ -844,7 +846,7 @@ func (m *ClientState) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
dAtA[i] = 0
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x18
|
||||
dAtA[i] = 0x20
|
||||
}
|
||||
if m.ConsensusState != nil {
|
||||
{
|
||||
@@ -856,11 +858,16 @@ func (m *ClientState) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i = encodeVarintSolomachine(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
dAtA[i] = 0x1a
|
||||
}
|
||||
if m.FrozenSequence != 0 {
|
||||
i = encodeVarintSolomachine(dAtA, i, uint64(m.FrozenSequence))
|
||||
i--
|
||||
dAtA[i] = 0x10
|
||||
}
|
||||
if m.Sequence != 0 {
|
||||
i = encodeVarintSolomachine(dAtA, i, uint64(m.Sequence))
|
||||
i--
|
||||
dAtA[i] = 0x8
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
@@ -889,14 +896,14 @@ func (m *ConsensusState) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
if m.Timestamp != 0 {
|
||||
i = encodeVarintSolomachine(dAtA, i, uint64(m.Timestamp))
|
||||
i--
|
||||
dAtA[i] = 0x20
|
||||
dAtA[i] = 0x18
|
||||
}
|
||||
if len(m.Diversifier) > 0 {
|
||||
i -= len(m.Diversifier)
|
||||
copy(dAtA[i:], m.Diversifier)
|
||||
i = encodeVarintSolomachine(dAtA, i, uint64(len(m.Diversifier)))
|
||||
i--
|
||||
dAtA[i] = 0x1a
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
if m.PublicKey != nil {
|
||||
{
|
||||
@@ -908,12 +915,7 @@ func (m *ConsensusState) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i = encodeVarintSolomachine(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
if m.Sequence != 0 {
|
||||
i = encodeVarintSolomachine(dAtA, i, uint64(m.Sequence))
|
||||
i--
|
||||
dAtA[i] = 0x8
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
@@ -1521,6 +1523,9 @@ func (m *ClientState) Size() (n int) {
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
if m.Sequence != 0 {
|
||||
n += 1 + sovSolomachine(uint64(m.Sequence))
|
||||
}
|
||||
if m.FrozenSequence != 0 {
|
||||
n += 1 + sovSolomachine(uint64(m.FrozenSequence))
|
||||
}
|
||||
@@ -1540,9 +1545,6 @@ func (m *ConsensusState) Size() (n int) {
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
if m.Sequence != 0 {
|
||||
n += 1 + sovSolomachine(uint64(m.Sequence))
|
||||
}
|
||||
if m.PublicKey != nil {
|
||||
l = m.PublicKey.Size()
|
||||
n += 1 + l + sovSolomachine(uint64(l))
|
||||
@@ -1848,6 +1850,25 @@ func (m *ClientState) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 0 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Sequence", wireType)
|
||||
}
|
||||
m.Sequence = 0
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowSolomachine
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
m.Sequence |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
case 2:
|
||||
if wireType != 0 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field FrozenSequence", wireType)
|
||||
}
|
||||
@@ -1866,7 +1887,7 @@ func (m *ClientState) Unmarshal(dAtA []byte) error {
|
||||
break
|
||||
}
|
||||
}
|
||||
case 2:
|
||||
case 3:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field ConsensusState", wireType)
|
||||
}
|
||||
@@ -1902,7 +1923,7 @@ func (m *ClientState) Unmarshal(dAtA []byte) error {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
case 3:
|
||||
case 4:
|
||||
if wireType != 0 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field AllowUpdateAfterProposal", wireType)
|
||||
}
|
||||
@@ -1976,25 +1997,6 @@ func (m *ConsensusState) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 0 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Sequence", wireType)
|
||||
}
|
||||
m.Sequence = 0
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowSolomachine
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
m.Sequence |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
case 2:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType)
|
||||
}
|
||||
@@ -2030,7 +2032,7 @@ func (m *ConsensusState) Unmarshal(dAtA []byte) error {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
case 3:
|
||||
case 2:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Diversifier", wireType)
|
||||
}
|
||||
@@ -2062,7 +2064,7 @@ func (m *ConsensusState) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
m.Diversifier = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 4:
|
||||
case 3:
|
||||
if wireType != 0 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType)
|
||||
}
|
||||
|
||||
@@ -34,10 +34,10 @@ func (cs ClientState) CheckHeaderAndUpdateState(
|
||||
// checkHeader checks if the Solo Machine update signature is valid.
|
||||
func checkHeader(cdc codec.BinaryMarshaler, clientState *ClientState, header *Header) error {
|
||||
// assert update sequence is current sequence
|
||||
if header.Sequence != clientState.ConsensusState.Sequence {
|
||||
if header.Sequence != clientState.Sequence {
|
||||
return sdkerrors.Wrapf(
|
||||
clienttypes.ErrInvalidHeader,
|
||||
"sequence provided in the header does not match the client state sequence (%d != %d)", header.Sequence, clientState.ConsensusState.Sequence,
|
||||
"sequence provided in the header does not match the client state sequence (%d != %d)", header.Sequence, clientState.Sequence,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -57,13 +57,13 @@ func checkHeader(cdc codec.BinaryMarshaler, clientState *ClientState, header *He
|
||||
// update the consensus state to the new public key and an incremented sequence
|
||||
func update(clientState *ClientState, header *Header) (*ClientState, *ConsensusState) {
|
||||
consensusState := &ConsensusState{
|
||||
// increment sequence number
|
||||
Sequence: clientState.ConsensusState.Sequence + 1,
|
||||
PublicKey: header.NewPublicKey,
|
||||
Diversifier: header.NewDiversifier,
|
||||
Timestamp: header.Timestamp,
|
||||
}
|
||||
|
||||
// increment sequence number
|
||||
clientState.Sequence++
|
||||
clientState.ConsensusState = consensusState
|
||||
return clientState, consensusState
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ func (suite *SoloMachineTestSuite) TestCheckHeaderAndUpdateState() {
|
||||
|
||||
// generate invalid signature
|
||||
signBytes := &types.SignBytes{
|
||||
Sequence: cs.ConsensusState.Sequence,
|
||||
Sequence: cs.Sequence,
|
||||
Timestamp: suite.solomachine.Time,
|
||||
Diversifier: suite.solomachine.Diversifier,
|
||||
Data: dataBz,
|
||||
@@ -111,7 +111,7 @@ func (suite *SoloMachineTestSuite) TestCheckHeaderAndUpdateState() {
|
||||
h := suite.solomachine.CreateHeader()
|
||||
|
||||
// generate invalid signature
|
||||
data := append(sdk.Uint64ToBigEndian(cs.ConsensusState.Sequence), oldPrivKey.PubKey().Bytes()...)
|
||||
data := append(sdk.Uint64ToBigEndian(cs.Sequence), oldPrivKey.PubKey().Bytes()...)
|
||||
sig, err := oldPrivKey.Sign(data)
|
||||
suite.Require().NoError(err)
|
||||
h.Signature = sig
|
||||
@@ -136,7 +136,7 @@ func (suite *SoloMachineTestSuite) TestCheckHeaderAndUpdateState() {
|
||||
suite.Require().NoError(err)
|
||||
suite.Require().Equal(header.(*types.Header).NewPublicKey, clientState.(*types.ClientState).ConsensusState.PublicKey)
|
||||
suite.Require().Equal(uint64(0), clientState.(*types.ClientState).FrozenSequence)
|
||||
suite.Require().Equal(header.(*types.Header).Sequence+1, clientState.(*types.ClientState).ConsensusState.Sequence)
|
||||
suite.Require().Equal(header.(*types.Header).Sequence+1, clientState.(*types.ClientState).Sequence)
|
||||
suite.Require().Equal(consensusState, clientState.(*types.ClientState).ConsensusState)
|
||||
} else {
|
||||
suite.Require().Error(err)
|
||||
|
||||
@@ -203,11 +203,9 @@ func (chain *TestChain) QueryClientStateProof(clientID string) (exported.ClientS
|
||||
// QueryConsensusStateProof performs an abci query for a consensus state
|
||||
// stored on the given clientID. The proof and consensusHeight are returned.
|
||||
func (chain *TestChain) QueryConsensusStateProof(clientID string) ([]byte, clienttypes.Height) {
|
||||
// retrieve consensus state to provide proof for
|
||||
consState, found := chain.App.IBCKeeper.ClientKeeper.GetLatestClientConsensusState(chain.GetContext(), clientID)
|
||||
require.True(chain.t, found)
|
||||
clientState := chain.GetClientState(clientID)
|
||||
|
||||
consensusHeight := consState.GetHeight().(clienttypes.Height)
|
||||
consensusHeight := clientState.GetLatestHeight().(clienttypes.Height)
|
||||
consensusKey := host.FullKeyClientPath(clientID, host.KeyConsensusState(consensusHeight))
|
||||
proofConsensus, _ := chain.QueryProof(consensusKey)
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ func NewSolomachine(t *testing.T, cdc codec.BinaryMarshaler, clientID, diversifi
|
||||
// ClientState returns a new solo machine ClientState instance. Default usage does not allow update
|
||||
// after governance proposal
|
||||
func (solo *Solomachine) ClientState() *solomachinetypes.ClientState {
|
||||
return solomachinetypes.NewClientState(solo.ConsensusState(), false)
|
||||
return solomachinetypes.NewClientState(solo.Sequence, solo.ConsensusState(), false)
|
||||
}
|
||||
|
||||
// ConsensusState returns a new solo machine ConsensusState instance
|
||||
@@ -57,7 +57,6 @@ func (solo *Solomachine) ConsensusState() *solomachinetypes.ConsensusState {
|
||||
require.NoError(solo.t, err)
|
||||
|
||||
return &solomachinetypes.ConsensusState{
|
||||
Sequence: solo.Sequence,
|
||||
PublicKey: publicKey,
|
||||
Diversifier: solo.Diversifier,
|
||||
Timestamp: solo.Time,
|
||||
|
||||
@@ -88,6 +88,7 @@ func local_request_Query_AnnualProvisions_0(ctx context.Context, marshaler runti
|
||||
// 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 (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.
|
||||
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
|
||||
|
||||
mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
|
||||
@@ -70,6 +70,7 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal
|
||||
// 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 (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.
|
||||
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
|
||||
|
||||
mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
|
||||
@@ -142,6 +142,7 @@ func local_request_Query_SigningInfos_0(ctx context.Context, marshaler runtime.M
|
||||
// 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 (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.
|
||||
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
|
||||
|
||||
mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
|
||||
@@ -874,6 +874,7 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal
|
||||
// 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 (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.
|
||||
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
|
||||
|
||||
mux.Handle("GET", pattern_Query_Validators_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
|
||||
+581
-564
File diff suppressed because it is too large
Load Diff
@@ -106,6 +106,7 @@ func local_request_Query_AppliedPlan_0(ctx context.Context, marshaler runtime.Ma
|
||||
// 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 (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.
|
||||
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
|
||||
|
||||
mux.Handle("GET", pattern_Query_CurrentPlan_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
|
||||
Reference in New Issue
Block a user