feat!: Comet v0.38 Integration (#15519)
Co-authored-by: marbar3778 <marbar3778@yahoo.com> Co-authored-by: cool-developer <51834436+cool-develope@users.noreply.github.com> Co-authored-by: Aaron Craelius <aaron@regen.network> Co-authored-by: Matt Kocubinski <mkocubinski@gmail.com> Co-authored-by: Julien Robert <julien@rbrt.fr>
This commit is contained in:
parent
166be3766b
commit
6cee22df52
2
Makefile
2
Makefile
@ -421,7 +421,7 @@ proto-lint:
|
||||
proto-check-breaking:
|
||||
@$(protoImage) buf breaking --against $(HTTPS_GIT)#branch=main
|
||||
|
||||
CMT_URL = https://raw.githubusercontent.com/cometbft/cometbft/v0.37.0/proto/tendermint
|
||||
CMT_URL = https://raw.githubusercontent.com/cometbft/cometbft/v0.38.0-alpha.2/proto/tendermint
|
||||
|
||||
CMT_CRYPTO_TYPES = proto/tendermint/crypto
|
||||
CMT_ABCI_TYPES = proto/tendermint/abci
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -19,22 +19,16 @@ import (
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
const (
|
||||
ABCIListenerService_ListenBeginBlock_FullMethodName = "/cosmos.store.streaming.abci.ABCIListenerService/ListenBeginBlock"
|
||||
ABCIListenerService_ListenEndBlock_FullMethodName = "/cosmos.store.streaming.abci.ABCIListenerService/ListenEndBlock"
|
||||
ABCIListenerService_ListenDeliverTx_FullMethodName = "/cosmos.store.streaming.abci.ABCIListenerService/ListenDeliverTx"
|
||||
ABCIListenerService_ListenCommit_FullMethodName = "/cosmos.store.streaming.abci.ABCIListenerService/ListenCommit"
|
||||
ABCIListenerService_ListenFinalizeBlock_FullMethodName = "/cosmos.store.streaming.abci.ABCIListenerService/ListenFinalizeBlock"
|
||||
ABCIListenerService_ListenCommit_FullMethodName = "/cosmos.store.streaming.abci.ABCIListenerService/ListenCommit"
|
||||
)
|
||||
|
||||
// ABCIListenerServiceClient is the client API for ABCIListenerService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type ABCIListenerServiceClient interface {
|
||||
// ListenBeginBlock is the corresponding endpoint for ABCIListener.ListenBeginBlock
|
||||
ListenBeginBlock(ctx context.Context, in *ListenBeginBlockRequest, opts ...grpc.CallOption) (*ListenBeginBlockResponse, error)
|
||||
// ListenEndBlock is the corresponding endpoint for ABCIListener.ListenEndBlock
|
||||
ListenEndBlock(ctx context.Context, in *ListenEndBlockRequest, opts ...grpc.CallOption) (*ListenEndBlockResponse, error)
|
||||
// ListenDeliverTx is the corresponding endpoint for ABCIListener.ListenDeliverTx
|
||||
ListenDeliverTx(ctx context.Context, in *ListenDeliverTxRequest, opts ...grpc.CallOption) (*ListenDeliverTxResponse, error)
|
||||
// ListenFinalizeBlock is the corresponding endpoint for ABCIListener.ListenEndBlock
|
||||
ListenFinalizeBlock(ctx context.Context, in *ListenFinalizeBlockRequest, opts ...grpc.CallOption) (*ListenFinalizeBlockResponse, error)
|
||||
// ListenCommit is the corresponding endpoint for ABCIListener.ListenCommit
|
||||
ListenCommit(ctx context.Context, in *ListenCommitRequest, opts ...grpc.CallOption) (*ListenCommitResponse, error)
|
||||
}
|
||||
@ -47,27 +41,9 @@ func NewABCIListenerServiceClient(cc grpc.ClientConnInterface) ABCIListenerServi
|
||||
return &aBCIListenerServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *aBCIListenerServiceClient) ListenBeginBlock(ctx context.Context, in *ListenBeginBlockRequest, opts ...grpc.CallOption) (*ListenBeginBlockResponse, error) {
|
||||
out := new(ListenBeginBlockResponse)
|
||||
err := c.cc.Invoke(ctx, ABCIListenerService_ListenBeginBlock_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *aBCIListenerServiceClient) ListenEndBlock(ctx context.Context, in *ListenEndBlockRequest, opts ...grpc.CallOption) (*ListenEndBlockResponse, error) {
|
||||
out := new(ListenEndBlockResponse)
|
||||
err := c.cc.Invoke(ctx, ABCIListenerService_ListenEndBlock_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *aBCIListenerServiceClient) ListenDeliverTx(ctx context.Context, in *ListenDeliverTxRequest, opts ...grpc.CallOption) (*ListenDeliverTxResponse, error) {
|
||||
out := new(ListenDeliverTxResponse)
|
||||
err := c.cc.Invoke(ctx, ABCIListenerService_ListenDeliverTx_FullMethodName, in, out, opts...)
|
||||
func (c *aBCIListenerServiceClient) ListenFinalizeBlock(ctx context.Context, in *ListenFinalizeBlockRequest, opts ...grpc.CallOption) (*ListenFinalizeBlockResponse, error) {
|
||||
out := new(ListenFinalizeBlockResponse)
|
||||
err := c.cc.Invoke(ctx, ABCIListenerService_ListenFinalizeBlock_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -87,12 +63,8 @@ func (c *aBCIListenerServiceClient) ListenCommit(ctx context.Context, in *Listen
|
||||
// All implementations must embed UnimplementedABCIListenerServiceServer
|
||||
// for forward compatibility
|
||||
type ABCIListenerServiceServer interface {
|
||||
// ListenBeginBlock is the corresponding endpoint for ABCIListener.ListenBeginBlock
|
||||
ListenBeginBlock(context.Context, *ListenBeginBlockRequest) (*ListenBeginBlockResponse, error)
|
||||
// ListenEndBlock is the corresponding endpoint for ABCIListener.ListenEndBlock
|
||||
ListenEndBlock(context.Context, *ListenEndBlockRequest) (*ListenEndBlockResponse, error)
|
||||
// ListenDeliverTx is the corresponding endpoint for ABCIListener.ListenDeliverTx
|
||||
ListenDeliverTx(context.Context, *ListenDeliverTxRequest) (*ListenDeliverTxResponse, error)
|
||||
// ListenFinalizeBlock is the corresponding endpoint for ABCIListener.ListenEndBlock
|
||||
ListenFinalizeBlock(context.Context, *ListenFinalizeBlockRequest) (*ListenFinalizeBlockResponse, error)
|
||||
// ListenCommit is the corresponding endpoint for ABCIListener.ListenCommit
|
||||
ListenCommit(context.Context, *ListenCommitRequest) (*ListenCommitResponse, error)
|
||||
mustEmbedUnimplementedABCIListenerServiceServer()
|
||||
@ -102,14 +74,8 @@ type ABCIListenerServiceServer interface {
|
||||
type UnimplementedABCIListenerServiceServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedABCIListenerServiceServer) ListenBeginBlock(context.Context, *ListenBeginBlockRequest) (*ListenBeginBlockResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListenBeginBlock not implemented")
|
||||
}
|
||||
func (UnimplementedABCIListenerServiceServer) ListenEndBlock(context.Context, *ListenEndBlockRequest) (*ListenEndBlockResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListenEndBlock not implemented")
|
||||
}
|
||||
func (UnimplementedABCIListenerServiceServer) ListenDeliverTx(context.Context, *ListenDeliverTxRequest) (*ListenDeliverTxResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListenDeliverTx not implemented")
|
||||
func (UnimplementedABCIListenerServiceServer) ListenFinalizeBlock(context.Context, *ListenFinalizeBlockRequest) (*ListenFinalizeBlockResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListenFinalizeBlock not implemented")
|
||||
}
|
||||
func (UnimplementedABCIListenerServiceServer) ListenCommit(context.Context, *ListenCommitRequest) (*ListenCommitResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListenCommit not implemented")
|
||||
@ -127,56 +93,20 @@ func RegisterABCIListenerServiceServer(s grpc.ServiceRegistrar, srv ABCIListener
|
||||
s.RegisterService(&ABCIListenerService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _ABCIListenerService_ListenBeginBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListenBeginBlockRequest)
|
||||
func _ABCIListenerService_ListenFinalizeBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListenFinalizeBlockRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ABCIListenerServiceServer).ListenBeginBlock(ctx, in)
|
||||
return srv.(ABCIListenerServiceServer).ListenFinalizeBlock(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ABCIListenerService_ListenBeginBlock_FullMethodName,
|
||||
FullMethod: ABCIListenerService_ListenFinalizeBlock_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ABCIListenerServiceServer).ListenBeginBlock(ctx, req.(*ListenBeginBlockRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ABCIListenerService_ListenEndBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListenEndBlockRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ABCIListenerServiceServer).ListenEndBlock(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ABCIListenerService_ListenEndBlock_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ABCIListenerServiceServer).ListenEndBlock(ctx, req.(*ListenEndBlockRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ABCIListenerService_ListenDeliverTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListenDeliverTxRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ABCIListenerServiceServer).ListenDeliverTx(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ABCIListenerService_ListenDeliverTx_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ABCIListenerServiceServer).ListenDeliverTx(ctx, req.(*ListenDeliverTxRequest))
|
||||
return srv.(ABCIListenerServiceServer).ListenFinalizeBlock(ctx, req.(*ListenFinalizeBlockRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@ -207,16 +137,8 @@ var ABCIListenerService_ServiceDesc = grpc.ServiceDesc{
|
||||
HandlerType: (*ABCIListenerServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "ListenBeginBlock",
|
||||
Handler: _ABCIListenerService_ListenBeginBlock_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListenEndBlock",
|
||||
Handler: _ABCIListenerService_ListenEndBlock_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListenDeliverTx",
|
||||
Handler: _ABCIListenerService_ListenDeliverTx_Handler,
|
||||
MethodName: "ListenFinalizeBlock",
|
||||
Handler: _ABCIListenerService_ListenFinalizeBlock_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListenCommit",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -19,644 +19,644 @@ import (
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
const (
|
||||
ABCIApplication_Echo_FullMethodName = "/tendermint.abci.ABCIApplication/Echo"
|
||||
ABCIApplication_Flush_FullMethodName = "/tendermint.abci.ABCIApplication/Flush"
|
||||
ABCIApplication_Info_FullMethodName = "/tendermint.abci.ABCIApplication/Info"
|
||||
ABCIApplication_DeliverTx_FullMethodName = "/tendermint.abci.ABCIApplication/DeliverTx"
|
||||
ABCIApplication_CheckTx_FullMethodName = "/tendermint.abci.ABCIApplication/CheckTx"
|
||||
ABCIApplication_Query_FullMethodName = "/tendermint.abci.ABCIApplication/Query"
|
||||
ABCIApplication_Commit_FullMethodName = "/tendermint.abci.ABCIApplication/Commit"
|
||||
ABCIApplication_InitChain_FullMethodName = "/tendermint.abci.ABCIApplication/InitChain"
|
||||
ABCIApplication_BeginBlock_FullMethodName = "/tendermint.abci.ABCIApplication/BeginBlock"
|
||||
ABCIApplication_EndBlock_FullMethodName = "/tendermint.abci.ABCIApplication/EndBlock"
|
||||
ABCIApplication_ListSnapshots_FullMethodName = "/tendermint.abci.ABCIApplication/ListSnapshots"
|
||||
ABCIApplication_OfferSnapshot_FullMethodName = "/tendermint.abci.ABCIApplication/OfferSnapshot"
|
||||
ABCIApplication_LoadSnapshotChunk_FullMethodName = "/tendermint.abci.ABCIApplication/LoadSnapshotChunk"
|
||||
ABCIApplication_ApplySnapshotChunk_FullMethodName = "/tendermint.abci.ABCIApplication/ApplySnapshotChunk"
|
||||
ABCIApplication_PrepareProposal_FullMethodName = "/tendermint.abci.ABCIApplication/PrepareProposal"
|
||||
ABCIApplication_ProcessProposal_FullMethodName = "/tendermint.abci.ABCIApplication/ProcessProposal"
|
||||
ABCI_Echo_FullMethodName = "/tendermint.abci.ABCI/Echo"
|
||||
ABCI_Flush_FullMethodName = "/tendermint.abci.ABCI/Flush"
|
||||
ABCI_Info_FullMethodName = "/tendermint.abci.ABCI/Info"
|
||||
ABCI_CheckTx_FullMethodName = "/tendermint.abci.ABCI/CheckTx"
|
||||
ABCI_Query_FullMethodName = "/tendermint.abci.ABCI/Query"
|
||||
ABCI_Commit_FullMethodName = "/tendermint.abci.ABCI/Commit"
|
||||
ABCI_InitChain_FullMethodName = "/tendermint.abci.ABCI/InitChain"
|
||||
ABCI_ListSnapshots_FullMethodName = "/tendermint.abci.ABCI/ListSnapshots"
|
||||
ABCI_OfferSnapshot_FullMethodName = "/tendermint.abci.ABCI/OfferSnapshot"
|
||||
ABCI_LoadSnapshotChunk_FullMethodName = "/tendermint.abci.ABCI/LoadSnapshotChunk"
|
||||
ABCI_ApplySnapshotChunk_FullMethodName = "/tendermint.abci.ABCI/ApplySnapshotChunk"
|
||||
ABCI_PrepareProposal_FullMethodName = "/tendermint.abci.ABCI/PrepareProposal"
|
||||
ABCI_ProcessProposal_FullMethodName = "/tendermint.abci.ABCI/ProcessProposal"
|
||||
ABCI_ExtendVote_FullMethodName = "/tendermint.abci.ABCI/ExtendVote"
|
||||
ABCI_VerifyVoteExtension_FullMethodName = "/tendermint.abci.ABCI/VerifyVoteExtension"
|
||||
ABCI_FinalizeBlock_FullMethodName = "/tendermint.abci.ABCI/FinalizeBlock"
|
||||
)
|
||||
|
||||
// ABCIApplicationClient is the client API for ABCIApplication service.
|
||||
// ABCIClient is the client API for ABCI service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type ABCIApplicationClient interface {
|
||||
type ABCIClient interface {
|
||||
Echo(ctx context.Context, in *RequestEcho, opts ...grpc.CallOption) (*ResponseEcho, error)
|
||||
Flush(ctx context.Context, in *RequestFlush, opts ...grpc.CallOption) (*ResponseFlush, error)
|
||||
Info(ctx context.Context, in *RequestInfo, opts ...grpc.CallOption) (*ResponseInfo, error)
|
||||
DeliverTx(ctx context.Context, in *RequestDeliverTx, opts ...grpc.CallOption) (*ResponseDeliverTx, error)
|
||||
CheckTx(ctx context.Context, in *RequestCheckTx, opts ...grpc.CallOption) (*ResponseCheckTx, error)
|
||||
Query(ctx context.Context, in *RequestQuery, opts ...grpc.CallOption) (*ResponseQuery, error)
|
||||
Commit(ctx context.Context, in *RequestCommit, opts ...grpc.CallOption) (*ResponseCommit, error)
|
||||
InitChain(ctx context.Context, in *RequestInitChain, opts ...grpc.CallOption) (*ResponseInitChain, error)
|
||||
BeginBlock(ctx context.Context, in *RequestBeginBlock, opts ...grpc.CallOption) (*ResponseBeginBlock, error)
|
||||
EndBlock(ctx context.Context, in *RequestEndBlock, opts ...grpc.CallOption) (*ResponseEndBlock, error)
|
||||
ListSnapshots(ctx context.Context, in *RequestListSnapshots, opts ...grpc.CallOption) (*ResponseListSnapshots, error)
|
||||
OfferSnapshot(ctx context.Context, in *RequestOfferSnapshot, opts ...grpc.CallOption) (*ResponseOfferSnapshot, error)
|
||||
LoadSnapshotChunk(ctx context.Context, in *RequestLoadSnapshotChunk, opts ...grpc.CallOption) (*ResponseLoadSnapshotChunk, error)
|
||||
ApplySnapshotChunk(ctx context.Context, in *RequestApplySnapshotChunk, opts ...grpc.CallOption) (*ResponseApplySnapshotChunk, error)
|
||||
PrepareProposal(ctx context.Context, in *RequestPrepareProposal, opts ...grpc.CallOption) (*ResponsePrepareProposal, error)
|
||||
ProcessProposal(ctx context.Context, in *RequestProcessProposal, opts ...grpc.CallOption) (*ResponseProcessProposal, error)
|
||||
ExtendVote(ctx context.Context, in *RequestExtendVote, opts ...grpc.CallOption) (*ResponseExtendVote, error)
|
||||
VerifyVoteExtension(ctx context.Context, in *RequestVerifyVoteExtension, opts ...grpc.CallOption) (*ResponseVerifyVoteExtension, error)
|
||||
FinalizeBlock(ctx context.Context, in *RequestFinalizeBlock, opts ...grpc.CallOption) (*ResponseFinalizeBlock, error)
|
||||
}
|
||||
|
||||
type aBCIApplicationClient struct {
|
||||
type aBCIClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewABCIApplicationClient(cc grpc.ClientConnInterface) ABCIApplicationClient {
|
||||
return &aBCIApplicationClient{cc}
|
||||
func NewABCIClient(cc grpc.ClientConnInterface) ABCIClient {
|
||||
return &aBCIClient{cc}
|
||||
}
|
||||
|
||||
func (c *aBCIApplicationClient) Echo(ctx context.Context, in *RequestEcho, opts ...grpc.CallOption) (*ResponseEcho, error) {
|
||||
func (c *aBCIClient) Echo(ctx context.Context, in *RequestEcho, opts ...grpc.CallOption) (*ResponseEcho, error) {
|
||||
out := new(ResponseEcho)
|
||||
err := c.cc.Invoke(ctx, ABCIApplication_Echo_FullMethodName, in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, ABCI_Echo_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *aBCIApplicationClient) Flush(ctx context.Context, in *RequestFlush, opts ...grpc.CallOption) (*ResponseFlush, error) {
|
||||
func (c *aBCIClient) Flush(ctx context.Context, in *RequestFlush, opts ...grpc.CallOption) (*ResponseFlush, error) {
|
||||
out := new(ResponseFlush)
|
||||
err := c.cc.Invoke(ctx, ABCIApplication_Flush_FullMethodName, in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, ABCI_Flush_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *aBCIApplicationClient) Info(ctx context.Context, in *RequestInfo, opts ...grpc.CallOption) (*ResponseInfo, error) {
|
||||
func (c *aBCIClient) Info(ctx context.Context, in *RequestInfo, opts ...grpc.CallOption) (*ResponseInfo, error) {
|
||||
out := new(ResponseInfo)
|
||||
err := c.cc.Invoke(ctx, ABCIApplication_Info_FullMethodName, in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, ABCI_Info_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *aBCIApplicationClient) DeliverTx(ctx context.Context, in *RequestDeliverTx, opts ...grpc.CallOption) (*ResponseDeliverTx, error) {
|
||||
out := new(ResponseDeliverTx)
|
||||
err := c.cc.Invoke(ctx, ABCIApplication_DeliverTx_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *aBCIApplicationClient) CheckTx(ctx context.Context, in *RequestCheckTx, opts ...grpc.CallOption) (*ResponseCheckTx, error) {
|
||||
func (c *aBCIClient) CheckTx(ctx context.Context, in *RequestCheckTx, opts ...grpc.CallOption) (*ResponseCheckTx, error) {
|
||||
out := new(ResponseCheckTx)
|
||||
err := c.cc.Invoke(ctx, ABCIApplication_CheckTx_FullMethodName, in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, ABCI_CheckTx_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *aBCIApplicationClient) Query(ctx context.Context, in *RequestQuery, opts ...grpc.CallOption) (*ResponseQuery, error) {
|
||||
func (c *aBCIClient) Query(ctx context.Context, in *RequestQuery, opts ...grpc.CallOption) (*ResponseQuery, error) {
|
||||
out := new(ResponseQuery)
|
||||
err := c.cc.Invoke(ctx, ABCIApplication_Query_FullMethodName, in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, ABCI_Query_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *aBCIApplicationClient) Commit(ctx context.Context, in *RequestCommit, opts ...grpc.CallOption) (*ResponseCommit, error) {
|
||||
func (c *aBCIClient) Commit(ctx context.Context, in *RequestCommit, opts ...grpc.CallOption) (*ResponseCommit, error) {
|
||||
out := new(ResponseCommit)
|
||||
err := c.cc.Invoke(ctx, ABCIApplication_Commit_FullMethodName, in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, ABCI_Commit_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *aBCIApplicationClient) InitChain(ctx context.Context, in *RequestInitChain, opts ...grpc.CallOption) (*ResponseInitChain, error) {
|
||||
func (c *aBCIClient) InitChain(ctx context.Context, in *RequestInitChain, opts ...grpc.CallOption) (*ResponseInitChain, error) {
|
||||
out := new(ResponseInitChain)
|
||||
err := c.cc.Invoke(ctx, ABCIApplication_InitChain_FullMethodName, in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, ABCI_InitChain_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *aBCIApplicationClient) BeginBlock(ctx context.Context, in *RequestBeginBlock, opts ...grpc.CallOption) (*ResponseBeginBlock, error) {
|
||||
out := new(ResponseBeginBlock)
|
||||
err := c.cc.Invoke(ctx, ABCIApplication_BeginBlock_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *aBCIApplicationClient) EndBlock(ctx context.Context, in *RequestEndBlock, opts ...grpc.CallOption) (*ResponseEndBlock, error) {
|
||||
out := new(ResponseEndBlock)
|
||||
err := c.cc.Invoke(ctx, ABCIApplication_EndBlock_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *aBCIApplicationClient) ListSnapshots(ctx context.Context, in *RequestListSnapshots, opts ...grpc.CallOption) (*ResponseListSnapshots, error) {
|
||||
func (c *aBCIClient) ListSnapshots(ctx context.Context, in *RequestListSnapshots, opts ...grpc.CallOption) (*ResponseListSnapshots, error) {
|
||||
out := new(ResponseListSnapshots)
|
||||
err := c.cc.Invoke(ctx, ABCIApplication_ListSnapshots_FullMethodName, in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, ABCI_ListSnapshots_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *aBCIApplicationClient) OfferSnapshot(ctx context.Context, in *RequestOfferSnapshot, opts ...grpc.CallOption) (*ResponseOfferSnapshot, error) {
|
||||
func (c *aBCIClient) OfferSnapshot(ctx context.Context, in *RequestOfferSnapshot, opts ...grpc.CallOption) (*ResponseOfferSnapshot, error) {
|
||||
out := new(ResponseOfferSnapshot)
|
||||
err := c.cc.Invoke(ctx, ABCIApplication_OfferSnapshot_FullMethodName, in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, ABCI_OfferSnapshot_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *aBCIApplicationClient) LoadSnapshotChunk(ctx context.Context, in *RequestLoadSnapshotChunk, opts ...grpc.CallOption) (*ResponseLoadSnapshotChunk, error) {
|
||||
func (c *aBCIClient) LoadSnapshotChunk(ctx context.Context, in *RequestLoadSnapshotChunk, opts ...grpc.CallOption) (*ResponseLoadSnapshotChunk, error) {
|
||||
out := new(ResponseLoadSnapshotChunk)
|
||||
err := c.cc.Invoke(ctx, ABCIApplication_LoadSnapshotChunk_FullMethodName, in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, ABCI_LoadSnapshotChunk_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *aBCIApplicationClient) ApplySnapshotChunk(ctx context.Context, in *RequestApplySnapshotChunk, opts ...grpc.CallOption) (*ResponseApplySnapshotChunk, error) {
|
||||
func (c *aBCIClient) ApplySnapshotChunk(ctx context.Context, in *RequestApplySnapshotChunk, opts ...grpc.CallOption) (*ResponseApplySnapshotChunk, error) {
|
||||
out := new(ResponseApplySnapshotChunk)
|
||||
err := c.cc.Invoke(ctx, ABCIApplication_ApplySnapshotChunk_FullMethodName, in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, ABCI_ApplySnapshotChunk_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *aBCIApplicationClient) PrepareProposal(ctx context.Context, in *RequestPrepareProposal, opts ...grpc.CallOption) (*ResponsePrepareProposal, error) {
|
||||
func (c *aBCIClient) PrepareProposal(ctx context.Context, in *RequestPrepareProposal, opts ...grpc.CallOption) (*ResponsePrepareProposal, error) {
|
||||
out := new(ResponsePrepareProposal)
|
||||
err := c.cc.Invoke(ctx, ABCIApplication_PrepareProposal_FullMethodName, in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, ABCI_PrepareProposal_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *aBCIApplicationClient) ProcessProposal(ctx context.Context, in *RequestProcessProposal, opts ...grpc.CallOption) (*ResponseProcessProposal, error) {
|
||||
func (c *aBCIClient) ProcessProposal(ctx context.Context, in *RequestProcessProposal, opts ...grpc.CallOption) (*ResponseProcessProposal, error) {
|
||||
out := new(ResponseProcessProposal)
|
||||
err := c.cc.Invoke(ctx, ABCIApplication_ProcessProposal_FullMethodName, in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, ABCI_ProcessProposal_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// ABCIApplicationServer is the server API for ABCIApplication service.
|
||||
// All implementations must embed UnimplementedABCIApplicationServer
|
||||
func (c *aBCIClient) ExtendVote(ctx context.Context, in *RequestExtendVote, opts ...grpc.CallOption) (*ResponseExtendVote, error) {
|
||||
out := new(ResponseExtendVote)
|
||||
err := c.cc.Invoke(ctx, ABCI_ExtendVote_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *aBCIClient) VerifyVoteExtension(ctx context.Context, in *RequestVerifyVoteExtension, opts ...grpc.CallOption) (*ResponseVerifyVoteExtension, error) {
|
||||
out := new(ResponseVerifyVoteExtension)
|
||||
err := c.cc.Invoke(ctx, ABCI_VerifyVoteExtension_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *aBCIClient) FinalizeBlock(ctx context.Context, in *RequestFinalizeBlock, opts ...grpc.CallOption) (*ResponseFinalizeBlock, error) {
|
||||
out := new(ResponseFinalizeBlock)
|
||||
err := c.cc.Invoke(ctx, ABCI_FinalizeBlock_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// ABCIServer is the server API for ABCI service.
|
||||
// All implementations must embed UnimplementedABCIServer
|
||||
// for forward compatibility
|
||||
type ABCIApplicationServer interface {
|
||||
type ABCIServer interface {
|
||||
Echo(context.Context, *RequestEcho) (*ResponseEcho, error)
|
||||
Flush(context.Context, *RequestFlush) (*ResponseFlush, error)
|
||||
Info(context.Context, *RequestInfo) (*ResponseInfo, error)
|
||||
DeliverTx(context.Context, *RequestDeliverTx) (*ResponseDeliverTx, error)
|
||||
CheckTx(context.Context, *RequestCheckTx) (*ResponseCheckTx, error)
|
||||
Query(context.Context, *RequestQuery) (*ResponseQuery, error)
|
||||
Commit(context.Context, *RequestCommit) (*ResponseCommit, error)
|
||||
InitChain(context.Context, *RequestInitChain) (*ResponseInitChain, error)
|
||||
BeginBlock(context.Context, *RequestBeginBlock) (*ResponseBeginBlock, error)
|
||||
EndBlock(context.Context, *RequestEndBlock) (*ResponseEndBlock, error)
|
||||
ListSnapshots(context.Context, *RequestListSnapshots) (*ResponseListSnapshots, error)
|
||||
OfferSnapshot(context.Context, *RequestOfferSnapshot) (*ResponseOfferSnapshot, error)
|
||||
LoadSnapshotChunk(context.Context, *RequestLoadSnapshotChunk) (*ResponseLoadSnapshotChunk, error)
|
||||
ApplySnapshotChunk(context.Context, *RequestApplySnapshotChunk) (*ResponseApplySnapshotChunk, error)
|
||||
PrepareProposal(context.Context, *RequestPrepareProposal) (*ResponsePrepareProposal, error)
|
||||
ProcessProposal(context.Context, *RequestProcessProposal) (*ResponseProcessProposal, error)
|
||||
mustEmbedUnimplementedABCIApplicationServer()
|
||||
ExtendVote(context.Context, *RequestExtendVote) (*ResponseExtendVote, error)
|
||||
VerifyVoteExtension(context.Context, *RequestVerifyVoteExtension) (*ResponseVerifyVoteExtension, error)
|
||||
FinalizeBlock(context.Context, *RequestFinalizeBlock) (*ResponseFinalizeBlock, error)
|
||||
mustEmbedUnimplementedABCIServer()
|
||||
}
|
||||
|
||||
// UnimplementedABCIApplicationServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedABCIApplicationServer struct {
|
||||
// UnimplementedABCIServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedABCIServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedABCIApplicationServer) Echo(context.Context, *RequestEcho) (*ResponseEcho, error) {
|
||||
func (UnimplementedABCIServer) Echo(context.Context, *RequestEcho) (*ResponseEcho, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Echo not implemented")
|
||||
}
|
||||
func (UnimplementedABCIApplicationServer) Flush(context.Context, *RequestFlush) (*ResponseFlush, error) {
|
||||
func (UnimplementedABCIServer) Flush(context.Context, *RequestFlush) (*ResponseFlush, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Flush not implemented")
|
||||
}
|
||||
func (UnimplementedABCIApplicationServer) Info(context.Context, *RequestInfo) (*ResponseInfo, error) {
|
||||
func (UnimplementedABCIServer) Info(context.Context, *RequestInfo) (*ResponseInfo, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Info not implemented")
|
||||
}
|
||||
func (UnimplementedABCIApplicationServer) DeliverTx(context.Context, *RequestDeliverTx) (*ResponseDeliverTx, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DeliverTx not implemented")
|
||||
}
|
||||
func (UnimplementedABCIApplicationServer) CheckTx(context.Context, *RequestCheckTx) (*ResponseCheckTx, error) {
|
||||
func (UnimplementedABCIServer) CheckTx(context.Context, *RequestCheckTx) (*ResponseCheckTx, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CheckTx not implemented")
|
||||
}
|
||||
func (UnimplementedABCIApplicationServer) Query(context.Context, *RequestQuery) (*ResponseQuery, error) {
|
||||
func (UnimplementedABCIServer) Query(context.Context, *RequestQuery) (*ResponseQuery, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Query not implemented")
|
||||
}
|
||||
func (UnimplementedABCIApplicationServer) Commit(context.Context, *RequestCommit) (*ResponseCommit, error) {
|
||||
func (UnimplementedABCIServer) Commit(context.Context, *RequestCommit) (*ResponseCommit, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Commit not implemented")
|
||||
}
|
||||
func (UnimplementedABCIApplicationServer) InitChain(context.Context, *RequestInitChain) (*ResponseInitChain, error) {
|
||||
func (UnimplementedABCIServer) InitChain(context.Context, *RequestInitChain) (*ResponseInitChain, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method InitChain not implemented")
|
||||
}
|
||||
func (UnimplementedABCIApplicationServer) BeginBlock(context.Context, *RequestBeginBlock) (*ResponseBeginBlock, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method BeginBlock not implemented")
|
||||
}
|
||||
func (UnimplementedABCIApplicationServer) EndBlock(context.Context, *RequestEndBlock) (*ResponseEndBlock, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method EndBlock not implemented")
|
||||
}
|
||||
func (UnimplementedABCIApplicationServer) ListSnapshots(context.Context, *RequestListSnapshots) (*ResponseListSnapshots, error) {
|
||||
func (UnimplementedABCIServer) ListSnapshots(context.Context, *RequestListSnapshots) (*ResponseListSnapshots, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListSnapshots not implemented")
|
||||
}
|
||||
func (UnimplementedABCIApplicationServer) OfferSnapshot(context.Context, *RequestOfferSnapshot) (*ResponseOfferSnapshot, error) {
|
||||
func (UnimplementedABCIServer) OfferSnapshot(context.Context, *RequestOfferSnapshot) (*ResponseOfferSnapshot, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method OfferSnapshot not implemented")
|
||||
}
|
||||
func (UnimplementedABCIApplicationServer) LoadSnapshotChunk(context.Context, *RequestLoadSnapshotChunk) (*ResponseLoadSnapshotChunk, error) {
|
||||
func (UnimplementedABCIServer) LoadSnapshotChunk(context.Context, *RequestLoadSnapshotChunk) (*ResponseLoadSnapshotChunk, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method LoadSnapshotChunk not implemented")
|
||||
}
|
||||
func (UnimplementedABCIApplicationServer) ApplySnapshotChunk(context.Context, *RequestApplySnapshotChunk) (*ResponseApplySnapshotChunk, error) {
|
||||
func (UnimplementedABCIServer) ApplySnapshotChunk(context.Context, *RequestApplySnapshotChunk) (*ResponseApplySnapshotChunk, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ApplySnapshotChunk not implemented")
|
||||
}
|
||||
func (UnimplementedABCIApplicationServer) PrepareProposal(context.Context, *RequestPrepareProposal) (*ResponsePrepareProposal, error) {
|
||||
func (UnimplementedABCIServer) PrepareProposal(context.Context, *RequestPrepareProposal) (*ResponsePrepareProposal, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method PrepareProposal not implemented")
|
||||
}
|
||||
func (UnimplementedABCIApplicationServer) ProcessProposal(context.Context, *RequestProcessProposal) (*ResponseProcessProposal, error) {
|
||||
func (UnimplementedABCIServer) ProcessProposal(context.Context, *RequestProcessProposal) (*ResponseProcessProposal, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ProcessProposal not implemented")
|
||||
}
|
||||
func (UnimplementedABCIApplicationServer) mustEmbedUnimplementedABCIApplicationServer() {}
|
||||
func (UnimplementedABCIServer) ExtendVote(context.Context, *RequestExtendVote) (*ResponseExtendVote, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ExtendVote not implemented")
|
||||
}
|
||||
func (UnimplementedABCIServer) VerifyVoteExtension(context.Context, *RequestVerifyVoteExtension) (*ResponseVerifyVoteExtension, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method VerifyVoteExtension not implemented")
|
||||
}
|
||||
func (UnimplementedABCIServer) FinalizeBlock(context.Context, *RequestFinalizeBlock) (*ResponseFinalizeBlock, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method FinalizeBlock not implemented")
|
||||
}
|
||||
func (UnimplementedABCIServer) mustEmbedUnimplementedABCIServer() {}
|
||||
|
||||
// UnsafeABCIApplicationServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to ABCIApplicationServer will
|
||||
// UnsafeABCIServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to ABCIServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeABCIApplicationServer interface {
|
||||
mustEmbedUnimplementedABCIApplicationServer()
|
||||
type UnsafeABCIServer interface {
|
||||
mustEmbedUnimplementedABCIServer()
|
||||
}
|
||||
|
||||
func RegisterABCIApplicationServer(s grpc.ServiceRegistrar, srv ABCIApplicationServer) {
|
||||
s.RegisterService(&ABCIApplication_ServiceDesc, srv)
|
||||
func RegisterABCIServer(s grpc.ServiceRegistrar, srv ABCIServer) {
|
||||
s.RegisterService(&ABCI_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _ABCIApplication_Echo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _ABCI_Echo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RequestEcho)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ABCIApplicationServer).Echo(ctx, in)
|
||||
return srv.(ABCIServer).Echo(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ABCIApplication_Echo_FullMethodName,
|
||||
FullMethod: ABCI_Echo_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ABCIApplicationServer).Echo(ctx, req.(*RequestEcho))
|
||||
return srv.(ABCIServer).Echo(ctx, req.(*RequestEcho))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ABCIApplication_Flush_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _ABCI_Flush_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RequestFlush)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ABCIApplicationServer).Flush(ctx, in)
|
||||
return srv.(ABCIServer).Flush(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ABCIApplication_Flush_FullMethodName,
|
||||
FullMethod: ABCI_Flush_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ABCIApplicationServer).Flush(ctx, req.(*RequestFlush))
|
||||
return srv.(ABCIServer).Flush(ctx, req.(*RequestFlush))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ABCIApplication_Info_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _ABCI_Info_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RequestInfo)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ABCIApplicationServer).Info(ctx, in)
|
||||
return srv.(ABCIServer).Info(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ABCIApplication_Info_FullMethodName,
|
||||
FullMethod: ABCI_Info_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ABCIApplicationServer).Info(ctx, req.(*RequestInfo))
|
||||
return srv.(ABCIServer).Info(ctx, req.(*RequestInfo))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ABCIApplication_DeliverTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RequestDeliverTx)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ABCIApplicationServer).DeliverTx(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ABCIApplication_DeliverTx_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ABCIApplicationServer).DeliverTx(ctx, req.(*RequestDeliverTx))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ABCIApplication_CheckTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _ABCI_CheckTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RequestCheckTx)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ABCIApplicationServer).CheckTx(ctx, in)
|
||||
return srv.(ABCIServer).CheckTx(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ABCIApplication_CheckTx_FullMethodName,
|
||||
FullMethod: ABCI_CheckTx_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ABCIApplicationServer).CheckTx(ctx, req.(*RequestCheckTx))
|
||||
return srv.(ABCIServer).CheckTx(ctx, req.(*RequestCheckTx))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ABCIApplication_Query_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _ABCI_Query_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RequestQuery)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ABCIApplicationServer).Query(ctx, in)
|
||||
return srv.(ABCIServer).Query(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ABCIApplication_Query_FullMethodName,
|
||||
FullMethod: ABCI_Query_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ABCIApplicationServer).Query(ctx, req.(*RequestQuery))
|
||||
return srv.(ABCIServer).Query(ctx, req.(*RequestQuery))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ABCIApplication_Commit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _ABCI_Commit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RequestCommit)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ABCIApplicationServer).Commit(ctx, in)
|
||||
return srv.(ABCIServer).Commit(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ABCIApplication_Commit_FullMethodName,
|
||||
FullMethod: ABCI_Commit_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ABCIApplicationServer).Commit(ctx, req.(*RequestCommit))
|
||||
return srv.(ABCIServer).Commit(ctx, req.(*RequestCommit))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ABCIApplication_InitChain_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _ABCI_InitChain_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RequestInitChain)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ABCIApplicationServer).InitChain(ctx, in)
|
||||
return srv.(ABCIServer).InitChain(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ABCIApplication_InitChain_FullMethodName,
|
||||
FullMethod: ABCI_InitChain_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ABCIApplicationServer).InitChain(ctx, req.(*RequestInitChain))
|
||||
return srv.(ABCIServer).InitChain(ctx, req.(*RequestInitChain))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ABCIApplication_BeginBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RequestBeginBlock)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ABCIApplicationServer).BeginBlock(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ABCIApplication_BeginBlock_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ABCIApplicationServer).BeginBlock(ctx, req.(*RequestBeginBlock))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ABCIApplication_EndBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RequestEndBlock)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ABCIApplicationServer).EndBlock(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ABCIApplication_EndBlock_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ABCIApplicationServer).EndBlock(ctx, req.(*RequestEndBlock))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ABCIApplication_ListSnapshots_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _ABCI_ListSnapshots_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RequestListSnapshots)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ABCIApplicationServer).ListSnapshots(ctx, in)
|
||||
return srv.(ABCIServer).ListSnapshots(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ABCIApplication_ListSnapshots_FullMethodName,
|
||||
FullMethod: ABCI_ListSnapshots_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ABCIApplicationServer).ListSnapshots(ctx, req.(*RequestListSnapshots))
|
||||
return srv.(ABCIServer).ListSnapshots(ctx, req.(*RequestListSnapshots))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ABCIApplication_OfferSnapshot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _ABCI_OfferSnapshot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RequestOfferSnapshot)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ABCIApplicationServer).OfferSnapshot(ctx, in)
|
||||
return srv.(ABCIServer).OfferSnapshot(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ABCIApplication_OfferSnapshot_FullMethodName,
|
||||
FullMethod: ABCI_OfferSnapshot_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ABCIApplicationServer).OfferSnapshot(ctx, req.(*RequestOfferSnapshot))
|
||||
return srv.(ABCIServer).OfferSnapshot(ctx, req.(*RequestOfferSnapshot))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ABCIApplication_LoadSnapshotChunk_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _ABCI_LoadSnapshotChunk_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RequestLoadSnapshotChunk)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ABCIApplicationServer).LoadSnapshotChunk(ctx, in)
|
||||
return srv.(ABCIServer).LoadSnapshotChunk(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ABCIApplication_LoadSnapshotChunk_FullMethodName,
|
||||
FullMethod: ABCI_LoadSnapshotChunk_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ABCIApplicationServer).LoadSnapshotChunk(ctx, req.(*RequestLoadSnapshotChunk))
|
||||
return srv.(ABCIServer).LoadSnapshotChunk(ctx, req.(*RequestLoadSnapshotChunk))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ABCIApplication_ApplySnapshotChunk_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _ABCI_ApplySnapshotChunk_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RequestApplySnapshotChunk)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ABCIApplicationServer).ApplySnapshotChunk(ctx, in)
|
||||
return srv.(ABCIServer).ApplySnapshotChunk(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ABCIApplication_ApplySnapshotChunk_FullMethodName,
|
||||
FullMethod: ABCI_ApplySnapshotChunk_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ABCIApplicationServer).ApplySnapshotChunk(ctx, req.(*RequestApplySnapshotChunk))
|
||||
return srv.(ABCIServer).ApplySnapshotChunk(ctx, req.(*RequestApplySnapshotChunk))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ABCIApplication_PrepareProposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _ABCI_PrepareProposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RequestPrepareProposal)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ABCIApplicationServer).PrepareProposal(ctx, in)
|
||||
return srv.(ABCIServer).PrepareProposal(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ABCIApplication_PrepareProposal_FullMethodName,
|
||||
FullMethod: ABCI_PrepareProposal_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ABCIApplicationServer).PrepareProposal(ctx, req.(*RequestPrepareProposal))
|
||||
return srv.(ABCIServer).PrepareProposal(ctx, req.(*RequestPrepareProposal))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ABCIApplication_ProcessProposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _ABCI_ProcessProposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RequestProcessProposal)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ABCIApplicationServer).ProcessProposal(ctx, in)
|
||||
return srv.(ABCIServer).ProcessProposal(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ABCIApplication_ProcessProposal_FullMethodName,
|
||||
FullMethod: ABCI_ProcessProposal_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ABCIApplicationServer).ProcessProposal(ctx, req.(*RequestProcessProposal))
|
||||
return srv.(ABCIServer).ProcessProposal(ctx, req.(*RequestProcessProposal))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// ABCIApplication_ServiceDesc is the grpc.ServiceDesc for ABCIApplication service.
|
||||
func _ABCI_ExtendVote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RequestExtendVote)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ABCIServer).ExtendVote(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ABCI_ExtendVote_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ABCIServer).ExtendVote(ctx, req.(*RequestExtendVote))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ABCI_VerifyVoteExtension_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RequestVerifyVoteExtension)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ABCIServer).VerifyVoteExtension(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ABCI_VerifyVoteExtension_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ABCIServer).VerifyVoteExtension(ctx, req.(*RequestVerifyVoteExtension))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ABCI_FinalizeBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RequestFinalizeBlock)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ABCIServer).FinalizeBlock(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ABCI_FinalizeBlock_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ABCIServer).FinalizeBlock(ctx, req.(*RequestFinalizeBlock))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// ABCI_ServiceDesc is the grpc.ServiceDesc for ABCI service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var ABCIApplication_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "tendermint.abci.ABCIApplication",
|
||||
HandlerType: (*ABCIApplicationServer)(nil),
|
||||
var ABCI_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "tendermint.abci.ABCI",
|
||||
HandlerType: (*ABCIServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "Echo",
|
||||
Handler: _ABCIApplication_Echo_Handler,
|
||||
Handler: _ABCI_Echo_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Flush",
|
||||
Handler: _ABCIApplication_Flush_Handler,
|
||||
Handler: _ABCI_Flush_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Info",
|
||||
Handler: _ABCIApplication_Info_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DeliverTx",
|
||||
Handler: _ABCIApplication_DeliverTx_Handler,
|
||||
Handler: _ABCI_Info_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CheckTx",
|
||||
Handler: _ABCIApplication_CheckTx_Handler,
|
||||
Handler: _ABCI_CheckTx_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Query",
|
||||
Handler: _ABCIApplication_Query_Handler,
|
||||
Handler: _ABCI_Query_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Commit",
|
||||
Handler: _ABCIApplication_Commit_Handler,
|
||||
Handler: _ABCI_Commit_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "InitChain",
|
||||
Handler: _ABCIApplication_InitChain_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "BeginBlock",
|
||||
Handler: _ABCIApplication_BeginBlock_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "EndBlock",
|
||||
Handler: _ABCIApplication_EndBlock_Handler,
|
||||
Handler: _ABCI_InitChain_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListSnapshots",
|
||||
Handler: _ABCIApplication_ListSnapshots_Handler,
|
||||
Handler: _ABCI_ListSnapshots_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "OfferSnapshot",
|
||||
Handler: _ABCIApplication_OfferSnapshot_Handler,
|
||||
Handler: _ABCI_OfferSnapshot_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "LoadSnapshotChunk",
|
||||
Handler: _ABCIApplication_LoadSnapshotChunk_Handler,
|
||||
Handler: _ABCI_LoadSnapshotChunk_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ApplySnapshotChunk",
|
||||
Handler: _ABCIApplication_ApplySnapshotChunk_Handler,
|
||||
Handler: _ABCI_ApplySnapshotChunk_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "PrepareProposal",
|
||||
Handler: _ABCIApplication_PrepareProposal_Handler,
|
||||
Handler: _ABCI_PrepareProposal_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ProcessProposal",
|
||||
Handler: _ABCIApplication_ProcessProposal_Handler,
|
||||
Handler: _ABCI_ProcessProposal_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ExtendVote",
|
||||
Handler: _ABCI_ExtendVote_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "VerifyVoteExtension",
|
||||
Handler: _ABCI_VerifyVoteExtension_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "FinalizeBlock",
|
||||
Handler: _ABCI_FinalizeBlock_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
|
||||
@ -20,6 +20,7 @@ var (
|
||||
fd_ConsensusParams_evidence protoreflect.FieldDescriptor
|
||||
fd_ConsensusParams_validator protoreflect.FieldDescriptor
|
||||
fd_ConsensusParams_version protoreflect.FieldDescriptor
|
||||
fd_ConsensusParams_abci protoreflect.FieldDescriptor
|
||||
)
|
||||
|
||||
func init() {
|
||||
@ -29,6 +30,7 @@ func init() {
|
||||
fd_ConsensusParams_evidence = md_ConsensusParams.Fields().ByName("evidence")
|
||||
fd_ConsensusParams_validator = md_ConsensusParams.Fields().ByName("validator")
|
||||
fd_ConsensusParams_version = md_ConsensusParams.Fields().ByName("version")
|
||||
fd_ConsensusParams_abci = md_ConsensusParams.Fields().ByName("abci")
|
||||
}
|
||||
|
||||
var _ protoreflect.Message = (*fastReflection_ConsensusParams)(nil)
|
||||
@ -120,6 +122,12 @@ func (x *fastReflection_ConsensusParams) Range(f func(protoreflect.FieldDescript
|
||||
return
|
||||
}
|
||||
}
|
||||
if x.Abci != nil {
|
||||
value := protoreflect.ValueOfMessage(x.Abci.ProtoReflect())
|
||||
if !f(fd_ConsensusParams_abci, value) {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Has reports whether a field is populated.
|
||||
@ -143,6 +151,8 @@ func (x *fastReflection_ConsensusParams) Has(fd protoreflect.FieldDescriptor) bo
|
||||
return x.Validator != nil
|
||||
case "tendermint.types.ConsensusParams.version":
|
||||
return x.Version != nil
|
||||
case "tendermint.types.ConsensusParams.abci":
|
||||
return x.Abci != nil
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: tendermint.types.ConsensusParams"))
|
||||
@ -167,6 +177,8 @@ func (x *fastReflection_ConsensusParams) Clear(fd protoreflect.FieldDescriptor)
|
||||
x.Validator = nil
|
||||
case "tendermint.types.ConsensusParams.version":
|
||||
x.Version = nil
|
||||
case "tendermint.types.ConsensusParams.abci":
|
||||
x.Abci = nil
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: tendermint.types.ConsensusParams"))
|
||||
@ -195,6 +207,9 @@ func (x *fastReflection_ConsensusParams) Get(descriptor protoreflect.FieldDescri
|
||||
case "tendermint.types.ConsensusParams.version":
|
||||
value := x.Version
|
||||
return protoreflect.ValueOfMessage(value.ProtoReflect())
|
||||
case "tendermint.types.ConsensusParams.abci":
|
||||
value := x.Abci
|
||||
return protoreflect.ValueOfMessage(value.ProtoReflect())
|
||||
default:
|
||||
if descriptor.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: tendermint.types.ConsensusParams"))
|
||||
@ -223,6 +238,8 @@ func (x *fastReflection_ConsensusParams) Set(fd protoreflect.FieldDescriptor, va
|
||||
x.Validator = value.Message().Interface().(*ValidatorParams)
|
||||
case "tendermint.types.ConsensusParams.version":
|
||||
x.Version = value.Message().Interface().(*VersionParams)
|
||||
case "tendermint.types.ConsensusParams.abci":
|
||||
x.Abci = value.Message().Interface().(*ABCIParams)
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: tendermint.types.ConsensusParams"))
|
||||
@ -263,6 +280,11 @@ func (x *fastReflection_ConsensusParams) Mutable(fd protoreflect.FieldDescriptor
|
||||
x.Version = new(VersionParams)
|
||||
}
|
||||
return protoreflect.ValueOfMessage(x.Version.ProtoReflect())
|
||||
case "tendermint.types.ConsensusParams.abci":
|
||||
if x.Abci == nil {
|
||||
x.Abci = new(ABCIParams)
|
||||
}
|
||||
return protoreflect.ValueOfMessage(x.Abci.ProtoReflect())
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: tendermint.types.ConsensusParams"))
|
||||
@ -288,6 +310,9 @@ func (x *fastReflection_ConsensusParams) NewField(fd protoreflect.FieldDescripto
|
||||
case "tendermint.types.ConsensusParams.version":
|
||||
m := new(VersionParams)
|
||||
return protoreflect.ValueOfMessage(m.ProtoReflect())
|
||||
case "tendermint.types.ConsensusParams.abci":
|
||||
m := new(ABCIParams)
|
||||
return protoreflect.ValueOfMessage(m.ProtoReflect())
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: tendermint.types.ConsensusParams"))
|
||||
@ -373,6 +398,10 @@ func (x *fastReflection_ConsensusParams) ProtoMethods() *protoiface.Methods {
|
||||
l = options.Size(x.Version)
|
||||
n += 1 + l + runtime.Sov(uint64(l))
|
||||
}
|
||||
if x.Abci != nil {
|
||||
l = options.Size(x.Abci)
|
||||
n += 1 + l + runtime.Sov(uint64(l))
|
||||
}
|
||||
if x.unknownFields != nil {
|
||||
n += len(x.unknownFields)
|
||||
}
|
||||
@ -402,6 +431,20 @@ func (x *fastReflection_ConsensusParams) ProtoMethods() *protoiface.Methods {
|
||||
i -= len(x.unknownFields)
|
||||
copy(dAtA[i:], x.unknownFields)
|
||||
}
|
||||
if x.Abci != nil {
|
||||
encoded, err := options.Marshal(x.Abci)
|
||||
if err != nil {
|
||||
return protoiface.MarshalOutput{
|
||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||
Buf: input.Buf,
|
||||
}, err
|
||||
}
|
||||
i -= len(encoded)
|
||||
copy(dAtA[i:], encoded)
|
||||
i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded)))
|
||||
i--
|
||||
dAtA[i] = 0x2a
|
||||
}
|
||||
if x.Version != nil {
|
||||
encoded, err := options.Marshal(x.Version)
|
||||
if err != nil {
|
||||
@ -651,6 +694,42 @@ func (x *fastReflection_ConsensusParams) ProtoMethods() *protoiface.Methods {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
case 5:
|
||||
if wireType != 2 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Abci", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex < 0 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||
}
|
||||
if postIndex > l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
if x.Abci == nil {
|
||||
x.Abci = &ABCIParams{}
|
||||
}
|
||||
if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Abci); err != nil {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := runtime.Skip(dAtA[iNdEx:])
|
||||
@ -3005,6 +3084,410 @@ func (x *fastReflection_HashedParams) ProtoMethods() *protoiface.Methods {
|
||||
}
|
||||
}
|
||||
|
||||
var (
|
||||
md_ABCIParams protoreflect.MessageDescriptor
|
||||
fd_ABCIParams_vote_extensions_enable_height protoreflect.FieldDescriptor
|
||||
)
|
||||
|
||||
func init() {
|
||||
file_tendermint_types_params_proto_init()
|
||||
md_ABCIParams = File_tendermint_types_params_proto.Messages().ByName("ABCIParams")
|
||||
fd_ABCIParams_vote_extensions_enable_height = md_ABCIParams.Fields().ByName("vote_extensions_enable_height")
|
||||
}
|
||||
|
||||
var _ protoreflect.Message = (*fastReflection_ABCIParams)(nil)
|
||||
|
||||
type fastReflection_ABCIParams ABCIParams
|
||||
|
||||
func (x *ABCIParams) ProtoReflect() protoreflect.Message {
|
||||
return (*fastReflection_ABCIParams)(x)
|
||||
}
|
||||
|
||||
func (x *ABCIParams) slowProtoReflect() protoreflect.Message {
|
||||
mi := &file_tendermint_types_params_proto_msgTypes[6]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
var _fastReflection_ABCIParams_messageType fastReflection_ABCIParams_messageType
|
||||
var _ protoreflect.MessageType = fastReflection_ABCIParams_messageType{}
|
||||
|
||||
type fastReflection_ABCIParams_messageType struct{}
|
||||
|
||||
func (x fastReflection_ABCIParams_messageType) Zero() protoreflect.Message {
|
||||
return (*fastReflection_ABCIParams)(nil)
|
||||
}
|
||||
func (x fastReflection_ABCIParams_messageType) New() protoreflect.Message {
|
||||
return new(fastReflection_ABCIParams)
|
||||
}
|
||||
func (x fastReflection_ABCIParams_messageType) Descriptor() protoreflect.MessageDescriptor {
|
||||
return md_ABCIParams
|
||||
}
|
||||
|
||||
// Descriptor returns message descriptor, which contains only the protobuf
|
||||
// type information for the message.
|
||||
func (x *fastReflection_ABCIParams) Descriptor() protoreflect.MessageDescriptor {
|
||||
return md_ABCIParams
|
||||
}
|
||||
|
||||
// Type returns the message type, which encapsulates both Go and protobuf
|
||||
// type information. If the Go type information is not needed,
|
||||
// it is recommended that the message descriptor be used instead.
|
||||
func (x *fastReflection_ABCIParams) Type() protoreflect.MessageType {
|
||||
return _fastReflection_ABCIParams_messageType
|
||||
}
|
||||
|
||||
// New returns a newly allocated and mutable empty message.
|
||||
func (x *fastReflection_ABCIParams) New() protoreflect.Message {
|
||||
return new(fastReflection_ABCIParams)
|
||||
}
|
||||
|
||||
// Interface unwraps the message reflection interface and
|
||||
// returns the underlying ProtoMessage interface.
|
||||
func (x *fastReflection_ABCIParams) Interface() protoreflect.ProtoMessage {
|
||||
return (*ABCIParams)(x)
|
||||
}
|
||||
|
||||
// Range iterates over every populated field in an undefined order,
|
||||
// calling f for each field descriptor and value encountered.
|
||||
// Range returns immediately if f returns false.
|
||||
// While iterating, mutating operations may only be performed
|
||||
// on the current field descriptor.
|
||||
func (x *fastReflection_ABCIParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
|
||||
if x.VoteExtensionsEnableHeight != int64(0) {
|
||||
value := protoreflect.ValueOfInt64(x.VoteExtensionsEnableHeight)
|
||||
if !f(fd_ABCIParams_vote_extensions_enable_height, value) {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Has reports whether a field is populated.
|
||||
//
|
||||
// Some fields have the property of nullability where it is possible to
|
||||
// distinguish between the default value of a field and whether the field
|
||||
// was explicitly populated with the default value. Singular message fields,
|
||||
// member fields of a oneof, and proto2 scalar fields are nullable. Such
|
||||
// fields are populated only if explicitly set.
|
||||
//
|
||||
// In other cases (aside from the nullable cases above),
|
||||
// a proto3 scalar field is populated if it contains a non-zero value, and
|
||||
// a repeated field is populated if it is non-empty.
|
||||
func (x *fastReflection_ABCIParams) Has(fd protoreflect.FieldDescriptor) bool {
|
||||
switch fd.FullName() {
|
||||
case "tendermint.types.ABCIParams.vote_extensions_enable_height":
|
||||
return x.VoteExtensionsEnableHeight != int64(0)
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: tendermint.types.ABCIParams"))
|
||||
}
|
||||
panic(fmt.Errorf("message tendermint.types.ABCIParams does not contain field %s", fd.FullName()))
|
||||
}
|
||||
}
|
||||
|
||||
// Clear clears the field such that a subsequent Has call reports false.
|
||||
//
|
||||
// Clearing an extension field clears both the extension type and value
|
||||
// associated with the given field number.
|
||||
//
|
||||
// Clear is a mutating operation and unsafe for concurrent use.
|
||||
func (x *fastReflection_ABCIParams) Clear(fd protoreflect.FieldDescriptor) {
|
||||
switch fd.FullName() {
|
||||
case "tendermint.types.ABCIParams.vote_extensions_enable_height":
|
||||
x.VoteExtensionsEnableHeight = int64(0)
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: tendermint.types.ABCIParams"))
|
||||
}
|
||||
panic(fmt.Errorf("message tendermint.types.ABCIParams does not contain field %s", fd.FullName()))
|
||||
}
|
||||
}
|
||||
|
||||
// Get retrieves the value for a field.
|
||||
//
|
||||
// For unpopulated scalars, it returns the default value, where
|
||||
// the default value of a bytes scalar is guaranteed to be a copy.
|
||||
// For unpopulated composite types, it returns an empty, read-only view
|
||||
// of the value; to obtain a mutable reference, use Mutable.
|
||||
func (x *fastReflection_ABCIParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
switch descriptor.FullName() {
|
||||
case "tendermint.types.ABCIParams.vote_extensions_enable_height":
|
||||
value := x.VoteExtensionsEnableHeight
|
||||
return protoreflect.ValueOfInt64(value)
|
||||
default:
|
||||
if descriptor.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: tendermint.types.ABCIParams"))
|
||||
}
|
||||
panic(fmt.Errorf("message tendermint.types.ABCIParams does not contain field %s", descriptor.FullName()))
|
||||
}
|
||||
}
|
||||
|
||||
// Set stores the value for a field.
|
||||
//
|
||||
// For a field belonging to a oneof, it implicitly clears any other field
|
||||
// that may be currently set within the same oneof.
|
||||
// For extension fields, it implicitly stores the provided ExtensionType.
|
||||
// When setting a composite type, it is unspecified whether the stored value
|
||||
// aliases the source's memory in any way. If the composite value is an
|
||||
// empty, read-only value, then it panics.
|
||||
//
|
||||
// Set is a mutating operation and unsafe for concurrent use.
|
||||
func (x *fastReflection_ABCIParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
|
||||
switch fd.FullName() {
|
||||
case "tendermint.types.ABCIParams.vote_extensions_enable_height":
|
||||
x.VoteExtensionsEnableHeight = value.Int()
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: tendermint.types.ABCIParams"))
|
||||
}
|
||||
panic(fmt.Errorf("message tendermint.types.ABCIParams does not contain field %s", fd.FullName()))
|
||||
}
|
||||
}
|
||||
|
||||
// Mutable returns a mutable reference to a composite type.
|
||||
//
|
||||
// If the field is unpopulated, it may allocate a composite value.
|
||||
// For a field belonging to a oneof, it implicitly clears any other field
|
||||
// that may be currently set within the same oneof.
|
||||
// For extension fields, it implicitly stores the provided ExtensionType
|
||||
// if not already stored.
|
||||
// It panics if the field does not contain a composite type.
|
||||
//
|
||||
// Mutable is a mutating operation and unsafe for concurrent use.
|
||||
func (x *fastReflection_ABCIParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
switch fd.FullName() {
|
||||
case "tendermint.types.ABCIParams.vote_extensions_enable_height":
|
||||
panic(fmt.Errorf("field vote_extensions_enable_height of message tendermint.types.ABCIParams is not mutable"))
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: tendermint.types.ABCIParams"))
|
||||
}
|
||||
panic(fmt.Errorf("message tendermint.types.ABCIParams does not contain field %s", fd.FullName()))
|
||||
}
|
||||
}
|
||||
|
||||
// NewField returns a new value that is assignable to the field
|
||||
// for the given descriptor. For scalars, this returns the default value.
|
||||
// For lists, maps, and messages, this returns a new, empty, mutable value.
|
||||
func (x *fastReflection_ABCIParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
switch fd.FullName() {
|
||||
case "tendermint.types.ABCIParams.vote_extensions_enable_height":
|
||||
return protoreflect.ValueOfInt64(int64(0))
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: tendermint.types.ABCIParams"))
|
||||
}
|
||||
panic(fmt.Errorf("message tendermint.types.ABCIParams does not contain field %s", fd.FullName()))
|
||||
}
|
||||
}
|
||||
|
||||
// WhichOneof reports which field within the oneof is populated,
|
||||
// returning nil if none are populated.
|
||||
// It panics if the oneof descriptor does not belong to this message.
|
||||
func (x *fastReflection_ABCIParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
|
||||
switch d.FullName() {
|
||||
default:
|
||||
panic(fmt.Errorf("%s is not a oneof field in tendermint.types.ABCIParams", d.FullName()))
|
||||
}
|
||||
panic("unreachable")
|
||||
}
|
||||
|
||||
// GetUnknown retrieves the entire list of unknown fields.
|
||||
// The caller may only mutate the contents of the RawFields
|
||||
// if the mutated bytes are stored back into the message with SetUnknown.
|
||||
func (x *fastReflection_ABCIParams) GetUnknown() protoreflect.RawFields {
|
||||
return x.unknownFields
|
||||
}
|
||||
|
||||
// SetUnknown stores an entire list of unknown fields.
|
||||
// The raw fields must be syntactically valid according to the wire format.
|
||||
// An implementation may panic if this is not the case.
|
||||
// Once stored, the caller must not mutate the content of the RawFields.
|
||||
// An empty RawFields may be passed to clear the fields.
|
||||
//
|
||||
// SetUnknown is a mutating operation and unsafe for concurrent use.
|
||||
func (x *fastReflection_ABCIParams) SetUnknown(fields protoreflect.RawFields) {
|
||||
x.unknownFields = fields
|
||||
}
|
||||
|
||||
// IsValid reports whether the message is valid.
|
||||
//
|
||||
// An invalid message is an empty, read-only value.
|
||||
//
|
||||
// An invalid message often corresponds to a nil pointer of the concrete
|
||||
// message type, but the details are implementation dependent.
|
||||
// Validity is not part of the protobuf data model, and may not
|
||||
// be preserved in marshaling or other operations.
|
||||
func (x *fastReflection_ABCIParams) IsValid() bool {
|
||||
return x != nil
|
||||
}
|
||||
|
||||
// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations.
|
||||
// This method may return nil.
|
||||
//
|
||||
// The returned methods type is identical to
|
||||
// "google.golang.org/protobuf/runtime/protoiface".Methods.
|
||||
// Consult the protoiface package documentation for details.
|
||||
func (x *fastReflection_ABCIParams) ProtoMethods() *protoiface.Methods {
|
||||
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
|
||||
x := input.Message.Interface().(*ABCIParams)
|
||||
if x == nil {
|
||||
return protoiface.SizeOutput{
|
||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||
Size: 0,
|
||||
}
|
||||
}
|
||||
options := runtime.SizeInputToOptions(input)
|
||||
_ = options
|
||||
var n int
|
||||
var l int
|
||||
_ = l
|
||||
if x.VoteExtensionsEnableHeight != 0 {
|
||||
n += 1 + runtime.Sov(uint64(x.VoteExtensionsEnableHeight))
|
||||
}
|
||||
if x.unknownFields != nil {
|
||||
n += len(x.unknownFields)
|
||||
}
|
||||
return protoiface.SizeOutput{
|
||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||
Size: n,
|
||||
}
|
||||
}
|
||||
|
||||
marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) {
|
||||
x := input.Message.Interface().(*ABCIParams)
|
||||
if x == nil {
|
||||
return protoiface.MarshalOutput{
|
||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||
Buf: input.Buf,
|
||||
}, nil
|
||||
}
|
||||
options := runtime.MarshalInputToOptions(input)
|
||||
_ = options
|
||||
size := options.Size(x)
|
||||
dAtA := make([]byte, size)
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if x.unknownFields != nil {
|
||||
i -= len(x.unknownFields)
|
||||
copy(dAtA[i:], x.unknownFields)
|
||||
}
|
||||
if x.VoteExtensionsEnableHeight != 0 {
|
||||
i = runtime.EncodeVarint(dAtA, i, uint64(x.VoteExtensionsEnableHeight))
|
||||
i--
|
||||
dAtA[i] = 0x8
|
||||
}
|
||||
if input.Buf != nil {
|
||||
input.Buf = append(input.Buf, dAtA...)
|
||||
} else {
|
||||
input.Buf = dAtA
|
||||
}
|
||||
return protoiface.MarshalOutput{
|
||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||
Buf: input.Buf,
|
||||
}, nil
|
||||
}
|
||||
unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) {
|
||||
x := input.Message.Interface().(*ABCIParams)
|
||||
if x == nil {
|
||||
return protoiface.UnmarshalOutput{
|
||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||
Flags: input.Flags,
|
||||
}, nil
|
||||
}
|
||||
options := runtime.UnmarshalInputToOptions(input)
|
||||
_ = options
|
||||
dAtA := input.Buf
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ABCIParams: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ABCIParams: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 0 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field VoteExtensionsEnableHeight", wireType)
|
||||
}
|
||||
x.VoteExtensionsEnableHeight = 0
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
x.VoteExtensionsEnableHeight |= int64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := runtime.Skip(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
|
||||
}
|
||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
if !options.DiscardUnknown {
|
||||
x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil
|
||||
}
|
||||
return &protoiface.Methods{
|
||||
NoUnkeyedLiterals: struct{}{},
|
||||
Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown,
|
||||
Size: size,
|
||||
Marshal: marshal,
|
||||
Unmarshal: unmarshal,
|
||||
Merge: nil,
|
||||
CheckInitialized: nil,
|
||||
}
|
||||
}
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.27.0
|
||||
@ -3029,6 +3512,7 @@ type ConsensusParams struct {
|
||||
Evidence *EvidenceParams `protobuf:"bytes,2,opt,name=evidence,proto3" json:"evidence,omitempty"`
|
||||
Validator *ValidatorParams `protobuf:"bytes,3,opt,name=validator,proto3" json:"validator,omitempty"`
|
||||
Version *VersionParams `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"`
|
||||
Abci *ABCIParams `protobuf:"bytes,5,opt,name=abci,proto3" json:"abci,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ConsensusParams) Reset() {
|
||||
@ -3079,6 +3563,13 @@ func (x *ConsensusParams) GetVersion() *VersionParams {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ConsensusParams) GetAbci() *ABCIParams {
|
||||
if x != nil {
|
||||
return x.Abci
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// BlockParams contains limits on the block size.
|
||||
type BlockParams struct {
|
||||
state protoimpl.MessageState
|
||||
@ -3310,6 +3801,51 @@ func (x *HashedParams) GetBlockMaxGas() int64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
// ABCIParams configure functionality specific to the Application Blockchain Interface.
|
||||
type ABCIParams struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// vote_extensions_enable_height configures the first height during which
|
||||
// vote extensions will be enabled. During this specified height, and for all
|
||||
// subsequent heights, precommit messages that do not contain valid extension data
|
||||
// will be considered invalid. Prior to this height, vote extensions will not
|
||||
// be used or accepted by validators on the network.
|
||||
//
|
||||
// Once enabled, vote extensions will be created by the application in ExtendVote,
|
||||
// passed to the application for validation in VerifyVoteExtension and given
|
||||
// to the application to use when proposing a block during PrepareProposal.
|
||||
VoteExtensionsEnableHeight int64 `protobuf:"varint,1,opt,name=vote_extensions_enable_height,json=voteExtensionsEnableHeight,proto3" json:"vote_extensions_enable_height,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ABCIParams) Reset() {
|
||||
*x = ABCIParams{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_tendermint_types_params_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ABCIParams) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ABCIParams) ProtoMessage() {}
|
||||
|
||||
// Deprecated: Use ABCIParams.ProtoReflect.Descriptor instead.
|
||||
func (*ABCIParams) Descriptor() ([]byte, []int) {
|
||||
return file_tendermint_types_params_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
func (x *ABCIParams) GetVoteExtensionsEnableHeight() int64 {
|
||||
if x != nil {
|
||||
return x.VoteExtensionsEnableHeight
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_tendermint_types_params_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_tendermint_types_params_proto_rawDesc = []byte{
|
||||
@ -3319,7 +3855,7 @@ var file_tendermint_types_params_proto_rawDesc = []byte{
|
||||
0x73, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67,
|
||||
0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x80, 0x02, 0x0a, 0x0f, 0x43, 0x6f, 0x6e, 0x73,
|
||||
0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb2, 0x02, 0x0a, 0x0f, 0x43, 0x6f, 0x6e, 0x73,
|
||||
0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x33, 0x0a, 0x05, 0x62,
|
||||
0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x74, 0x65, 0x6e,
|
||||
0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x42, 0x6c,
|
||||
@ -3335,47 +3871,55 @@ var file_tendermint_types_params_proto_rawDesc = []byte{
|
||||
0x39, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b,
|
||||
0x32, 0x1f, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79,
|
||||
0x70, 0x65, 0x73, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d,
|
||||
0x73, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x49, 0x0a, 0x0b, 0x42, 0x6c,
|
||||
0x6f, 0x63, 0x6b, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78,
|
||||
0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x61,
|
||||
0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x5f, 0x67, 0x61,
|
||||
0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6d, 0x61, 0x78, 0x47, 0x61, 0x73, 0x4a,
|
||||
0x04, 0x08, 0x03, 0x10, 0x04, 0x22, 0xa9, 0x01, 0x0a, 0x0e, 0x45, 0x76, 0x69, 0x64, 0x65, 0x6e,
|
||||
0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x2b, 0x0a, 0x12, 0x6d, 0x61, 0x78, 0x5f,
|
||||
0x61, 0x67, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x6d, 0x61, 0x78, 0x41, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x42,
|
||||
0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x4d, 0x0a, 0x10, 0x6d, 0x61, 0x78, 0x5f, 0x61, 0x67, 0x65,
|
||||
0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
||||
0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
|
||||
0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00,
|
||||
0x98, 0xdf, 0x1f, 0x01, 0x52, 0x0e, 0x6d, 0x61, 0x78, 0x41, 0x67, 0x65, 0x44, 0x75, 0x72, 0x61,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x62, 0x79, 0x74, 0x65,
|
||||
0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x42, 0x79, 0x74, 0x65,
|
||||
0x73, 0x22, 0x3f, 0x0a, 0x0f, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x61,
|
||||
0x72, 0x61, 0x6d, 0x73, 0x12, 0x22, 0x0a, 0x0d, 0x70, 0x75, 0x62, 0x5f, 0x6b, 0x65, 0x79, 0x5f,
|
||||
0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x75, 0x62,
|
||||
0x4b, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x73, 0x3a, 0x08, 0xb8, 0xa0, 0x1f, 0x01, 0xe8, 0xa0,
|
||||
0x1f, 0x01, 0x22, 0x2b, 0x0a, 0x0d, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x72,
|
||||
0x61, 0x6d, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x70, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04,
|
||||
0x52, 0x03, 0x61, 0x70, 0x70, 0x3a, 0x08, 0xb8, 0xa0, 0x1f, 0x01, 0xe8, 0xa0, 0x1f, 0x01, 0x22,
|
||||
0x5a, 0x0a, 0x0c, 0x48, 0x61, 0x73, 0x68, 0x65, 0x64, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12,
|
||||
0x26, 0x0a, 0x0f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6d, 0x61, 0x78, 0x5f, 0x62, 0x79, 0x74,
|
||||
0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4d,
|
||||
0x61, 0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x22, 0x0a, 0x0d, 0x62, 0x6c, 0x6f, 0x63, 0x6b,
|
||||
0x5f, 0x6d, 0x61, 0x78, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b,
|
||||
0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4d, 0x61, 0x78, 0x47, 0x61, 0x73, 0x42, 0xab, 0x01, 0x0a, 0x14,
|
||||
0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74,
|
||||
0x79, 0x70, 0x65, 0x73, 0x42, 0x0b, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x50, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x50, 0x01, 0x5a, 0x21, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69,
|
||||
0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74,
|
||||
0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0xa2, 0x02, 0x03, 0x54, 0x54, 0x58, 0xaa, 0x02, 0x10, 0x54,
|
||||
0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x73, 0xca,
|
||||
0x02, 0x10, 0x54, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x5c, 0x54, 0x79, 0x70,
|
||||
0x65, 0x73, 0xe2, 0x02, 0x1c, 0x54, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x5c,
|
||||
0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74,
|
||||
0x61, 0xea, 0x02, 0x11, 0x54, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x3a, 0x3a,
|
||||
0x54, 0x79, 0x70, 0x65, 0x73, 0xa8, 0xe2, 0x1e, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x33,
|
||||
0x73, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x30, 0x0a, 0x04, 0x61, 0x62,
|
||||
0x63, 0x69, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65,
|
||||
0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x41, 0x42, 0x43, 0x49,
|
||||
0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x04, 0x61, 0x62, 0x63, 0x69, 0x22, 0x49, 0x0a, 0x0b,
|
||||
0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6d,
|
||||
0x61, 0x78, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08,
|
||||
0x6d, 0x61, 0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x5f,
|
||||
0x67, 0x61, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6d, 0x61, 0x78, 0x47, 0x61,
|
||||
0x73, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x22, 0xa9, 0x01, 0x0a, 0x0e, 0x45, 0x76, 0x69, 0x64,
|
||||
0x65, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x2b, 0x0a, 0x12, 0x6d, 0x61,
|
||||
0x78, 0x5f, 0x61, 0x67, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x6d, 0x61, 0x78, 0x41, 0x67, 0x65, 0x4e, 0x75,
|
||||
0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x4d, 0x0a, 0x10, 0x6d, 0x61, 0x78, 0x5f, 0x61,
|
||||
0x67, 0x65, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x08, 0xc8, 0xde,
|
||||
0x1f, 0x00, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x0e, 0x6d, 0x61, 0x78, 0x41, 0x67, 0x65, 0x44, 0x75,
|
||||
0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x62, 0x79,
|
||||
0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x42, 0x79,
|
||||
0x74, 0x65, 0x73, 0x22, 0x3f, 0x0a, 0x0f, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72,
|
||||
0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x22, 0x0a, 0x0d, 0x70, 0x75, 0x62, 0x5f, 0x6b, 0x65,
|
||||
0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x70,
|
||||
0x75, 0x62, 0x4b, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x73, 0x3a, 0x08, 0xb8, 0xa0, 0x1f, 0x01,
|
||||
0xe8, 0xa0, 0x1f, 0x01, 0x22, 0x2b, 0x0a, 0x0d, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x50,
|
||||
0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x70, 0x70, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x04, 0x52, 0x03, 0x61, 0x70, 0x70, 0x3a, 0x08, 0xb8, 0xa0, 0x1f, 0x01, 0xe8, 0xa0, 0x1f,
|
||||
0x01, 0x22, 0x5a, 0x0a, 0x0c, 0x48, 0x61, 0x73, 0x68, 0x65, 0x64, 0x50, 0x61, 0x72, 0x61, 0x6d,
|
||||
0x73, 0x12, 0x26, 0x0a, 0x0f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6d, 0x61, 0x78, 0x5f, 0x62,
|
||||
0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x62, 0x6c, 0x6f, 0x63,
|
||||
0x6b, 0x4d, 0x61, 0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x22, 0x0a, 0x0d, 0x62, 0x6c, 0x6f,
|
||||
0x63, 0x6b, 0x5f, 0x6d, 0x61, 0x78, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03,
|
||||
0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4d, 0x61, 0x78, 0x47, 0x61, 0x73, 0x22, 0x4f, 0x0a,
|
||||
0x0a, 0x41, 0x42, 0x43, 0x49, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x41, 0x0a, 0x1d, 0x76,
|
||||
0x6f, 0x74, 0x65, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x65,
|
||||
0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x03, 0x52, 0x1a, 0x76, 0x6f, 0x74, 0x65, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f,
|
||||
0x6e, 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x42, 0xab,
|
||||
0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e,
|
||||
0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x42, 0x0b, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x50,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x21, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64,
|
||||
0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d,
|
||||
0x69, 0x6e, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0xa2, 0x02, 0x03, 0x54, 0x54, 0x58, 0xaa,
|
||||
0x02, 0x10, 0x54, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x54, 0x79, 0x70,
|
||||
0x65, 0x73, 0xca, 0x02, 0x10, 0x54, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x5c,
|
||||
0x54, 0x79, 0x70, 0x65, 0x73, 0xe2, 0x02, 0x1c, 0x54, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69,
|
||||
0x6e, 0x74, 0x5c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61,
|
||||
0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x54, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e,
|
||||
0x74, 0x3a, 0x3a, 0x54, 0x79, 0x70, 0x65, 0x73, 0xa8, 0xe2, 0x1e, 0x01, 0x62, 0x06, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
@ -3390,7 +3934,7 @@ func file_tendermint_types_params_proto_rawDescGZIP() []byte {
|
||||
return file_tendermint_types_params_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_tendermint_types_params_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
||||
var file_tendermint_types_params_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
|
||||
var file_tendermint_types_params_proto_goTypes = []interface{}{
|
||||
(*ConsensusParams)(nil), // 0: tendermint.types.ConsensusParams
|
||||
(*BlockParams)(nil), // 1: tendermint.types.BlockParams
|
||||
@ -3398,19 +3942,21 @@ var file_tendermint_types_params_proto_goTypes = []interface{}{
|
||||
(*ValidatorParams)(nil), // 3: tendermint.types.ValidatorParams
|
||||
(*VersionParams)(nil), // 4: tendermint.types.VersionParams
|
||||
(*HashedParams)(nil), // 5: tendermint.types.HashedParams
|
||||
(*durationpb.Duration)(nil), // 6: google.protobuf.Duration
|
||||
(*ABCIParams)(nil), // 6: tendermint.types.ABCIParams
|
||||
(*durationpb.Duration)(nil), // 7: google.protobuf.Duration
|
||||
}
|
||||
var file_tendermint_types_params_proto_depIdxs = []int32{
|
||||
1, // 0: tendermint.types.ConsensusParams.block:type_name -> tendermint.types.BlockParams
|
||||
2, // 1: tendermint.types.ConsensusParams.evidence:type_name -> tendermint.types.EvidenceParams
|
||||
3, // 2: tendermint.types.ConsensusParams.validator:type_name -> tendermint.types.ValidatorParams
|
||||
4, // 3: tendermint.types.ConsensusParams.version:type_name -> tendermint.types.VersionParams
|
||||
6, // 4: tendermint.types.EvidenceParams.max_age_duration:type_name -> google.protobuf.Duration
|
||||
5, // [5:5] is the sub-list for method output_type
|
||||
5, // [5:5] is the sub-list for method input_type
|
||||
5, // [5:5] is the sub-list for extension type_name
|
||||
5, // [5:5] is the sub-list for extension extendee
|
||||
0, // [0:5] is the sub-list for field type_name
|
||||
6, // 4: tendermint.types.ConsensusParams.abci:type_name -> tendermint.types.ABCIParams
|
||||
7, // 5: tendermint.types.EvidenceParams.max_age_duration:type_name -> google.protobuf.Duration
|
||||
6, // [6:6] is the sub-list for method output_type
|
||||
6, // [6:6] is the sub-list for method input_type
|
||||
6, // [6:6] is the sub-list for extension type_name
|
||||
6, // [6:6] is the sub-list for extension extendee
|
||||
0, // [0:6] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_tendermint_types_params_proto_init() }
|
||||
@ -3491,6 +4037,18 @@ func file_tendermint_types_params_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_tendermint_types_params_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ABCIParams); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
@ -3498,7 +4056,7 @@ func file_tendermint_types_params_proto_init() {
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_tendermint_types_params_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 6,
|
||||
NumMessages: 7,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1728,6 +1728,59 @@ const (
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// BlockIdFlag indicates which BlockID the signature is for
|
||||
type BlockIDFlag int32
|
||||
|
||||
const (
|
||||
BlockIDFlag_BLOCK_ID_FLAG_UNKNOWN BlockIDFlag = 0 // indicates an error condition
|
||||
BlockIDFlag_BLOCK_ID_FLAG_ABSENT BlockIDFlag = 1 // the vote was not received
|
||||
BlockIDFlag_BLOCK_ID_FLAG_COMMIT BlockIDFlag = 2 // voted for the block that received the majority
|
||||
BlockIDFlag_BLOCK_ID_FLAG_NIL BlockIDFlag = 3 // voted for nil
|
||||
)
|
||||
|
||||
// Enum value maps for BlockIDFlag.
|
||||
var (
|
||||
BlockIDFlag_name = map[int32]string{
|
||||
0: "BLOCK_ID_FLAG_UNKNOWN",
|
||||
1: "BLOCK_ID_FLAG_ABSENT",
|
||||
2: "BLOCK_ID_FLAG_COMMIT",
|
||||
3: "BLOCK_ID_FLAG_NIL",
|
||||
}
|
||||
BlockIDFlag_value = map[string]int32{
|
||||
"BLOCK_ID_FLAG_UNKNOWN": 0,
|
||||
"BLOCK_ID_FLAG_ABSENT": 1,
|
||||
"BLOCK_ID_FLAG_COMMIT": 2,
|
||||
"BLOCK_ID_FLAG_NIL": 3,
|
||||
}
|
||||
)
|
||||
|
||||
func (x BlockIDFlag) Enum() *BlockIDFlag {
|
||||
p := new(BlockIDFlag)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x BlockIDFlag) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (BlockIDFlag) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_tendermint_types_validator_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (BlockIDFlag) Type() protoreflect.EnumType {
|
||||
return &file_tendermint_types_validator_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x BlockIDFlag) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use BlockIDFlag.Descriptor instead.
|
||||
func (BlockIDFlag) EnumDescriptor() ([]byte, []int) {
|
||||
return file_tendermint_types_validator_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
type ValidatorSet struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
@ -1919,19 +1972,32 @@ var file_tendermint_types_validator_proto_rawDesc = []byte{
|
||||
0x69, 0x6e, 0x74, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69,
|
||||
0x63, 0x4b, 0x65, 0x79, 0x52, 0x06, 0x70, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x12, 0x21, 0x0a, 0x0c,
|
||||
0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01,
|
||||
0x28, 0x03, 0x52, 0x0b, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x42,
|
||||
0xaa, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69,
|
||||
0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x42, 0x0e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61,
|
||||
0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x21, 0x63, 0x6f, 0x73, 0x6d,
|
||||
0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x65, 0x6e,
|
||||
0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0xa2, 0x02, 0x03,
|
||||
0x54, 0x54, 0x58, 0xaa, 0x02, 0x10, 0x54, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74,
|
||||
0x2e, 0x54, 0x79, 0x70, 0x65, 0x73, 0xca, 0x02, 0x10, 0x54, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d,
|
||||
0x69, 0x6e, 0x74, 0x5c, 0x54, 0x79, 0x70, 0x65, 0x73, 0xe2, 0x02, 0x1c, 0x54, 0x65, 0x6e, 0x64,
|
||||
0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x5c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x47, 0x50, 0x42,
|
||||
0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x54, 0x65, 0x6e, 0x64, 0x65,
|
||||
0x72, 0x6d, 0x69, 0x6e, 0x74, 0x3a, 0x3a, 0x54, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x33,
|
||||
0x28, 0x03, 0x52, 0x0b, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x2a,
|
||||
0xd7, 0x01, 0x0a, 0x0b, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x44, 0x46, 0x6c, 0x61, 0x67, 0x12,
|
||||
0x31, 0x0a, 0x15, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x5f, 0x49, 0x44, 0x5f, 0x46, 0x4c, 0x41, 0x47,
|
||||
0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x1a, 0x16, 0x8a, 0x9d, 0x20, 0x12,
|
||||
0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x44, 0x46, 0x6c, 0x61, 0x67, 0x55, 0x6e, 0x6b, 0x6e, 0x6f,
|
||||
0x77, 0x6e, 0x12, 0x2f, 0x0a, 0x14, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x5f, 0x49, 0x44, 0x5f, 0x46,
|
||||
0x4c, 0x41, 0x47, 0x5f, 0x41, 0x42, 0x53, 0x45, 0x4e, 0x54, 0x10, 0x01, 0x1a, 0x15, 0x8a, 0x9d,
|
||||
0x20, 0x11, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x44, 0x46, 0x6c, 0x61, 0x67, 0x41, 0x62, 0x73,
|
||||
0x65, 0x6e, 0x74, 0x12, 0x2f, 0x0a, 0x14, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x5f, 0x49, 0x44, 0x5f,
|
||||
0x46, 0x4c, 0x41, 0x47, 0x5f, 0x43, 0x4f, 0x4d, 0x4d, 0x49, 0x54, 0x10, 0x02, 0x1a, 0x15, 0x8a,
|
||||
0x9d, 0x20, 0x11, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x44, 0x46, 0x6c, 0x61, 0x67, 0x43, 0x6f,
|
||||
0x6d, 0x6d, 0x69, 0x74, 0x12, 0x29, 0x0a, 0x11, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x5f, 0x49, 0x44,
|
||||
0x5f, 0x46, 0x4c, 0x41, 0x47, 0x5f, 0x4e, 0x49, 0x4c, 0x10, 0x03, 0x1a, 0x12, 0x8a, 0x9d, 0x20,
|
||||
0x0e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x44, 0x46, 0x6c, 0x61, 0x67, 0x4e, 0x69, 0x6c, 0x1a,
|
||||
0x08, 0x88, 0xa3, 0x1e, 0x00, 0xa8, 0xa4, 0x1e, 0x01, 0x42, 0xaa, 0x01, 0x0a, 0x14, 0x63, 0x6f,
|
||||
0x6d, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70,
|
||||
0x65, 0x73, 0x42, 0x0e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x50, 0x01, 0x5a, 0x21, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e,
|
||||
0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e,
|
||||
0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0xa2, 0x02, 0x03, 0x54, 0x54, 0x58, 0xaa, 0x02, 0x10,
|
||||
0x54, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x73,
|
||||
0xca, 0x02, 0x10, 0x54, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x5c, 0x54, 0x79,
|
||||
0x70, 0x65, 0x73, 0xe2, 0x02, 0x1c, 0x54, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74,
|
||||
0x5c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61,
|
||||
0x74, 0x61, 0xea, 0x02, 0x11, 0x54, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x3a,
|
||||
0x3a, 0x54, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
@ -1946,18 +2012,20 @@ func file_tendermint_types_validator_proto_rawDescGZIP() []byte {
|
||||
return file_tendermint_types_validator_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_tendermint_types_validator_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_tendermint_types_validator_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
||||
var file_tendermint_types_validator_proto_goTypes = []interface{}{
|
||||
(*ValidatorSet)(nil), // 0: tendermint.types.ValidatorSet
|
||||
(*Validator)(nil), // 1: tendermint.types.Validator
|
||||
(*SimpleValidator)(nil), // 2: tendermint.types.SimpleValidator
|
||||
(*crypto.PublicKey)(nil), // 3: tendermint.crypto.PublicKey
|
||||
(BlockIDFlag)(0), // 0: tendermint.types.BlockIDFlag
|
||||
(*ValidatorSet)(nil), // 1: tendermint.types.ValidatorSet
|
||||
(*Validator)(nil), // 2: tendermint.types.Validator
|
||||
(*SimpleValidator)(nil), // 3: tendermint.types.SimpleValidator
|
||||
(*crypto.PublicKey)(nil), // 4: tendermint.crypto.PublicKey
|
||||
}
|
||||
var file_tendermint_types_validator_proto_depIdxs = []int32{
|
||||
1, // 0: tendermint.types.ValidatorSet.validators:type_name -> tendermint.types.Validator
|
||||
1, // 1: tendermint.types.ValidatorSet.proposer:type_name -> tendermint.types.Validator
|
||||
3, // 2: tendermint.types.Validator.pub_key:type_name -> tendermint.crypto.PublicKey
|
||||
3, // 3: tendermint.types.SimpleValidator.pub_key:type_name -> tendermint.crypto.PublicKey
|
||||
2, // 0: tendermint.types.ValidatorSet.validators:type_name -> tendermint.types.Validator
|
||||
2, // 1: tendermint.types.ValidatorSet.proposer:type_name -> tendermint.types.Validator
|
||||
4, // 2: tendermint.types.Validator.pub_key:type_name -> tendermint.crypto.PublicKey
|
||||
4, // 3: tendermint.types.SimpleValidator.pub_key:type_name -> tendermint.crypto.PublicKey
|
||||
4, // [4:4] is the sub-list for method output_type
|
||||
4, // [4:4] is the sub-list for method input_type
|
||||
4, // [4:4] is the sub-list for extension type_name
|
||||
@ -2013,13 +2081,14 @@ func file_tendermint_types_validator_proto_init() {
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_tendermint_types_validator_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumEnums: 1,
|
||||
NumMessages: 3,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_tendermint_types_validator_proto_goTypes,
|
||||
DependencyIndexes: file_tendermint_types_validator_proto_depIdxs,
|
||||
EnumInfos: file_tendermint_types_validator_proto_enumTypes,
|
||||
MessageInfos: file_tendermint_types_validator_proto_msgTypes,
|
||||
}.Build()
|
||||
File_tendermint_types_validator_proto = out.File
|
||||
|
||||
1146
baseapp/abci.go
1146
baseapp/abci.go
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
281
baseapp/abci_utils.go
Normal file
281
baseapp/abci_utils.go
Normal file
@ -0,0 +1,281 @@
|
||||
package baseapp
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
|
||||
"cosmossdk.io/math"
|
||||
"github.com/cockroachdb/errors"
|
||||
abci "github.com/cometbft/cometbft/abci/types"
|
||||
cmtcrypto "github.com/cometbft/cometbft/crypto"
|
||||
cryptoenc "github.com/cometbft/cometbft/crypto/encoding"
|
||||
cmtprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto"
|
||||
cmtproto "github.com/cometbft/cometbft/proto/tendermint/types"
|
||||
protoio "github.com/cosmos/gogoproto/io"
|
||||
"github.com/cosmos/gogoproto/proto"
|
||||
|
||||
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/types/mempool"
|
||||
)
|
||||
|
||||
// VoteExtensionThreshold defines the total voting power % that must be
|
||||
// submitted in order for all vote extensions to be considered valid for a
|
||||
// given height.
|
||||
var VoteExtensionThreshold = math.LegacyNewDecWithPrec(667, 3)
|
||||
|
||||
type (
|
||||
// Validator defines the interface contract require for verifying vote extension
|
||||
// signatures. Typically, this will be implemented by the x/staking module,
|
||||
// which has knowledge of the CometBFT public key.
|
||||
Validator interface {
|
||||
CmtConsPublicKey() (cmtprotocrypto.PublicKey, error)
|
||||
BondedTokens() math.Int
|
||||
}
|
||||
|
||||
// ValidatorStore defines the interface contract require for verifying vote
|
||||
// extension signatures. Typically, this will be implemented by the x/staking
|
||||
// module, which has knowledge of the CometBFT public key.
|
||||
ValidatorStore interface {
|
||||
GetValidatorByConsAddr(sdk.Context, cryptotypes.Address) (Validator, error)
|
||||
TotalBondedTokens(ctx sdk.Context) math.Int
|
||||
}
|
||||
)
|
||||
|
||||
// ValidateVoteExtensions defines a helper function for verifying vote extension
|
||||
// signatures that may be passed or manually injected into a block proposal from
|
||||
// a proposer in ProcessProposal. It returns an error if any signature is invalid
|
||||
// or if unexpected vote extensions and/or signatures are found or less than 2/3
|
||||
// power is received.
|
||||
func ValidateVoteExtensions(
|
||||
ctx sdk.Context,
|
||||
valStore ValidatorStore,
|
||||
currentHeight int64,
|
||||
chainID string,
|
||||
extCommit abci.ExtendedCommitInfo,
|
||||
) error {
|
||||
cp := ctx.ConsensusParams()
|
||||
extsEnabled := cp.Abci != nil && cp.Abci.VoteExtensionsEnableHeight > 0
|
||||
|
||||
marshalDelimitedFn := func(msg proto.Message) ([]byte, error) {
|
||||
var buf bytes.Buffer
|
||||
if err := protoio.NewDelimitedWriter(&buf).WriteMsg(msg); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return buf.Bytes(), nil
|
||||
}
|
||||
|
||||
var sumVP math.Int
|
||||
for _, vote := range extCommit.Votes {
|
||||
if !extsEnabled {
|
||||
if len(vote.VoteExtension) > 0 {
|
||||
return fmt.Errorf("vote extensions disabled; received non-empty vote extension at height %d", currentHeight)
|
||||
}
|
||||
if len(vote.ExtensionSignature) > 0 {
|
||||
return fmt.Errorf("vote extensions disabled; received non-empty vote extension signature at height %d", currentHeight)
|
||||
}
|
||||
|
||||
continue
|
||||
}
|
||||
|
||||
if len(vote.ExtensionSignature) == 0 {
|
||||
return fmt.Errorf("vote extensions enabled; received empty vote extension signature at height %d", currentHeight)
|
||||
}
|
||||
|
||||
valConsAddr := cmtcrypto.Address(vote.Validator.Address)
|
||||
|
||||
validator, err := valStore.GetValidatorByConsAddr(ctx, valConsAddr)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to get validator %X: %w", valConsAddr, err)
|
||||
}
|
||||
if validator == nil {
|
||||
return fmt.Errorf("validator %X not found", valConsAddr)
|
||||
}
|
||||
|
||||
cmtPubKeyProto, err := validator.CmtConsPublicKey()
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to get validator %X public key: %w", valConsAddr, err)
|
||||
}
|
||||
|
||||
cmtPubKey, err := cryptoenc.PubKeyFromProto(cmtPubKeyProto)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to convert validator %X public key: %w", valConsAddr, err)
|
||||
}
|
||||
|
||||
cve := cmtproto.CanonicalVoteExtension{
|
||||
Extension: vote.VoteExtension,
|
||||
Height: currentHeight - 1, // the vote extension was signed in the previous height
|
||||
Round: int64(extCommit.Round),
|
||||
ChainId: chainID,
|
||||
}
|
||||
|
||||
extSignBytes, err := marshalDelimitedFn(&cve)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to encode CanonicalVoteExtension: %w", err)
|
||||
}
|
||||
|
||||
if !cmtPubKey.VerifySignature(extSignBytes, vote.ExtensionSignature) {
|
||||
return fmt.Errorf("failed to verify validator %X vote extension signature", valConsAddr)
|
||||
}
|
||||
|
||||
sumVP = sumVP.Add(validator.BondedTokens())
|
||||
}
|
||||
|
||||
// Ensure we have at least 2/3 voting power that submitted valid vote
|
||||
// extensions.
|
||||
totalVP := valStore.TotalBondedTokens(ctx)
|
||||
percentSubmitted := math.LegacyNewDecFromInt(sumVP).Quo(math.LegacyNewDecFromInt(totalVP))
|
||||
if percentSubmitted.LT(VoteExtensionThreshold) {
|
||||
return fmt.Errorf("insufficient cumulative voting power received to verify vote extensions; got: %s, expected: >=%s", percentSubmitted, VoteExtensionThreshold)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
type (
|
||||
// ProposalTxVerifier defines the interface that is implemented by BaseApp,
|
||||
// that any custom ABCI PrepareProposal and ProcessProposal handler can use
|
||||
// to verify a transaction.
|
||||
ProposalTxVerifier interface {
|
||||
PrepareProposalVerifyTx(tx sdk.Tx) ([]byte, error)
|
||||
ProcessProposalVerifyTx(txBz []byte) (sdk.Tx, error)
|
||||
}
|
||||
|
||||
// DefaultProposalHandler defines the default ABCI PrepareProposal and
|
||||
// ProcessProposal handlers.
|
||||
DefaultProposalHandler struct {
|
||||
mempool mempool.Mempool
|
||||
txVerifier ProposalTxVerifier
|
||||
}
|
||||
)
|
||||
|
||||
func NewDefaultProposalHandler(mp mempool.Mempool, txVerifier ProposalTxVerifier) DefaultProposalHandler {
|
||||
return DefaultProposalHandler{
|
||||
mempool: mp,
|
||||
txVerifier: txVerifier,
|
||||
}
|
||||
}
|
||||
|
||||
// PrepareProposalHandler returns the default implementation for processing an
|
||||
// ABCI proposal. The application's mempool is enumerated and all valid
|
||||
// transactions are added to the proposal. Transactions are valid if they:
|
||||
//
|
||||
// 1) Successfully encode to bytes.
|
||||
// 2) Are valid (i.e. pass runTx, AnteHandler only).
|
||||
//
|
||||
// Enumeration is halted once RequestPrepareProposal.MaxBytes of transactions is
|
||||
// reached or the mempool is exhausted.
|
||||
//
|
||||
// Note:
|
||||
//
|
||||
// - Step (2) is identical to the validation step performed in
|
||||
// DefaultProcessProposal. It is very important that the same validation logic
|
||||
// is used in both steps, and applications must ensure that this is the case in
|
||||
// non-default handlers.
|
||||
//
|
||||
// - If no mempool is set or if the mempool is a no-op mempool, the transactions
|
||||
// requested from CometBFT will simply be returned, which, by default, are in
|
||||
// FIFO order.
|
||||
func (h DefaultProposalHandler) PrepareProposalHandler() sdk.PrepareProposalHandler {
|
||||
return func(ctx sdk.Context, req *abci.RequestPrepareProposal) (*abci.ResponsePrepareProposal, error) {
|
||||
// If the mempool is nil or a no-op mempool, we simply return the transactions
|
||||
// requested from CometBFT, which, by default, should be in FIFO order.
|
||||
_, isNoOp := h.mempool.(mempool.NoOpMempool)
|
||||
if h.mempool == nil || isNoOp {
|
||||
return &abci.ResponsePrepareProposal{Txs: req.Txs}, nil
|
||||
}
|
||||
|
||||
var (
|
||||
selectedTxs [][]byte
|
||||
totalTxBytes int64
|
||||
)
|
||||
|
||||
iterator := h.mempool.Select(ctx, req.Txs)
|
||||
|
||||
for iterator != nil {
|
||||
memTx := iterator.Tx()
|
||||
|
||||
// NOTE: Since transaction verification was already executed in CheckTx,
|
||||
// which calls mempool.Insert, in theory everything in the pool should be
|
||||
// valid. But some mempool implementations may insert invalid txs, so we
|
||||
// check again.
|
||||
bz, err := h.txVerifier.PrepareProposalVerifyTx(memTx)
|
||||
if err != nil {
|
||||
err := h.mempool.Remove(memTx)
|
||||
if err != nil && !errors.Is(err, mempool.ErrTxNotFound) {
|
||||
panic(err)
|
||||
}
|
||||
} else {
|
||||
txSize := int64(len(bz))
|
||||
if totalTxBytes += txSize; totalTxBytes <= req.MaxTxBytes {
|
||||
selectedTxs = append(selectedTxs, bz)
|
||||
} else {
|
||||
// We've reached capacity per req.MaxTxBytes so we cannot select any
|
||||
// more transactions.
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
iterator = iterator.Next()
|
||||
}
|
||||
|
||||
return &abci.ResponsePrepareProposal{Txs: selectedTxs}, nil
|
||||
}
|
||||
}
|
||||
|
||||
// ProcessProposalHandler returns the default implementation for processing an
|
||||
// ABCI proposal. Every transaction in the proposal must pass 2 conditions:
|
||||
//
|
||||
// 1. The transaction bytes must decode to a valid transaction.
|
||||
// 2. The transaction must be valid (i.e. pass runTx, AnteHandler only)
|
||||
//
|
||||
// If any transaction fails to pass either condition, the proposal is rejected.
|
||||
// Note that step (2) is identical to the validation step performed in
|
||||
// DefaultPrepareProposal. It is very important that the same validation logic
|
||||
// is used in both steps, and applications must ensure that this is the case in
|
||||
// non-default handlers.
|
||||
func (h DefaultProposalHandler) ProcessProposalHandler() sdk.ProcessProposalHandler {
|
||||
return func(ctx sdk.Context, req *abci.RequestProcessProposal) (*abci.ResponseProcessProposal, error) {
|
||||
for _, txBytes := range req.Txs {
|
||||
_, err := h.txVerifier.ProcessProposalVerifyTx(txBytes)
|
||||
if err != nil {
|
||||
return &abci.ResponseProcessProposal{Status: abci.ResponseProcessProposal_REJECT}, nil
|
||||
}
|
||||
}
|
||||
|
||||
return &abci.ResponseProcessProposal{Status: abci.ResponseProcessProposal_ACCEPT}, nil
|
||||
}
|
||||
}
|
||||
|
||||
// NoOpPrepareProposal defines a no-op PrepareProposal handler. It will always
|
||||
// return the transactions sent by the client's request.
|
||||
func NoOpPrepareProposal() sdk.PrepareProposalHandler {
|
||||
return func(_ sdk.Context, req *abci.RequestPrepareProposal) (*abci.ResponsePrepareProposal, error) {
|
||||
return &abci.ResponsePrepareProposal{Txs: req.Txs}, nil
|
||||
}
|
||||
}
|
||||
|
||||
// NoOpProcessProposal defines a no-op ProcessProposal Handler. It will always
|
||||
// return ACCEPT.
|
||||
func NoOpProcessProposal() sdk.ProcessProposalHandler {
|
||||
return func(_ sdk.Context, _ *abci.RequestProcessProposal) (*abci.ResponseProcessProposal, error) {
|
||||
return &abci.ResponseProcessProposal{Status: abci.ResponseProcessProposal_ACCEPT}, nil
|
||||
}
|
||||
}
|
||||
|
||||
// NoOpExtendVote defines a no-op ExtendVote handler. It will always return an
|
||||
// empty byte slice as the vote extension.
|
||||
func NoOpExtendVote() sdk.ExtendVoteHandler {
|
||||
return func(_ sdk.Context, _ *abci.RequestExtendVote) (*abci.ResponseExtendVote, error) {
|
||||
return &abci.ResponseExtendVote{VoteExtension: []byte{}}, nil
|
||||
}
|
||||
}
|
||||
|
||||
// NoOpVerifyVoteExtensionHandler defines a no-op VerifyVoteExtension handler. It
|
||||
// will always return an ACCEPT status with no error.
|
||||
func NoOpVerifyVoteExtensionHandler() sdk.VerifyVoteExtensionHandler {
|
||||
return func(_ sdk.Context, _ *abci.RequestVerifyVoteExtension) (*abci.ResponseVerifyVoteExtension, error) {
|
||||
return &abci.ResponseVerifyVoteExtension{Status: abci.ResponseVerifyVoteExtension_ACCEPT}, nil
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,7 @@
|
||||
package baseapp
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"sort"
|
||||
"strconv"
|
||||
@ -20,32 +21,35 @@ import (
|
||||
"golang.org/x/exp/maps"
|
||||
|
||||
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
|
||||
servertypes "github.com/cosmos/cosmos-sdk/server/types"
|
||||
"github.com/cosmos/cosmos-sdk/telemetry"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
||||
"github.com/cosmos/cosmos-sdk/types/mempool"
|
||||
)
|
||||
|
||||
type (
|
||||
// Enum mode for app.runTx
|
||||
runTxMode uint8
|
||||
execMode uint8
|
||||
|
||||
// StoreLoader defines a customizable function to control how we load the CommitMultiStore
|
||||
// from disk. This is useful for state migration, when loading a datastore written with
|
||||
// an older version of the software. In particular, if a module changed the substore key name
|
||||
// (or removed a substore) between two versions of the software.
|
||||
// StoreLoader defines a customizable function to control how we load the
|
||||
// CommitMultiStore from disk. This is useful for state migration, when
|
||||
// loading a datastore written with an older version of the software. In
|
||||
// particular, if a module changed the substore key name (or removed a substore)
|
||||
// between two versions of the software.
|
||||
StoreLoader func(ms storetypes.CommitMultiStore) error
|
||||
)
|
||||
|
||||
const (
|
||||
runTxModeCheck runTxMode = iota // Check a transaction
|
||||
runTxModeReCheck // Recheck a (pending) transaction after a commit
|
||||
runTxModeSimulate // Simulate a transaction
|
||||
runTxModeDeliver // Deliver a transaction
|
||||
runTxPrepareProposal // Prepare a TM block proposal
|
||||
runTxProcessProposal // Process a TM block proposal
|
||||
execModeCheck execMode = iota // Check a transaction
|
||||
execModeReCheck // Recheck a (pending) transaction after a commit
|
||||
execModeSimulate // Simulate a transaction
|
||||
execModePrepareProposal // Prepare a block proposal
|
||||
execModeProcessProposal // Process a block proposal
|
||||
execModeVoteExtension // Extend or verify a pre-commit vote
|
||||
execModeFinalize // Finalize a block proposal
|
||||
)
|
||||
|
||||
var _ abci.Application = (*BaseApp)(nil)
|
||||
var _ servertypes.ABCI = (*BaseApp)(nil)
|
||||
|
||||
// BaseApp reflects the ABCI application implementation.
|
||||
type BaseApp struct {
|
||||
@ -62,33 +66,59 @@ type BaseApp struct {
|
||||
txDecoder sdk.TxDecoder // unmarshal []byte into sdk.Tx
|
||||
txEncoder sdk.TxEncoder // marshal sdk.Tx into []byte
|
||||
|
||||
mempool mempool.Mempool // application side mempool
|
||||
anteHandler sdk.AnteHandler // ante handler for fee and auth
|
||||
postHandler sdk.PostHandler // post handler, optional, e.g. for tips
|
||||
initChainer sdk.InitChainer // initialize state with validators and state blob
|
||||
beginBlocker sdk.BeginBlocker // logic to run before any txs
|
||||
processProposal sdk.ProcessProposalHandler // the handler which runs on ABCI ProcessProposal
|
||||
prepareProposal sdk.PrepareProposalHandler // the handler which runs on ABCI PrepareProposal
|
||||
endBlocker sdk.EndBlocker // logic to run after all txs, and to determine valset changes
|
||||
prepareCheckStater sdk.PrepareCheckStater // logic to run during commit using the checkState
|
||||
precommiter sdk.Precommiter // logic to run during commit using the deliverState
|
||||
addrPeerFilter sdk.PeerFilter // filter peers by address and port
|
||||
idPeerFilter sdk.PeerFilter // filter peers by node ID
|
||||
fauxMerkleMode bool // if true, IAVL MountStores uses MountStoresDB for simulation speed.
|
||||
mempool mempool.Mempool // application side mempool
|
||||
anteHandler sdk.AnteHandler // ante handler for fee and auth
|
||||
postHandler sdk.PostHandler // post handler, optional, e.g. for tips
|
||||
|
||||
initChainer sdk.InitChainer // ABCI InitChain handler
|
||||
beginBlocker sdk.BeginBlocker // (legacy ABCI) BeginBlock handler
|
||||
endBlocker sdk.EndBlocker // (legacy ABCI) EndBlock handler
|
||||
processProposal sdk.ProcessProposalHandler // ABCI ProcessProposal handler
|
||||
prepareProposal sdk.PrepareProposalHandler // ABCI PrepareProposal
|
||||
extendVote sdk.ExtendVoteHandler // ABCI ExtendVote handler
|
||||
verifyVoteExt sdk.VerifyVoteExtensionHandler // ABCI VerifyVoteExtension handler
|
||||
prepareCheckStater sdk.PrepareCheckStater // logic to run during commit using the checkState
|
||||
precommiter sdk.Precommiter // logic to run during commit using the deliverState
|
||||
|
||||
addrPeerFilter sdk.PeerFilter // filter peers by address and port
|
||||
idPeerFilter sdk.PeerFilter // filter peers by node ID
|
||||
fauxMerkleMode bool // if true, IAVL MountStores uses MountStoresDB for simulation speed.
|
||||
|
||||
// manages snapshots, i.e. dumps of app state at certain intervals
|
||||
snapshotManager *snapshots.Manager
|
||||
|
||||
// volatile states:
|
||||
//
|
||||
// checkState is set on InitChain and reset on Commit
|
||||
// deliverState is set on InitChain and BeginBlock and set to nil on Commit
|
||||
checkState *state // for CheckTx
|
||||
deliverState *state // for DeliverTx
|
||||
processProposalState *state // for ProcessProposal
|
||||
prepareProposalState *state // for PrepareProposal
|
||||
// - checkState is set on InitChain and reset on Commit
|
||||
// - finalizeBlockState is set on InitChain and FinalizeBlock and set to nil
|
||||
// on Commit.
|
||||
//
|
||||
// - checkState: Used for CheckTx, which is set based on the previous block's
|
||||
// state. This state is never committed.
|
||||
//
|
||||
// - prepareProposalState: Used for PrepareProposal, which is set based on the
|
||||
// previous block's state. This state is never committed. In case of multiple
|
||||
// consensus rounds, the state is always reset to the previous block's state.
|
||||
//
|
||||
// - voteExtensionState: Used for ExtendVote and VerifyVoteExtension, which is
|
||||
// set based on the previous block's state. This state is never committed. In
|
||||
// case of multiple rounds, the state is always reset to the previous block's
|
||||
// state.
|
||||
//
|
||||
// - processProposalState: Used for ProcessProposal, which is set based on the
|
||||
// the previous block's state. This state is never committed. In case of
|
||||
// multiple rounds, the state is always reset to the previous block's state.
|
||||
//
|
||||
// - finalizeBlockState: Used for FinalizeBlock, which is set based on the
|
||||
// previous block's state. This state is committed.
|
||||
checkState *state
|
||||
prepareProposalState *state
|
||||
processProposalState *state
|
||||
voteExtensionState *state
|
||||
finalizeBlockState *state
|
||||
|
||||
// an inter-block write-through cache provided to the context during deliverState
|
||||
// An inter-block write-through cache provided to the context during the ABCI
|
||||
// FinalizeBlock call.
|
||||
interBlockCache storetypes.MultiStorePersistentCache
|
||||
|
||||
// paramStore is used to query for ABCI consensus parameters from an
|
||||
@ -99,7 +129,7 @@ type BaseApp struct {
|
||||
// transaction. This is mainly used for DoS and spam prevention.
|
||||
minGasPrices sdk.DecCoins
|
||||
|
||||
// initialHeight is the initial height at which we start the baseapp
|
||||
// initialHeight is the initial height at which we start the BaseApp
|
||||
initialHeight int64
|
||||
|
||||
// flag for sealing options and parameters to a BaseApp
|
||||
@ -149,8 +179,6 @@ type BaseApp struct {
|
||||
// NewBaseApp returns a reference to an initialized BaseApp. It accepts a
|
||||
// variadic number of option functions, which act on the BaseApp to set
|
||||
// configuration choices.
|
||||
//
|
||||
// NOTE: The db is used to store the version number for now.
|
||||
func NewBaseApp(
|
||||
name string, logger log.Logger, db dbm.DB, txDecoder sdk.TxDecoder, options ...func(*BaseApp),
|
||||
) *BaseApp {
|
||||
@ -179,11 +207,15 @@ func NewBaseApp(
|
||||
if app.prepareProposal == nil {
|
||||
app.SetPrepareProposal(abciProposalHandler.PrepareProposalHandler())
|
||||
}
|
||||
|
||||
if app.processProposal == nil {
|
||||
app.SetProcessProposal(abciProposalHandler.ProcessProposalHandler())
|
||||
}
|
||||
|
||||
if app.extendVote == nil {
|
||||
app.SetExtendVoteHandler(NoOpExtendVote())
|
||||
}
|
||||
if app.verifyVoteExt == nil {
|
||||
app.SetVerifyVoteExtensionHandler(NoOpVerifyVoteExtensionHandler())
|
||||
}
|
||||
if app.interBlockCache != nil {
|
||||
app.cms.SetInterBlockCache(app.interBlockCache)
|
||||
}
|
||||
@ -342,6 +374,16 @@ func (app *BaseApp) LastBlockHeight() int64 {
|
||||
return app.cms.LastCommitID().Version
|
||||
}
|
||||
|
||||
// ChainID returns the chainID of the app.
|
||||
func (app *BaseApp) ChainID() string {
|
||||
return app.chainID
|
||||
}
|
||||
|
||||
// AnteHandler returns the AnteHandler of the app.
|
||||
func (app *BaseApp) AnteHandler() sdk.AnteHandler {
|
||||
return app.anteHandler
|
||||
}
|
||||
|
||||
// Init initializes the app. It seals the app, preventing any
|
||||
// further modifications. In addition, it validates the app against
|
||||
// the earlier provided settings. Returns an error if validation fails.
|
||||
@ -354,7 +396,7 @@ func (app *BaseApp) Init() error {
|
||||
emptyHeader := cmtproto.Header{ChainID: app.chainID}
|
||||
|
||||
// needed for the export command which inits from store but never calls initchain
|
||||
app.setState(runTxModeCheck, emptyHeader)
|
||||
app.setState(execModeCheck, emptyHeader)
|
||||
app.Seal()
|
||||
|
||||
if app.cms == nil {
|
||||
@ -405,7 +447,7 @@ func (app *BaseApp) IsSealed() bool { return app.sealed }
|
||||
// setState sets the BaseApp's state for the corresponding mode with a branched
|
||||
// multi-store (i.e. a CacheMultiStore) and a new Context with the same
|
||||
// multi-store branch, and provided header.
|
||||
func (app *BaseApp) setState(mode runTxMode, header cmtproto.Header) {
|
||||
func (app *BaseApp) setState(mode execMode, header cmtproto.Header) {
|
||||
ms := app.cms.CacheMultiStore()
|
||||
baseState := &state{
|
||||
ms: ms,
|
||||
@ -413,24 +455,39 @@ func (app *BaseApp) setState(mode runTxMode, header cmtproto.Header) {
|
||||
}
|
||||
|
||||
switch mode {
|
||||
case runTxModeCheck:
|
||||
// Minimum gas prices are also set. It is set on InitChain and reset on Commit.
|
||||
case execModeCheck:
|
||||
baseState.ctx = baseState.ctx.WithIsCheckTx(true).WithMinGasPrices(app.minGasPrices)
|
||||
app.checkState = baseState
|
||||
case runTxModeDeliver:
|
||||
// It is set on InitChain and BeginBlock and set to nil on Commit.
|
||||
app.deliverState = baseState
|
||||
case runTxPrepareProposal:
|
||||
// It is set on InitChain and Commit.
|
||||
|
||||
case execModePrepareProposal:
|
||||
app.prepareProposalState = baseState
|
||||
case runTxProcessProposal:
|
||||
// It is set on InitChain and Commit.
|
||||
|
||||
case execModeProcessProposal:
|
||||
app.processProposalState = baseState
|
||||
|
||||
case execModeVoteExtension:
|
||||
app.voteExtensionState = baseState
|
||||
|
||||
case execModeFinalize:
|
||||
app.finalizeBlockState = baseState
|
||||
|
||||
default:
|
||||
panic(fmt.Sprintf("invalid runTxMode for setState: %d", mode))
|
||||
}
|
||||
}
|
||||
|
||||
// GetFinalizeBlockStateCtx returns the Context associated with the FinalizeBlock
|
||||
// state. This Context can be used to write data derived from processing vote
|
||||
// extensions to application state during ProcessProposal.
|
||||
//
|
||||
// NOTE:
|
||||
// - Do NOT use or write to state using this Context unless you intend for
|
||||
// that state to be committed.
|
||||
// - Do NOT use or write to state using this Context on the first block.
|
||||
func (app *BaseApp) GetFinalizeBlockStateCtx() sdk.Context {
|
||||
return app.finalizeBlockState.ctx
|
||||
}
|
||||
|
||||
// SetCircuitBreaker sets the circuit breaker for the BaseApp.
|
||||
// The circuit breaker is checked on every message execution to verify if a transaction should be executed or not.
|
||||
func (app *BaseApp) SetCircuitBreaker(cb CircuitBreaker) {
|
||||
@ -452,15 +509,17 @@ func (app *BaseApp) GetConsensusParams(ctx sdk.Context) cmtproto.ConsensusParams
|
||||
return cp
|
||||
}
|
||||
|
||||
// StoreConsensusParams sets the consensus parameters to the baseapp's param store.
|
||||
// StoreConsensusParams sets the consensus parameters to the BaseApp's param
|
||||
// store.
|
||||
//
|
||||
// NOTE: We're explicitly not storing the CometBFT app_version in the param store.
|
||||
// It's stored instead in the x/upgrade store, with its own bump logic.
|
||||
func (app *BaseApp) StoreConsensusParams(ctx sdk.Context, cp cmtproto.ConsensusParams) error {
|
||||
if app.paramStore == nil {
|
||||
panic("cannot store consensus params with no params store set")
|
||||
}
|
||||
|
||||
return app.paramStore.Set(ctx, cp)
|
||||
// We're explicitly not storing the CometBFT app_version in the param store. It's
|
||||
// stored instead in the x/upgrade store, with its own bump logic.
|
||||
}
|
||||
|
||||
// AddRunTxRecoveryHandler adds custom app.runTx method panic handlers.
|
||||
@ -493,9 +552,9 @@ func (app *BaseApp) GetMaximumBlockGas(ctx sdk.Context) uint64 {
|
||||
}
|
||||
}
|
||||
|
||||
func (app *BaseApp) validateHeight(req abci.RequestBeginBlock) error {
|
||||
if req.Header.Height < 1 {
|
||||
return fmt.Errorf("invalid height: %d", req.Header.Height)
|
||||
func (app *BaseApp) validateFinalizeBlockHeight(req *abci.RequestFinalizeBlock) error {
|
||||
if req.Height < 1 {
|
||||
return fmt.Errorf("invalid height: %d", req.Height)
|
||||
}
|
||||
|
||||
lastBlockHeight := app.LastBlockHeight()
|
||||
@ -515,8 +574,8 @@ func (app *BaseApp) validateHeight(req abci.RequestBeginBlock) error {
|
||||
expectedHeight = lastBlockHeight + 1
|
||||
}
|
||||
|
||||
if req.Header.Height != expectedHeight {
|
||||
return fmt.Errorf("invalid height: %d; expected: %d", req.Header.Height, expectedHeight)
|
||||
if req.Height != expectedHeight {
|
||||
return fmt.Errorf("invalid height: %d; expected: %d", req.Height, expectedHeight)
|
||||
}
|
||||
|
||||
return nil
|
||||
@ -542,18 +601,15 @@ func validateBasicTxMsgs(msgs []sdk.Msg) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Returns the application's deliverState if app is in runTxModeDeliver,
|
||||
// prepareProposalState if app is in runTxPrepareProposal, processProposalState
|
||||
// if app is in runTxProcessProposal, and checkState otherwise.
|
||||
func (app *BaseApp) getState(mode runTxMode) *state {
|
||||
func (app *BaseApp) getState(mode execMode) *state {
|
||||
switch mode {
|
||||
case runTxModeDeliver:
|
||||
return app.deliverState
|
||||
case execModeFinalize:
|
||||
return app.finalizeBlockState
|
||||
|
||||
case runTxPrepareProposal:
|
||||
case execModePrepareProposal:
|
||||
return app.prepareProposalState
|
||||
|
||||
case runTxProcessProposal:
|
||||
case execModeProcessProposal:
|
||||
return app.processProposalState
|
||||
|
||||
default:
|
||||
@ -570,7 +626,7 @@ func (app *BaseApp) getBlockGasMeter(ctx sdk.Context) storetypes.GasMeter {
|
||||
}
|
||||
|
||||
// retrieve the context for the tx w/ txBytes and other memoized values.
|
||||
func (app *BaseApp) getContextForTx(mode runTxMode, txBytes []byte) sdk.Context {
|
||||
func (app *BaseApp) getContextForTx(mode execMode, txBytes []byte) sdk.Context {
|
||||
modeState := app.getState(mode)
|
||||
if modeState == nil {
|
||||
panic(fmt.Sprintf("state is nil for mode %v", mode))
|
||||
@ -581,11 +637,11 @@ func (app *BaseApp) getContextForTx(mode runTxMode, txBytes []byte) sdk.Context
|
||||
|
||||
ctx = ctx.WithConsensusParams(app.GetConsensusParams(ctx))
|
||||
|
||||
if mode == runTxModeReCheck {
|
||||
if mode == execModeReCheck {
|
||||
ctx = ctx.WithIsReCheckTx(true)
|
||||
}
|
||||
|
||||
if mode == runTxModeSimulate {
|
||||
if mode == execModeSimulate {
|
||||
ctx, _ = ctx.CacheContext()
|
||||
}
|
||||
|
||||
@ -611,6 +667,95 @@ func (app *BaseApp) cacheTxContext(ctx sdk.Context, txBytes []byte) (sdk.Context
|
||||
return ctx.WithMultiStore(msCache), msCache
|
||||
}
|
||||
|
||||
func (app *BaseApp) beginBlock(req *abci.RequestFinalizeBlock) sdk.BeginBlock {
|
||||
var (
|
||||
resp sdk.BeginBlock
|
||||
err error
|
||||
)
|
||||
|
||||
if app.beginBlocker != nil {
|
||||
resp, err = app.beginBlocker(app.finalizeBlockState.ctx)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// append BeginBlock attributes to all events in the EndBlock response
|
||||
for i, event := range resp.Events {
|
||||
resp.Events[i].Attributes = append(
|
||||
event.Attributes,
|
||||
abci.EventAttribute{Key: "mode", Value: "BeginBlock"},
|
||||
)
|
||||
}
|
||||
|
||||
resp.Events = sdk.MarkEventsToIndex(resp.Events, app.indexEvents)
|
||||
}
|
||||
|
||||
return resp
|
||||
}
|
||||
|
||||
func (app *BaseApp) deliverTx(tx []byte) *abci.ExecTxResult {
|
||||
gInfo := sdk.GasInfo{}
|
||||
resultStr := "successful"
|
||||
|
||||
var resp *abci.ExecTxResult
|
||||
|
||||
defer func() {
|
||||
telemetry.IncrCounter(1, "tx", "count")
|
||||
telemetry.IncrCounter(1, "tx", resultStr)
|
||||
telemetry.SetGauge(float32(gInfo.GasUsed), "tx", "gas", "used")
|
||||
telemetry.SetGauge(float32(gInfo.GasWanted), "tx", "gas", "wanted")
|
||||
}()
|
||||
|
||||
gInfo, result, anteEvents, err := app.runTx(execModeFinalize, tx)
|
||||
if err != nil {
|
||||
resultStr = "failed"
|
||||
resp = sdkerrors.ResponseExecTxResultWithEvents(
|
||||
err,
|
||||
gInfo.GasWanted,
|
||||
gInfo.GasUsed,
|
||||
sdk.MarkEventsToIndex(anteEvents, app.indexEvents),
|
||||
app.trace,
|
||||
)
|
||||
return resp
|
||||
}
|
||||
|
||||
resp = &abci.ExecTxResult{
|
||||
GasWanted: int64(gInfo.GasWanted),
|
||||
GasUsed: int64(gInfo.GasUsed),
|
||||
Log: result.Log,
|
||||
Data: result.Data,
|
||||
Events: sdk.MarkEventsToIndex(result.Events, app.indexEvents),
|
||||
}
|
||||
|
||||
return resp
|
||||
}
|
||||
|
||||
// endBlock is an application-defined function that is called after transactions
|
||||
// have been processed in FinalizeBlock.
|
||||
func (app *BaseApp) endBlock(ctx context.Context) (sdk.EndBlock, error) {
|
||||
var endblock sdk.EndBlock
|
||||
|
||||
if app.endBlocker != nil {
|
||||
eb, err := app.endBlocker(app.finalizeBlockState.ctx)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// append EndBlock attributes to all events in the EndBlock response
|
||||
for i, event := range eb.Events {
|
||||
eb.Events[i].Attributes = append(
|
||||
event.Attributes,
|
||||
abci.EventAttribute{Key: "mode", Value: "EndBlock"},
|
||||
)
|
||||
}
|
||||
|
||||
eb.Events = sdk.MarkEventsToIndex(eb.Events, app.indexEvents)
|
||||
endblock = eb
|
||||
}
|
||||
|
||||
return endblock, nil
|
||||
}
|
||||
|
||||
// runTx processes a transaction within a given execution mode, encoded transaction
|
||||
// bytes, and the decoded transaction itself. All state transitions occur through
|
||||
// a cached Context depending on the mode provided. State only gets persisted
|
||||
@ -618,7 +763,7 @@ func (app *BaseApp) cacheTxContext(ctx sdk.Context, txBytes []byte) (sdk.Context
|
||||
// Note, gas execution info is always returned. A reference to a Result is
|
||||
// returned if the tx does not run out of gas and if all the messages are valid
|
||||
// and execute successfully. An error is returned otherwise.
|
||||
func (app *BaseApp) runTx(mode runTxMode, txBytes []byte) (gInfo sdk.GasInfo, result *sdk.Result, anteEvents []abci.Event, priority int64, err error) {
|
||||
func (app *BaseApp) runTx(mode execMode, txBytes []byte) (gInfo sdk.GasInfo, result *sdk.Result, anteEvents []abci.Event, err error) {
|
||||
// NOTE: GasWanted should be returned by the AnteHandler. GasUsed is
|
||||
// determined by the GasMeter. We need access to the context to get the gas
|
||||
// meter, so we initialize upfront.
|
||||
@ -628,8 +773,8 @@ func (app *BaseApp) runTx(mode runTxMode, txBytes []byte) (gInfo sdk.GasInfo, re
|
||||
ms := ctx.MultiStore()
|
||||
|
||||
// only run the tx if there is block gas remaining
|
||||
if mode == runTxModeDeliver && ctx.BlockGasMeter().IsOutOfGas() {
|
||||
return gInfo, nil, nil, 0, errorsmod.Wrap(sdkerrors.ErrOutOfGas, "no block gas left to run tx")
|
||||
if mode == execModeFinalize && ctx.BlockGasMeter().IsOutOfGas() {
|
||||
return gInfo, nil, nil, errorsmod.Wrap(sdkerrors.ErrOutOfGas, "no block gas left to run tx")
|
||||
}
|
||||
|
||||
defer func() {
|
||||
@ -661,18 +806,18 @@ func (app *BaseApp) runTx(mode runTxMode, txBytes []byte) (gInfo sdk.GasInfo, re
|
||||
// NOTE: consumeBlockGas must exist in a separate defer function from the
|
||||
// general deferred recovery function to recover from consumeBlockGas as it'll
|
||||
// be executed first (deferred statements are executed as stack).
|
||||
if mode == runTxModeDeliver {
|
||||
if mode == execModeFinalize {
|
||||
defer consumeBlockGas()
|
||||
}
|
||||
|
||||
tx, err := app.txDecoder(txBytes)
|
||||
if err != nil {
|
||||
return sdk.GasInfo{}, nil, nil, 0, err
|
||||
return sdk.GasInfo{}, nil, nil, err
|
||||
}
|
||||
|
||||
msgs := tx.GetMsgs()
|
||||
if err := validateBasicTxMsgs(msgs); err != nil {
|
||||
return sdk.GasInfo{}, nil, nil, 0, err
|
||||
return sdk.GasInfo{}, nil, nil, err
|
||||
}
|
||||
|
||||
if app.anteHandler != nil {
|
||||
@ -690,7 +835,7 @@ func (app *BaseApp) runTx(mode runTxMode, txBytes []byte) (gInfo sdk.GasInfo, re
|
||||
// performance benefits, but it'll be more difficult to get right.
|
||||
anteCtx, msCache = app.cacheTxContext(ctx, txBytes)
|
||||
anteCtx = anteCtx.WithEventManager(sdk.NewEventManager())
|
||||
newCtx, err := app.anteHandler(anteCtx, tx, mode == runTxModeSimulate)
|
||||
newCtx, err := app.anteHandler(anteCtx, tx, mode == execModeSimulate)
|
||||
|
||||
if !newCtx.IsZero() {
|
||||
// At this point, newCtx.MultiStore() is a store branch, or something else
|
||||
@ -708,23 +853,22 @@ func (app *BaseApp) runTx(mode runTxMode, txBytes []byte) (gInfo sdk.GasInfo, re
|
||||
gasWanted = ctx.GasMeter().Limit()
|
||||
|
||||
if err != nil {
|
||||
return gInfo, nil, nil, 0, err
|
||||
return gInfo, nil, nil, err
|
||||
}
|
||||
|
||||
priority = ctx.Priority()
|
||||
msCache.Write()
|
||||
anteEvents = events.ToABCIEvents()
|
||||
}
|
||||
|
||||
if mode == runTxModeCheck {
|
||||
if mode == execModeCheck {
|
||||
err = app.mempool.Insert(ctx, tx)
|
||||
if err != nil {
|
||||
return gInfo, nil, anteEvents, priority, err
|
||||
return gInfo, nil, anteEvents, err
|
||||
}
|
||||
} else if mode == runTxModeDeliver {
|
||||
} else if mode == execModeFinalize {
|
||||
err = app.mempool.Remove(tx)
|
||||
if err != nil && !errors.Is(err, mempool.ErrTxNotFound) {
|
||||
return gInfo, nil, anteEvents, priority,
|
||||
return gInfo, nil, anteEvents,
|
||||
fmt.Errorf("failed to remove tx from mempool: %w", err)
|
||||
}
|
||||
}
|
||||
@ -748,28 +892,28 @@ func (app *BaseApp) runTx(mode runTxMode, txBytes []byte) (gInfo sdk.GasInfo, re
|
||||
// Note that the state is still preserved.
|
||||
postCtx := runMsgCtx.WithEventManager(sdk.NewEventManager())
|
||||
|
||||
newCtx, err := app.postHandler(postCtx, tx, mode == runTxModeSimulate, err == nil)
|
||||
newCtx, err := app.postHandler(postCtx, tx, mode == execModeSimulate, err == nil)
|
||||
if err != nil {
|
||||
return gInfo, nil, anteEvents, priority, err
|
||||
return gInfo, nil, anteEvents, err
|
||||
}
|
||||
|
||||
result.Events = append(result.Events, newCtx.EventManager().ABCIEvents()...)
|
||||
}
|
||||
|
||||
if mode == runTxModeDeliver {
|
||||
if mode == execModeFinalize {
|
||||
// When block gas exceeds, it'll panic and won't commit the cached store.
|
||||
consumeBlockGas()
|
||||
|
||||
msCache.Write()
|
||||
}
|
||||
|
||||
if len(anteEvents) > 0 && (mode == runTxModeDeliver || mode == runTxModeSimulate) {
|
||||
if len(anteEvents) > 0 && (mode == execModeFinalize || mode == execModeSimulate) {
|
||||
// append the events in the order of occurrence
|
||||
result.Events = append(anteEvents, result.Events...)
|
||||
}
|
||||
}
|
||||
|
||||
return gInfo, result, anteEvents, priority, err
|
||||
return gInfo, result, anteEvents, err
|
||||
}
|
||||
|
||||
// runMsgs iterates through a list of messages and executes them with the provided
|
||||
@ -777,13 +921,13 @@ func (app *BaseApp) runTx(mode runTxMode, txBytes []byte) (gInfo sdk.GasInfo, re
|
||||
// and DeliverTx. An error is returned if any single message fails or if a
|
||||
// Handler does not exist for a given message route. Otherwise, a reference to a
|
||||
// Result is returned. The caller must not commit state if an error is returned.
|
||||
func (app *BaseApp) runMsgs(ctx sdk.Context, msgs []sdk.Msg, mode runTxMode) (*sdk.Result, error) {
|
||||
func (app *BaseApp) runMsgs(ctx sdk.Context, msgs []sdk.Msg, mode execMode) (*sdk.Result, error) {
|
||||
events := sdk.EmptyEvents()
|
||||
var msgResponses []*codectypes.Any
|
||||
|
||||
// NOTE: GasWanted is determined by the AnteHandler and GasUsed by the GasMeter.
|
||||
for i, msg := range msgs {
|
||||
if mode != runTxModeDeliver && mode != runTxModeSimulate {
|
||||
if mode != execModeFinalize && mode != execModeSimulate {
|
||||
break
|
||||
}
|
||||
|
||||
@ -874,7 +1018,7 @@ func (app *BaseApp) PrepareProposalVerifyTx(tx sdk.Tx) ([]byte, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
_, _, _, _, err = app.runTx(runTxPrepareProposal, bz)
|
||||
_, _, _, err = app.runTx(execModePrepareProposal, bz)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -893,7 +1037,7 @@ func (app *BaseApp) ProcessProposalVerifyTx(txBz []byte) (sdk.Tx, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
_, _, _, _, err = app.runTx(runTxProcessProposal, txBz)
|
||||
_, _, _, err = app.runTx(execModeProcessProposal, txBz)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -901,137 +1045,6 @@ func (app *BaseApp) ProcessProposalVerifyTx(txBz []byte) (sdk.Tx, error) {
|
||||
return tx, nil
|
||||
}
|
||||
|
||||
type (
|
||||
// ProposalTxVerifier defines the interface that is implemented by BaseApp,
|
||||
// that any custom ABCI PrepareProposal and ProcessProposal handler can use
|
||||
// to verify a transaction.
|
||||
ProposalTxVerifier interface {
|
||||
PrepareProposalVerifyTx(tx sdk.Tx) ([]byte, error)
|
||||
ProcessProposalVerifyTx(txBz []byte) (sdk.Tx, error)
|
||||
}
|
||||
|
||||
// DefaultProposalHandler defines the default ABCI PrepareProposal and
|
||||
// ProcessProposal handlers.
|
||||
DefaultProposalHandler struct {
|
||||
mempool mempool.Mempool
|
||||
txVerifier ProposalTxVerifier
|
||||
}
|
||||
)
|
||||
|
||||
func NewDefaultProposalHandler(mp mempool.Mempool, txVerifier ProposalTxVerifier) DefaultProposalHandler {
|
||||
return DefaultProposalHandler{
|
||||
mempool: mp,
|
||||
txVerifier: txVerifier,
|
||||
}
|
||||
}
|
||||
|
||||
// PrepareProposalHandler returns the default implementation for processing an
|
||||
// ABCI proposal. The application's mempool is enumerated and all valid
|
||||
// transactions are added to the proposal. Transactions are valid if they:
|
||||
//
|
||||
// 1) Successfully encode to bytes.
|
||||
// 2) Are valid (i.e. pass runTx, AnteHandler only).
|
||||
//
|
||||
// Enumeration is halted once RequestPrepareProposal.MaxBytes of transactions is
|
||||
// reached or the mempool is exhausted.
|
||||
//
|
||||
// Note:
|
||||
//
|
||||
// - Step (2) is identical to the validation step performed in
|
||||
// DefaultProcessProposal. It is very important that the same validation logic
|
||||
// is used in both steps, and applications must ensure that this is the case in
|
||||
// non-default handlers.
|
||||
//
|
||||
// - If no mempool is set or if the mempool is a no-op mempool, the transactions
|
||||
// requested from CometBFT will simply be returned, which, by default, are in
|
||||
// FIFO order.
|
||||
func (h DefaultProposalHandler) PrepareProposalHandler() sdk.PrepareProposalHandler {
|
||||
return func(ctx sdk.Context, req abci.RequestPrepareProposal) abci.ResponsePrepareProposal {
|
||||
// If the mempool is nil or a no-op mempool, we simply return the transactions
|
||||
// requested from CometBFT, which, by default, should be in FIFO order.
|
||||
_, isNoOp := h.mempool.(mempool.NoOpMempool)
|
||||
if h.mempool == nil || isNoOp {
|
||||
return abci.ResponsePrepareProposal{Txs: req.Txs}
|
||||
}
|
||||
|
||||
var (
|
||||
selectedTxs [][]byte
|
||||
totalTxBytes int64
|
||||
)
|
||||
|
||||
iterator := h.mempool.Select(ctx, req.Txs)
|
||||
|
||||
for iterator != nil {
|
||||
memTx := iterator.Tx()
|
||||
|
||||
// NOTE: Since transaction verification was already executed in CheckTx,
|
||||
// which calls mempool.Insert, in theory everything in the pool should be
|
||||
// valid. But some mempool implementations may insert invalid txs, so we
|
||||
// check again.
|
||||
bz, err := h.txVerifier.PrepareProposalVerifyTx(memTx)
|
||||
if err != nil {
|
||||
err := h.mempool.Remove(memTx)
|
||||
if err != nil && !errors.Is(err, mempool.ErrTxNotFound) {
|
||||
panic(err)
|
||||
}
|
||||
} else {
|
||||
txSize := int64(len(bz))
|
||||
if totalTxBytes += txSize; totalTxBytes <= req.MaxTxBytes {
|
||||
selectedTxs = append(selectedTxs, bz)
|
||||
} else {
|
||||
// We've reached capacity per req.MaxTxBytes so we cannot select any
|
||||
// more transactions.
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
iterator = iterator.Next()
|
||||
}
|
||||
|
||||
return abci.ResponsePrepareProposal{Txs: selectedTxs}
|
||||
}
|
||||
}
|
||||
|
||||
// ProcessProposalHandler returns the default implementation for processing an
|
||||
// ABCI proposal. Every transaction in the proposal must pass 2 conditions:
|
||||
//
|
||||
// 1. The transaction bytes must decode to a valid transaction.
|
||||
// 2. The transaction must be valid (i.e. pass runTx, AnteHandler only)
|
||||
//
|
||||
// If any transaction fails to pass either condition, the proposal is rejected.
|
||||
// Note that step (2) is identical to the validation step performed in
|
||||
// DefaultPrepareProposal. It is very important that the same validation logic
|
||||
// is used in both steps, and applications must ensure that this is the case in
|
||||
// non-default handlers.
|
||||
func (h DefaultProposalHandler) ProcessProposalHandler() sdk.ProcessProposalHandler {
|
||||
return func(ctx sdk.Context, req abci.RequestProcessProposal) abci.ResponseProcessProposal {
|
||||
for _, txBytes := range req.Txs {
|
||||
_, err := h.txVerifier.ProcessProposalVerifyTx(txBytes)
|
||||
if err != nil {
|
||||
return abci.ResponseProcessProposal{Status: abci.ResponseProcessProposal_REJECT}
|
||||
}
|
||||
}
|
||||
|
||||
return abci.ResponseProcessProposal{Status: abci.ResponseProcessProposal_ACCEPT}
|
||||
}
|
||||
}
|
||||
|
||||
// NoOpPrepareProposal defines a no-op PrepareProposal handler. It will always
|
||||
// return the transactions sent by the client's request.
|
||||
func NoOpPrepareProposal() sdk.PrepareProposalHandler {
|
||||
return func(_ sdk.Context, req abci.RequestPrepareProposal) abci.ResponsePrepareProposal {
|
||||
return abci.ResponsePrepareProposal{Txs: req.Txs}
|
||||
}
|
||||
}
|
||||
|
||||
// NoOpProcessProposal defines a no-op ProcessProposal Handler. It will always
|
||||
// return ACCEPT.
|
||||
func NoOpProcessProposal() sdk.ProcessProposalHandler {
|
||||
return func(_ sdk.Context, _ abci.RequestProcessProposal) abci.ResponseProcessProposal {
|
||||
return abci.ResponseProcessProposal{Status: abci.ResponseProcessProposal_ACCEPT}
|
||||
}
|
||||
}
|
||||
|
||||
// Close is called in start cmd to gracefully cleanup resources.
|
||||
func (app *BaseApp) Close() error {
|
||||
return nil
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package baseapp_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"testing"
|
||||
@ -97,7 +98,7 @@ func NewBaseAppSuiteWithSnapshots(t *testing.T, cfg SnapshotsConfig, opts ...fun
|
||||
|
||||
baseapptestutil.RegisterKeyValueServer(suite.baseApp.MsgServiceRouter(), MsgKeyValueImpl{})
|
||||
|
||||
suite.baseApp.InitChain(abci.RequestInitChain{
|
||||
suite.baseApp.InitChain(&abci.RequestInitChain{
|
||||
ConsensusParams: &cmtproto.ConsensusParams{},
|
||||
})
|
||||
|
||||
@ -105,8 +106,8 @@ func NewBaseAppSuiteWithSnapshots(t *testing.T, cfg SnapshotsConfig, opts ...fun
|
||||
keyCounter := 0
|
||||
|
||||
for height := int64(1); height <= int64(cfg.blocks); height++ {
|
||||
suite.baseApp.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: height}})
|
||||
|
||||
txs := [][]byte{}
|
||||
for txNum := 0; txNum < cfg.blockTxs; txNum++ {
|
||||
msgs := []sdk.Msg{}
|
||||
for msgNum := 0; msgNum < 100; msgNum++ {
|
||||
@ -127,12 +128,17 @@ func NewBaseAppSuiteWithSnapshots(t *testing.T, cfg SnapshotsConfig, opts ...fun
|
||||
txBytes, err := suite.txConfig.TxEncoder()(builder.GetTx())
|
||||
require.NoError(t, err)
|
||||
|
||||
resp := suite.baseApp.DeliverTx(abci.RequestDeliverTx{Tx: txBytes})
|
||||
require.True(t, resp.IsOK(), "%v", resp.String())
|
||||
txs = append(txs, txBytes)
|
||||
}
|
||||
|
||||
suite.baseApp.EndBlock(abci.RequestEndBlock{Height: height})
|
||||
suite.baseApp.Commit()
|
||||
_, err := suite.baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{
|
||||
Height: height,
|
||||
Txs: txs,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
_, err = suite.baseApp.Commit()
|
||||
require.NoError(t, err)
|
||||
|
||||
// wait for snapshot to be taken, since it happens asynchronously
|
||||
if cfg.snapshotInterval > 0 && uint64(height)%cfg.snapshotInterval == 0 {
|
||||
@ -177,16 +183,18 @@ func TestLoadVersion(t *testing.T) {
|
||||
require.Equal(t, emptyCommitID, lastID)
|
||||
|
||||
// execute a block, collect commit ID
|
||||
header := cmtproto.Header{Height: 1}
|
||||
app.BeginBlock(abci.RequestBeginBlock{Header: header})
|
||||
res := app.Commit()
|
||||
commitID1 := storetypes.CommitID{Version: 1, Hash: res.Data}
|
||||
res, err := app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 1})
|
||||
require.NoError(t, err)
|
||||
commitID1 := storetypes.CommitID{Version: 1, Hash: res.AppHash}
|
||||
_, err = app.Commit()
|
||||
require.NoError(t, err)
|
||||
|
||||
// execute a block, collect commit ID
|
||||
header = cmtproto.Header{Height: 2}
|
||||
app.BeginBlock(abci.RequestBeginBlock{Header: header})
|
||||
res = app.Commit()
|
||||
commitID2 := storetypes.CommitID{Version: 2, Hash: res.Data}
|
||||
res, err = app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 2})
|
||||
require.NoError(t, err)
|
||||
commitID2 := storetypes.CommitID{Version: 2, Hash: res.AppHash}
|
||||
_, err = app.Commit()
|
||||
require.NoError(t, err)
|
||||
|
||||
// reload with LoadLatestVersion
|
||||
app = baseapp.NewBaseApp(name, logger, db, nil, pruningOpt)
|
||||
@ -205,8 +213,10 @@ func TestLoadVersion(t *testing.T) {
|
||||
|
||||
testLoadVersionHelper(t, app, int64(1), commitID1)
|
||||
|
||||
app.BeginBlock(abci.RequestBeginBlock{Header: header})
|
||||
app.Commit()
|
||||
_, err = app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 2})
|
||||
require.NoError(t, err)
|
||||
_, err = app.Commit()
|
||||
require.NoError(t, err)
|
||||
|
||||
testLoadVersionHelper(t, app, int64(2), commitID2)
|
||||
}
|
||||
@ -289,9 +299,11 @@ func TestSetLoader(t *testing.T) {
|
||||
require.Nil(t, err)
|
||||
|
||||
// "execute" one block
|
||||
app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: 2}})
|
||||
res := app.Commit()
|
||||
require.NotNil(t, res.Data)
|
||||
res, err := app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 2})
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, res.AppHash)
|
||||
_, err = app.Commit()
|
||||
require.NoError(t, err)
|
||||
|
||||
// check db is properly updated
|
||||
checkStore(t, db, 2, tc.loadStoreKey, k, v)
|
||||
@ -307,7 +319,8 @@ func TestVersionSetterGetter(t *testing.T) {
|
||||
app := baseapp.NewBaseApp(name, log.NewTestLogger(t), db, nil, pruningOpt)
|
||||
|
||||
require.Equal(t, "", app.Version())
|
||||
res := app.Query(abci.RequestQuery{Path: "app/version"})
|
||||
res, err := app.Query(context.TODO(), &abci.RequestQuery{Path: "app/version"})
|
||||
require.NoError(t, err)
|
||||
require.True(t, res.IsOK())
|
||||
require.Equal(t, "", string(res.Value))
|
||||
|
||||
@ -315,7 +328,8 @@ func TestVersionSetterGetter(t *testing.T) {
|
||||
app.SetVersion(versionString)
|
||||
require.Equal(t, versionString, app.Version())
|
||||
|
||||
res = app.Query(abci.RequestQuery{Path: "app/version"})
|
||||
res, err = app.Query(context.TODO(), &abci.RequestQuery{Path: "app/version"})
|
||||
require.NoError(t, err)
|
||||
require.True(t, res.IsOK())
|
||||
require.Equal(t, versionString, string(res.Value))
|
||||
}
|
||||
@ -334,10 +348,11 @@ func TestLoadVersionInvalid(t *testing.T) {
|
||||
err = app.LoadVersion(-1)
|
||||
require.Error(t, err)
|
||||
|
||||
header := cmtproto.Header{Height: 1}
|
||||
app.BeginBlock(abci.RequestBeginBlock{Header: header})
|
||||
res := app.Commit()
|
||||
commitID1 := storetypes.CommitID{Version: 1, Hash: res.Data}
|
||||
res, err := app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 1})
|
||||
require.NoError(t, err)
|
||||
commitID1 := storetypes.CommitID{Version: 1, Hash: res.AppHash}
|
||||
_, err = app.Commit()
|
||||
require.NoError(t, err)
|
||||
|
||||
// create a new app with the stores mounted under the same cap key
|
||||
app = baseapp.NewBaseApp(name, logger, db, nil, pruningOpt)
|
||||
@ -437,13 +452,10 @@ func TestCustomRunTxPanicHandler(t *testing.T) {
|
||||
}
|
||||
suite := NewBaseAppSuite(t, anteOpt)
|
||||
|
||||
suite.baseApp.InitChain(abci.RequestInitChain{
|
||||
suite.baseApp.InitChain(&abci.RequestInitChain{
|
||||
ConsensusParams: &cmtproto.ConsensusParams{},
|
||||
})
|
||||
|
||||
header := cmtproto.Header{Height: 1}
|
||||
suite.baseApp.BeginBlock(abci.RequestBeginBlock{Header: header})
|
||||
|
||||
suite.baseApp.AddRunTxRecoveryHandler(func(recoveryObj interface{}) error {
|
||||
err, ok := recoveryObj.(error)
|
||||
if !ok {
|
||||
@ -462,7 +474,9 @@ func TestCustomRunTxPanicHandler(t *testing.T) {
|
||||
tx := newTxCounter(t, suite.txConfig, 0, 0)
|
||||
|
||||
require.PanicsWithValue(t, customPanicMsg, func() {
|
||||
suite.baseApp.SimDeliver(suite.txConfig.TxEncoder(), tx)
|
||||
bz, err := suite.txConfig.TxEncoder()(tx)
|
||||
require.NoError(t, err)
|
||||
suite.baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 1, Txs: [][]byte{bz}})
|
||||
})
|
||||
}
|
||||
}
|
||||
@ -477,13 +491,10 @@ func TestBaseAppAnteHandler(t *testing.T) {
|
||||
deliverKey := []byte("deliver-key")
|
||||
baseapptestutil.RegisterCounterServer(suite.baseApp.MsgServiceRouter(), CounterServerImpl{t, capKey1, deliverKey})
|
||||
|
||||
suite.baseApp.InitChain(abci.RequestInitChain{
|
||||
suite.baseApp.InitChain(&abci.RequestInitChain{
|
||||
ConsensusParams: &cmtproto.ConsensusParams{},
|
||||
})
|
||||
|
||||
header := cmtproto.Header{Height: suite.baseApp.LastBlockHeight() + 1}
|
||||
suite.baseApp.BeginBlock(abci.RequestBeginBlock{Header: header})
|
||||
|
||||
// execute a tx that will fail ante handler execution
|
||||
//
|
||||
// NOTE: State should not be mutated here. This will be implicitly checked by
|
||||
@ -494,11 +505,12 @@ func TestBaseAppAnteHandler(t *testing.T) {
|
||||
txBytes, err := suite.txConfig.TxEncoder()(tx)
|
||||
require.NoError(t, err)
|
||||
|
||||
res := suite.baseApp.DeliverTx(abci.RequestDeliverTx{Tx: txBytes})
|
||||
res, err := suite.baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 1, Txs: [][]byte{txBytes}})
|
||||
require.NoError(t, err)
|
||||
require.Empty(t, res.Events)
|
||||
require.False(t, res.IsOK(), fmt.Sprintf("%v", res))
|
||||
require.False(t, res.TxResults[0].IsOK(), fmt.Sprintf("%v", res))
|
||||
|
||||
ctx := getDeliverStateCtx(suite.baseApp)
|
||||
ctx := getFinalizeBlockStateCtx(suite.baseApp)
|
||||
store := ctx.KVStore(capKey1)
|
||||
require.Equal(t, int64(0), getIntFromStore(t, store, anteKey))
|
||||
|
||||
@ -510,11 +522,12 @@ func TestBaseAppAnteHandler(t *testing.T) {
|
||||
txBytes, err = suite.txConfig.TxEncoder()(tx)
|
||||
require.NoError(t, err)
|
||||
|
||||
res = suite.baseApp.DeliverTx(abci.RequestDeliverTx{Tx: txBytes})
|
||||
require.NotEmpty(t, res.Events)
|
||||
require.False(t, res.IsOK(), fmt.Sprintf("%v", res))
|
||||
res, err = suite.baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 1, Txs: [][]byte{txBytes}})
|
||||
require.NoError(t, err)
|
||||
require.Empty(t, res.Events)
|
||||
require.False(t, res.TxResults[0].IsOK(), fmt.Sprintf("%v", res))
|
||||
|
||||
ctx = getDeliverStateCtx(suite.baseApp)
|
||||
ctx = getFinalizeBlockStateCtx(suite.baseApp)
|
||||
store = ctx.KVStore(capKey1)
|
||||
require.Equal(t, int64(1), getIntFromStore(t, store, anteKey))
|
||||
require.Equal(t, int64(0), getIntFromStore(t, store, deliverKey))
|
||||
@ -526,16 +539,16 @@ func TestBaseAppAnteHandler(t *testing.T) {
|
||||
txBytes, err = suite.txConfig.TxEncoder()(tx)
|
||||
require.NoError(t, err)
|
||||
|
||||
res = suite.baseApp.DeliverTx(abci.RequestDeliverTx{Tx: txBytes})
|
||||
require.NotEmpty(t, res.Events)
|
||||
require.True(t, res.IsOK(), fmt.Sprintf("%v", res))
|
||||
res, err = suite.baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 1, Txs: [][]byte{txBytes}})
|
||||
require.NoError(t, err)
|
||||
require.NotEmpty(t, res.TxResults[0].Events)
|
||||
require.True(t, res.TxResults[0].IsOK(), fmt.Sprintf("%v", res))
|
||||
|
||||
ctx = getDeliverStateCtx(suite.baseApp)
|
||||
ctx = getFinalizeBlockStateCtx(suite.baseApp)
|
||||
store = ctx.KVStore(capKey1)
|
||||
require.Equal(t, int64(2), getIntFromStore(t, store, anteKey))
|
||||
require.Equal(t, int64(1), getIntFromStore(t, store, deliverKey))
|
||||
|
||||
suite.baseApp.EndBlock(abci.RequestEndBlock{})
|
||||
suite.baseApp.Commit()
|
||||
}
|
||||
|
||||
@ -550,10 +563,10 @@ func TestABCI_CreateQueryContext(t *testing.T) {
|
||||
name := t.Name()
|
||||
app := baseapp.NewBaseApp(name, log.NewTestLogger(t), db, nil)
|
||||
|
||||
app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: 1}})
|
||||
app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 1})
|
||||
app.Commit()
|
||||
|
||||
app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: 2}})
|
||||
app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 2})
|
||||
app.Commit()
|
||||
|
||||
testCases := []struct {
|
||||
@ -590,8 +603,8 @@ func TestSetMinGasPrices(t *testing.T) {
|
||||
|
||||
func TestGetMaximumBlockGas(t *testing.T) {
|
||||
suite := NewBaseAppSuite(t)
|
||||
suite.baseApp.InitChain(abci.RequestInitChain{})
|
||||
ctx := suite.baseApp.NewContext(true, cmtproto.Header{})
|
||||
suite.baseApp.InitChain(&abci.RequestInitChain{})
|
||||
ctx := suite.baseApp.NewContext(true, cmtproto.Header{}) // TODO remove header here
|
||||
|
||||
suite.baseApp.StoreConsensusParams(ctx, cmtproto.ConsensusParams{Block: &cmtproto.BlockParams{MaxGas: 0}})
|
||||
require.Equal(t, uint64(0), suite.baseApp.GetMaximumBlockGas(ctx))
|
||||
@ -634,9 +647,11 @@ func TestLoadVersionPruning(t *testing.T) {
|
||||
// Commit seven blocks, of which 7 (latest) is kept in addition to 6, 5
|
||||
// (keep recent) and 3 (keep every).
|
||||
for i := int64(1); i <= 7; i++ {
|
||||
app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: i}})
|
||||
res := app.Commit()
|
||||
lastCommitID = storetypes.CommitID{Version: i, Hash: res.Data}
|
||||
res, err := app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: i})
|
||||
require.NoError(t, err)
|
||||
_, err = app.Commit()
|
||||
require.NoError(t, err)
|
||||
lastCommitID = storetypes.CommitID{Version: i, Hash: res.AppHash}
|
||||
}
|
||||
|
||||
for _, v := range []int64{1, 2, 4} {
|
||||
|
||||
@ -118,7 +118,7 @@ func TestBaseApp_BlockGas(t *testing.T) {
|
||||
genState := GenesisStateWithSingleValidator(t, cdc, appBuilder)
|
||||
stateBytes, err := cmtjson.MarshalIndent(genState, "", " ")
|
||||
require.NoError(t, err)
|
||||
bapp.InitChain(abci.RequestInitChain{
|
||||
bapp.InitChain(&abci.RequestInitChain{
|
||||
Validators: []abci.ValidatorUpdate{},
|
||||
ConsensusParams: simtestutil.DefaultConsensusParams,
|
||||
AppStateBytes: stateBytes,
|
||||
@ -158,22 +158,22 @@ func TestBaseApp_BlockGas(t *testing.T) {
|
||||
_, txBytes, err := createTestTx(txConfig, txBuilder, privs, accNums, accSeqs, ctx.ChainID())
|
||||
require.NoError(t, err)
|
||||
|
||||
bapp.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: 1}})
|
||||
rsp := bapp.DeliverTx(abci.RequestDeliverTx{Tx: txBytes})
|
||||
rsp, err := bapp.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 1, Txs: [][]byte{txBytes}})
|
||||
require.NoError(t, err)
|
||||
|
||||
// check result
|
||||
ctx = bapp.GetContextForDeliverTx(txBytes)
|
||||
ctx = bapp.GetContextForFinalizeBlock(txBytes)
|
||||
okValue := ctx.KVStore(bapp.UnsafeFindStoreKey(banktypes.ModuleName)).Get([]byte("ok"))
|
||||
|
||||
if tc.expErr {
|
||||
if tc.panicTx {
|
||||
require.Equal(t, sdkerrors.ErrPanic.ABCICode(), rsp.Code)
|
||||
require.Equal(t, sdkerrors.ErrPanic.ABCICode(), rsp.TxResults[0].Code)
|
||||
} else {
|
||||
require.Equal(t, sdkerrors.ErrOutOfGas.ABCICode(), rsp.Code)
|
||||
require.Equal(t, sdkerrors.ErrOutOfGas.ABCICode(), rsp.TxResults[0].Code)
|
||||
}
|
||||
require.Empty(t, okValue)
|
||||
} else {
|
||||
require.Equal(t, uint32(0), rsp.Code)
|
||||
require.Equal(t, uint32(0), rsp.TxResults[0].Code)
|
||||
require.Equal(t, []byte("ok"), okValue)
|
||||
}
|
||||
// check block gas is always consumed
|
||||
|
||||
@ -12,7 +12,7 @@ var _ genesis.TxHandler = (*BaseApp)(nil)
|
||||
// ExecuteGenesisTx implements genesis.GenesisState from
|
||||
// cosmossdk.io/core/genesis to set initial state in genesis
|
||||
func (ba BaseApp) ExecuteGenesisTx(tx []byte) error {
|
||||
res := ba.DeliverTx(types.RequestDeliverTx{Tx: tx})
|
||||
res := ba.deliverTx(tx)
|
||||
|
||||
if res.Code != types.CodeTypeOK {
|
||||
return errors.New(res.Log)
|
||||
|
||||
@ -38,7 +38,7 @@ func NewGRPCQueryRouter() *GRPCQueryRouter {
|
||||
|
||||
// GRPCQueryHandler defines a function type which handles ABCI Query requests
|
||||
// using gRPC
|
||||
type GRPCQueryHandler = func(ctx sdk.Context, req abci.RequestQuery) (abci.ResponseQuery, error)
|
||||
type GRPCQueryHandler = func(ctx sdk.Context, req *abci.RequestQuery) (*abci.ResponseQuery, error)
|
||||
|
||||
// Route returns the GRPCQueryHandler for a given query route path or nil
|
||||
// if not found
|
||||
@ -76,25 +76,25 @@ func (qrt *GRPCQueryRouter) RegisterService(sd *grpc.ServiceDesc, handler interf
|
||||
)
|
||||
}
|
||||
|
||||
qrt.routes[fqName] = func(ctx sdk.Context, req abci.RequestQuery) (abci.ResponseQuery, error) {
|
||||
qrt.routes[fqName] = func(ctx sdk.Context, req *abci.RequestQuery) (*abci.ResponseQuery, error) {
|
||||
// call the method handler from the service description with the handler object,
|
||||
// a wrapped sdk.Context with proto-unmarshaled data from the ABCI request data
|
||||
res, err := methodHandler(handler, ctx, func(i interface{}) error {
|
||||
return qrt.cdc.Unmarshal(req.Data, i)
|
||||
}, nil)
|
||||
if err != nil {
|
||||
return abci.ResponseQuery{}, err
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// proto marshal the result bytes
|
||||
var resBytes []byte
|
||||
resBytes, err = qrt.cdc.Marshal(res)
|
||||
if err != nil {
|
||||
return abci.ResponseQuery{}, err
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// return the result bytes as the response value
|
||||
return abci.ResponseQuery{
|
||||
return &abci.ResponseQuery{
|
||||
Height: req.Height,
|
||||
Value: resBytes,
|
||||
}, nil
|
||||
|
||||
@ -45,7 +45,7 @@ func (q *QueryServiceTestHelper) Invoke(_ gocontext.Context, method string, args
|
||||
return err
|
||||
}
|
||||
|
||||
res, err := querier(q.Ctx, abci.RequestQuery{Data: reqBz})
|
||||
res, err := querier(q.Ctx, &abci.RequestQuery{Data: reqBz})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@ -83,8 +83,8 @@ type voteInfoWrapper struct {
|
||||
|
||||
var _ comet.VoteInfo = (*voteInfoWrapper)(nil)
|
||||
|
||||
func (v voteInfoWrapper) SignedLastBlock() bool {
|
||||
return v.VoteInfo.SignedLastBlock
|
||||
func (v voteInfoWrapper) GetBlockIDFlag() comet.BlockIDFlag {
|
||||
return comet.BlockIDFlag(v.VoteInfo.BlockIdFlag)
|
||||
}
|
||||
|
||||
func (v voteInfoWrapper) Validator() comet.Validator {
|
||||
@ -131,7 +131,7 @@ func (m misbehaviorWrapper) TotalVotingPower() int64 {
|
||||
}
|
||||
|
||||
type prepareProposalInfo struct {
|
||||
abci.RequestPrepareProposal
|
||||
*abci.RequestPrepareProposal
|
||||
}
|
||||
|
||||
var _ comet.BlockInfo = (*prepareProposalInfo)(nil)
|
||||
@ -188,8 +188,8 @@ type extendedVoteInfoWrapper struct {
|
||||
|
||||
var _ comet.VoteInfo = (*extendedVoteInfoWrapper)(nil)
|
||||
|
||||
func (e extendedVoteInfoWrapper) SignedLastBlock() bool {
|
||||
return e.ExtendedVoteInfo.SignedLastBlock
|
||||
func (e extendedVoteInfoWrapper) GetBlockIDFlag() comet.BlockIDFlag {
|
||||
return comet.BlockIDFlag(e.ExtendedVoteInfo.BlockIdFlag)
|
||||
}
|
||||
|
||||
func (e extendedVoteInfoWrapper) Validator() comet.Validator {
|
||||
|
||||
@ -5,7 +5,6 @@ import (
|
||||
"testing"
|
||||
|
||||
abci "github.com/cometbft/cometbft/abci/types"
|
||||
cmtproto "github.com/cometbft/cometbft/proto/tendermint/types"
|
||||
dbm "github.com/cosmos/cosmos-db"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
@ -116,7 +115,7 @@ func TestMsgService(t *testing.T) {
|
||||
app.MsgServiceRouter(),
|
||||
testdata.MsgServerImpl{},
|
||||
)
|
||||
_ = app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: 1}})
|
||||
app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 1})
|
||||
|
||||
msg := testdata.MsgCreateDog{Dog: &testdata.Dog{Name: "Spot"}}
|
||||
|
||||
@ -157,6 +156,7 @@ func TestMsgService(t *testing.T) {
|
||||
// Send the tx to the app
|
||||
txBytes, err := txConfig.TxEncoder()(txBuilder.GetTx())
|
||||
require.NoError(t, err)
|
||||
res := app.DeliverTx(abci.RequestDeliverTx{Tx: txBytes})
|
||||
require.Equal(t, abci.CodeTypeOK, res.Code, "res=%+v", res)
|
||||
res, err := app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 1, Txs: [][]byte{txBytes}})
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, abci.CodeTypeOK, res.TxResults[0].Code, "res=%+v", res)
|
||||
}
|
||||
|
||||
@ -300,6 +300,22 @@ func (app *BaseApp) SetPrepareProposal(handler sdk.PrepareProposalHandler) {
|
||||
app.prepareProposal = handler
|
||||
}
|
||||
|
||||
func (app *BaseApp) SetExtendVoteHandler(handler sdk.ExtendVoteHandler) {
|
||||
if app.sealed {
|
||||
panic("SetExtendVoteHandler() on sealed BaseApp")
|
||||
}
|
||||
|
||||
app.extendVote = handler
|
||||
}
|
||||
|
||||
func (app *BaseApp) SetVerifyVoteExtensionHandler(handler sdk.VerifyVoteExtensionHandler) {
|
||||
if app.sealed {
|
||||
panic("SetVerifyVoteExtensionHandler() on sealed BaseApp")
|
||||
}
|
||||
|
||||
app.verifyVoteExt = handler
|
||||
}
|
||||
|
||||
// SetStoreMetrics sets the prepare proposal function for the BaseApp.
|
||||
func (app *BaseApp) SetStoreMetrics(gatherer metrics.StoreMetrics) {
|
||||
if app.sealed {
|
||||
|
||||
347
baseapp/snapshot_test.go
Normal file
347
baseapp/snapshot_test.go
Normal file
@ -0,0 +1,347 @@
|
||||
package baseapp_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
abci "github.com/cometbft/cometbft/abci/types"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
pruningtypes "cosmossdk.io/store/pruning/types"
|
||||
snapshottypes "cosmossdk.io/store/snapshots/types"
|
||||
)
|
||||
|
||||
func TestABCI_ListSnapshots(t *testing.T) {
|
||||
ssCfg := SnapshotsConfig{
|
||||
blocks: 5,
|
||||
blockTxs: 4,
|
||||
snapshotInterval: 2,
|
||||
snapshotKeepRecent: 2,
|
||||
pruningOpts: pruningtypes.NewPruningOptions(pruningtypes.PruningNothing),
|
||||
}
|
||||
|
||||
suite := NewBaseAppSuiteWithSnapshots(t, ssCfg)
|
||||
|
||||
resp, err := suite.baseApp.ListSnapshots(&abci.RequestListSnapshots{})
|
||||
require.NoError(t, err)
|
||||
for _, s := range resp.Snapshots {
|
||||
require.NotEmpty(t, s.Hash)
|
||||
require.NotEmpty(t, s.Metadata)
|
||||
|
||||
s.Hash = nil
|
||||
s.Metadata = nil
|
||||
}
|
||||
|
||||
require.Equal(t, &abci.ResponseListSnapshots{Snapshots: []*abci.Snapshot{
|
||||
{Height: 4, Format: snapshottypes.CurrentFormat, Chunks: 2},
|
||||
{Height: 2, Format: snapshottypes.CurrentFormat, Chunks: 1},
|
||||
}}, resp)
|
||||
}
|
||||
|
||||
func TestABCI_SnapshotWithPruning(t *testing.T) {
|
||||
testCases := map[string]struct {
|
||||
ssCfg SnapshotsConfig
|
||||
expectedSnapshots []*abci.Snapshot
|
||||
}{
|
||||
"prune nothing with snapshot": {
|
||||
ssCfg: SnapshotsConfig{
|
||||
blocks: 20,
|
||||
blockTxs: 2,
|
||||
snapshotInterval: 5,
|
||||
snapshotKeepRecent: 1,
|
||||
pruningOpts: pruningtypes.NewPruningOptions(pruningtypes.PruningNothing),
|
||||
},
|
||||
expectedSnapshots: []*abci.Snapshot{
|
||||
{Height: 20, Format: snapshottypes.CurrentFormat, Chunks: 5},
|
||||
},
|
||||
},
|
||||
"prune everything with snapshot": {
|
||||
ssCfg: SnapshotsConfig{
|
||||
blocks: 20,
|
||||
blockTxs: 2,
|
||||
snapshotInterval: 5,
|
||||
snapshotKeepRecent: 1,
|
||||
pruningOpts: pruningtypes.NewPruningOptions(pruningtypes.PruningEverything),
|
||||
},
|
||||
expectedSnapshots: []*abci.Snapshot{
|
||||
{Height: 20, Format: snapshottypes.CurrentFormat, Chunks: 5},
|
||||
},
|
||||
},
|
||||
"default pruning with snapshot": {
|
||||
ssCfg: SnapshotsConfig{
|
||||
blocks: 20,
|
||||
blockTxs: 2,
|
||||
snapshotInterval: 5,
|
||||
snapshotKeepRecent: 1,
|
||||
pruningOpts: pruningtypes.NewPruningOptions(pruningtypes.PruningDefault),
|
||||
},
|
||||
expectedSnapshots: []*abci.Snapshot{
|
||||
{Height: 20, Format: snapshottypes.CurrentFormat, Chunks: 5},
|
||||
},
|
||||
},
|
||||
"custom": {
|
||||
ssCfg: SnapshotsConfig{
|
||||
blocks: 25,
|
||||
blockTxs: 2,
|
||||
snapshotInterval: 5,
|
||||
snapshotKeepRecent: 2,
|
||||
pruningOpts: pruningtypes.NewCustomPruningOptions(12, 12),
|
||||
},
|
||||
expectedSnapshots: []*abci.Snapshot{
|
||||
{Height: 25, Format: snapshottypes.CurrentFormat, Chunks: 6},
|
||||
{Height: 20, Format: snapshottypes.CurrentFormat, Chunks: 5},
|
||||
},
|
||||
},
|
||||
"no snapshots": {
|
||||
ssCfg: SnapshotsConfig{
|
||||
blocks: 10,
|
||||
blockTxs: 2,
|
||||
snapshotInterval: 0, // 0 implies disable snapshots
|
||||
pruningOpts: pruningtypes.NewPruningOptions(pruningtypes.PruningNothing),
|
||||
},
|
||||
expectedSnapshots: []*abci.Snapshot{},
|
||||
},
|
||||
"keep all snapshots": {
|
||||
ssCfg: SnapshotsConfig{
|
||||
blocks: 10,
|
||||
blockTxs: 2,
|
||||
snapshotInterval: 3,
|
||||
snapshotKeepRecent: 0, // 0 implies keep all snapshots
|
||||
pruningOpts: pruningtypes.NewPruningOptions(pruningtypes.PruningNothing),
|
||||
},
|
||||
expectedSnapshots: []*abci.Snapshot{
|
||||
{Height: 9, Format: snapshottypes.CurrentFormat, Chunks: 2},
|
||||
{Height: 6, Format: snapshottypes.CurrentFormat, Chunks: 2},
|
||||
{Height: 3, Format: snapshottypes.CurrentFormat, Chunks: 1},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for name, tc := range testCases {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
suite := NewBaseAppSuiteWithSnapshots(t, tc.ssCfg)
|
||||
|
||||
resp, err := suite.baseApp.ListSnapshots(&abci.RequestListSnapshots{})
|
||||
require.NoError(t, err)
|
||||
for _, s := range resp.Snapshots {
|
||||
require.NotEmpty(t, s.Hash)
|
||||
require.NotEmpty(t, s.Metadata)
|
||||
|
||||
s.Hash = nil
|
||||
s.Metadata = nil
|
||||
}
|
||||
|
||||
require.Equal(t, &abci.ResponseListSnapshots{Snapshots: tc.expectedSnapshots}, resp)
|
||||
|
||||
// Validate that heights were pruned correctly by querying the state at the last height that should be present relative to latest
|
||||
// and the first height that should be pruned.
|
||||
//
|
||||
// Exceptions:
|
||||
// * Prune nothing: should be able to query all heights (we only test first and latest)
|
||||
// * Prune default: should be able to query all heights (we only test first and latest)
|
||||
// * The reason for default behaving this way is that we only commit 20 heights but default has 100_000 keep-recent
|
||||
var lastExistingHeight int64
|
||||
if tc.ssCfg.pruningOpts.GetPruningStrategy() == pruningtypes.PruningNothing || tc.ssCfg.pruningOpts.GetPruningStrategy() == pruningtypes.PruningDefault {
|
||||
lastExistingHeight = 1
|
||||
} else {
|
||||
// Integer division rounds down so by multiplying back we get the last height at which we pruned
|
||||
lastExistingHeight = int64((tc.ssCfg.blocks/tc.ssCfg.pruningOpts.Interval)*tc.ssCfg.pruningOpts.Interval - tc.ssCfg.pruningOpts.KeepRecent)
|
||||
}
|
||||
|
||||
// Query 1
|
||||
res, err := suite.baseApp.Query(context.TODO(), &abci.RequestQuery{Path: fmt.Sprintf("/store/%s/key", capKey2.Name()), Data: []byte("0"), Height: lastExistingHeight})
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, res, "height: %d", lastExistingHeight)
|
||||
require.NotNil(t, res.Value, "height: %d", lastExistingHeight)
|
||||
|
||||
// Query 2
|
||||
res, err = suite.baseApp.Query(context.TODO(), &abci.RequestQuery{Path: fmt.Sprintf("/store/%s/key", capKey2.Name()), Data: []byte("0"), Height: lastExistingHeight - 1})
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, res, "height: %d", lastExistingHeight-1)
|
||||
|
||||
if tc.ssCfg.pruningOpts.GetPruningStrategy() == pruningtypes.PruningNothing || tc.ssCfg.pruningOpts.GetPruningStrategy() == pruningtypes.PruningDefault {
|
||||
// With prune nothing or default, we query height 0 which translates to the latest height.
|
||||
require.NotNil(t, res.Value, "height: %d", lastExistingHeight-1)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestABCI_LoadSnapshotChunk(t *testing.T) {
|
||||
ssCfg := SnapshotsConfig{
|
||||
blocks: 2,
|
||||
blockTxs: 5,
|
||||
snapshotInterval: 2,
|
||||
snapshotKeepRecent: snapshottypes.CurrentFormat,
|
||||
pruningOpts: pruningtypes.NewPruningOptions(pruningtypes.PruningNothing),
|
||||
}
|
||||
suite := NewBaseAppSuiteWithSnapshots(t, ssCfg)
|
||||
|
||||
testCases := map[string]struct {
|
||||
height uint64
|
||||
format uint32
|
||||
chunk uint32
|
||||
expectEmpty bool
|
||||
}{
|
||||
"Existing snapshot": {2, snapshottypes.CurrentFormat, 1, false},
|
||||
"Missing height": {100, snapshottypes.CurrentFormat, 1, true},
|
||||
"Missing format": {2, snapshottypes.CurrentFormat + 1, 1, true},
|
||||
"Missing chunk": {2, snapshottypes.CurrentFormat, 9, true},
|
||||
"Zero height": {0, snapshottypes.CurrentFormat, 1, true},
|
||||
"Zero format": {2, 0, 1, true},
|
||||
"Zero chunk": {2, snapshottypes.CurrentFormat, 0, false},
|
||||
}
|
||||
|
||||
for name, tc := range testCases {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
resp, _ := suite.baseApp.LoadSnapshotChunk(&abci.RequestLoadSnapshotChunk{
|
||||
Height: tc.height,
|
||||
Format: tc.format,
|
||||
Chunk: tc.chunk,
|
||||
})
|
||||
if tc.expectEmpty {
|
||||
require.Equal(t, &abci.ResponseLoadSnapshotChunk{}, resp)
|
||||
return
|
||||
}
|
||||
|
||||
require.NotEmpty(t, resp.Chunk)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestABCI_OfferSnapshot_Errors(t *testing.T) {
|
||||
ssCfg := SnapshotsConfig{
|
||||
blocks: 0,
|
||||
blockTxs: 0,
|
||||
snapshotInterval: 2,
|
||||
snapshotKeepRecent: 2,
|
||||
pruningOpts: pruningtypes.NewPruningOptions(pruningtypes.PruningNothing),
|
||||
}
|
||||
suite := NewBaseAppSuiteWithSnapshots(t, ssCfg)
|
||||
|
||||
m := snapshottypes.Metadata{ChunkHashes: [][]byte{{1}, {2}, {3}}}
|
||||
metadata, err := m.Marshal()
|
||||
require.NoError(t, err)
|
||||
|
||||
hash := []byte{1, 2, 3}
|
||||
|
||||
testCases := map[string]struct {
|
||||
snapshot *abci.Snapshot
|
||||
result abci.ResponseOfferSnapshot_Result
|
||||
}{
|
||||
"nil snapshot": {nil, abci.ResponseOfferSnapshot_REJECT},
|
||||
"invalid format": {&abci.Snapshot{
|
||||
Height: 1, Format: 9, Chunks: 3, Hash: hash, Metadata: metadata,
|
||||
}, abci.ResponseOfferSnapshot_REJECT_FORMAT},
|
||||
"incorrect chunk count": {&abci.Snapshot{
|
||||
Height: 1, Format: snapshottypes.CurrentFormat, Chunks: 2, Hash: hash, Metadata: metadata,
|
||||
}, abci.ResponseOfferSnapshot_REJECT},
|
||||
"no chunks": {&abci.Snapshot{
|
||||
Height: 1, Format: snapshottypes.CurrentFormat, Chunks: 0, Hash: hash, Metadata: metadata,
|
||||
}, abci.ResponseOfferSnapshot_REJECT},
|
||||
"invalid metadata serialization": {&abci.Snapshot{
|
||||
Height: 1, Format: snapshottypes.CurrentFormat, Chunks: 0, Hash: hash, Metadata: []byte{3, 1, 4},
|
||||
}, abci.ResponseOfferSnapshot_REJECT},
|
||||
}
|
||||
for name, tc := range testCases {
|
||||
tc := tc
|
||||
t.Run(name, func(t *testing.T) {
|
||||
resp, err := suite.baseApp.OfferSnapshot(&abci.RequestOfferSnapshot{Snapshot: tc.snapshot})
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, tc.result, resp.Result)
|
||||
})
|
||||
}
|
||||
|
||||
// Offering a snapshot after one has been accepted should error
|
||||
resp, err := suite.baseApp.OfferSnapshot(&abci.RequestOfferSnapshot{Snapshot: &abci.Snapshot{
|
||||
Height: 1,
|
||||
Format: snapshottypes.CurrentFormat,
|
||||
Chunks: 3,
|
||||
Hash: []byte{1, 2, 3},
|
||||
Metadata: metadata,
|
||||
}})
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, &abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_ACCEPT}, resp)
|
||||
|
||||
resp, err = suite.baseApp.OfferSnapshot(&abci.RequestOfferSnapshot{Snapshot: &abci.Snapshot{
|
||||
Height: 2,
|
||||
Format: snapshottypes.CurrentFormat,
|
||||
Chunks: 3,
|
||||
Hash: []byte{1, 2, 3},
|
||||
Metadata: metadata,
|
||||
}})
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, &abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_ABORT}, resp)
|
||||
}
|
||||
|
||||
func TestABCI_ApplySnapshotChunk(t *testing.T) {
|
||||
srcCfg := SnapshotsConfig{
|
||||
blocks: 4,
|
||||
blockTxs: 10,
|
||||
snapshotInterval: 2,
|
||||
snapshotKeepRecent: 2,
|
||||
pruningOpts: pruningtypes.NewPruningOptions(pruningtypes.PruningNothing),
|
||||
}
|
||||
srcSuite := NewBaseAppSuiteWithSnapshots(t, srcCfg)
|
||||
|
||||
targetCfg := SnapshotsConfig{
|
||||
blocks: 0,
|
||||
blockTxs: 0,
|
||||
snapshotInterval: 2,
|
||||
snapshotKeepRecent: 2,
|
||||
pruningOpts: pruningtypes.NewPruningOptions(pruningtypes.PruningNothing),
|
||||
}
|
||||
targetSuite := NewBaseAppSuiteWithSnapshots(t, targetCfg)
|
||||
|
||||
// fetch latest snapshot to restore
|
||||
respList, err := srcSuite.baseApp.ListSnapshots(&abci.RequestListSnapshots{})
|
||||
require.NoError(t, err)
|
||||
require.NotEmpty(t, respList.Snapshots)
|
||||
snapshot := respList.Snapshots[0]
|
||||
|
||||
// make sure the snapshot has at least 3 chunks
|
||||
require.GreaterOrEqual(t, snapshot.Chunks, uint32(3), "Not enough snapshot chunks")
|
||||
|
||||
// begin a snapshot restoration in the target
|
||||
respOffer, err := targetSuite.baseApp.OfferSnapshot(&abci.RequestOfferSnapshot{Snapshot: snapshot})
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, &abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_ACCEPT}, respOffer)
|
||||
|
||||
// We should be able to pass an invalid chunk and get a verify failure, before
|
||||
// reapplying it.
|
||||
respApply, err := targetSuite.baseApp.ApplySnapshotChunk(&abci.RequestApplySnapshotChunk{
|
||||
Index: 0,
|
||||
Chunk: []byte{9},
|
||||
Sender: "sender",
|
||||
})
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, &abci.ResponseApplySnapshotChunk{
|
||||
Result: abci.ResponseApplySnapshotChunk_RETRY,
|
||||
RefetchChunks: []uint32{0},
|
||||
RejectSenders: []string{"sender"},
|
||||
}, respApply)
|
||||
|
||||
// fetch each chunk from the source and apply it to the target
|
||||
for index := uint32(0); index < snapshot.Chunks; index++ {
|
||||
respChunk, err := srcSuite.baseApp.LoadSnapshotChunk(&abci.RequestLoadSnapshotChunk{
|
||||
Height: snapshot.Height,
|
||||
Format: snapshot.Format,
|
||||
Chunk: index,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, respChunk.Chunk)
|
||||
|
||||
respApply, err := targetSuite.baseApp.ApplySnapshotChunk(&abci.RequestApplySnapshotChunk{
|
||||
Index: index,
|
||||
Chunk: respChunk.Chunk,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, &abci.ResponseApplySnapshotChunk{
|
||||
Result: abci.ResponseApplySnapshotChunk_ACCEPT,
|
||||
}, respApply)
|
||||
}
|
||||
|
||||
// the target should now have the same hash as the source
|
||||
require.Equal(t, srcSuite.baseApp.LastCommitID(), targetSuite.baseApp.LastCommitID())
|
||||
}
|
||||
@ -5,14 +5,13 @@ import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
storetypes "cosmossdk.io/store/types"
|
||||
abci "github.com/cometbft/cometbft/abci/types"
|
||||
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
storetypes "cosmossdk.io/store/types"
|
||||
"github.com/cosmos/cosmos-sdk/baseapp"
|
||||
baseapptestutil "github.com/cosmos/cosmos-sdk/baseapp/testutil"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
)
|
||||
|
||||
var _ storetypes.ABCIListener = (*MockABCIListener)(nil)
|
||||
@ -29,20 +28,12 @@ func NewMockABCIListener(name string) MockABCIListener {
|
||||
}
|
||||
}
|
||||
|
||||
func (m MockABCIListener) ListenBeginBlock(ctx context.Context, req abci.RequestBeginBlock, res abci.ResponseBeginBlock) error {
|
||||
func (m MockABCIListener) ListenFinalizeBlock(_ context.Context, _ abci.RequestFinalizeBlock, _ abci.ResponseFinalizeBlock) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m MockABCIListener) ListenEndBlock(ctx context.Context, req abci.RequestEndBlock, res abci.ResponseEndBlock) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m MockABCIListener) ListenDeliverTx(ctx context.Context, req abci.RequestDeliverTx, res abci.ResponseDeliverTx) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *MockABCIListener) ListenCommit(ctx context.Context, res abci.ResponseCommit, changeSet []*storetypes.StoreKVPair) error {
|
||||
m.ChangeSet = changeSet
|
||||
func (m *MockABCIListener) ListenCommit(_ context.Context, _ abci.ResponseCommit, cs []*storetypes.StoreKVPair) error {
|
||||
m.ChangeSet = cs
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -59,9 +50,11 @@ func TestABCI_MultiListener_StateChanges(t *testing.T) {
|
||||
addListenerOpt := func(bapp *baseapp.BaseApp) { bapp.CommitMultiStore().AddListeners([]storetypes.StoreKey{distKey1}) }
|
||||
suite := NewBaseAppSuite(t, anteOpt, distOpt, streamingManagerOpt, addListenerOpt)
|
||||
|
||||
suite.baseApp.InitChain(abci.RequestInitChain{
|
||||
ConsensusParams: &tmproto.ConsensusParams{},
|
||||
})
|
||||
suite.baseApp.InitChain(
|
||||
&abci.RequestInitChain{
|
||||
ConsensusParams: &tmproto.ConsensusParams{},
|
||||
},
|
||||
)
|
||||
|
||||
deliverKey := []byte("deliver-key")
|
||||
baseapptestutil.RegisterCounterServer(suite.baseApp.MsgServiceRouter(), CounterServerImpl{t, capKey1, deliverKey})
|
||||
@ -70,10 +63,14 @@ func TestABCI_MultiListener_StateChanges(t *testing.T) {
|
||||
txPerHeight := 5
|
||||
|
||||
for blockN := 0; blockN < nBlocks; blockN++ {
|
||||
header := tmproto.Header{Height: int64(blockN) + 1}
|
||||
suite.baseApp.BeginBlock(abci.RequestBeginBlock{Header: header})
|
||||
txs := [][]byte{}
|
||||
|
||||
var expectedChangeSet []*storetypes.StoreKVPair
|
||||
|
||||
// create final block context state
|
||||
_, err := suite.baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{Height: int64(blockN) + 1, Txs: txs})
|
||||
require.NoError(t, err)
|
||||
|
||||
for i := 0; i < txPerHeight; i++ {
|
||||
counter := int64(blockN*txPerHeight + i)
|
||||
tx := newTxCounter(t, suite.txConfig, counter, counter)
|
||||
@ -83,7 +80,7 @@ func TestABCI_MultiListener_StateChanges(t *testing.T) {
|
||||
|
||||
sKey := []byte(fmt.Sprintf("distKey%d", i))
|
||||
sVal := []byte(fmt.Sprintf("distVal%d", i))
|
||||
store := getDeliverStateCtx(suite.baseApp).KVStore(distKey1)
|
||||
store := getFinalizeBlockStateCtx(suite.baseApp).KVStore(distKey1)
|
||||
store.Set(sKey, sVal)
|
||||
|
||||
expectedChangeSet = append(expectedChangeSet, &storetypes.StoreKVPair{
|
||||
@ -93,16 +90,18 @@ func TestABCI_MultiListener_StateChanges(t *testing.T) {
|
||||
Value: sVal,
|
||||
})
|
||||
|
||||
res := suite.baseApp.DeliverTx(abci.RequestDeliverTx{Tx: txBytes})
|
||||
require.True(t, res.IsOK(), fmt.Sprintf("%v", res))
|
||||
|
||||
events := res.GetEvents()
|
||||
require.Len(t, events, 3, "should contain ante handler, message type and counter events respectively")
|
||||
require.Equal(t, sdk.MarkEventsToIndex(counterEvent("ante_handler", counter).ToABCIEvents(), map[string]struct{}{})[0], events[0], "ante handler event")
|
||||
require.Equal(t, sdk.MarkEventsToIndex(counterEvent(sdk.EventTypeMessage, counter).ToABCIEvents(), map[string]struct{}{})[0].Attributes[0], events[2].Attributes[0], "msg handler update counter event")
|
||||
txs = append(txs, txBytes)
|
||||
}
|
||||
|
||||
res, err := suite.baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{Height: int64(blockN) + 1, Txs: txs})
|
||||
require.NoError(t, err)
|
||||
for _, tx := range res.TxResults {
|
||||
events := tx.GetEvents()
|
||||
require.Len(t, events, 3, "should contain ante handler, message type and counter events respectively")
|
||||
// require.Equal(t, sdk.MarkEventsToIndex(counterEvent("ante_handler", counter).ToABCIEvents(), map[string]struct{}{})[0], events[0], "ante handler event")
|
||||
// require.Equal(t, sdk.MarkEventsToIndex(counterEvent(sdk.EventTypeMessage, counter).ToABCIEvents(), map[string]struct{}{})[0], events[2], "msg handler update counter event")
|
||||
}
|
||||
|
||||
suite.baseApp.EndBlock(abci.RequestEndBlock{})
|
||||
suite.baseApp.Commit()
|
||||
|
||||
require.Equal(t, expectedChangeSet, mockListener1.ChangeSet, "should contain the same changeSet")
|
||||
@ -119,11 +118,11 @@ func Test_Ctx_with_StreamingManager(t *testing.T) {
|
||||
addListenerOpt := func(bapp *baseapp.BaseApp) { bapp.CommitMultiStore().AddListeners([]storetypes.StoreKey{distKey1}) }
|
||||
suite := NewBaseAppSuite(t, streamingManagerOpt, addListenerOpt)
|
||||
|
||||
suite.baseApp.InitChain(abci.RequestInitChain{
|
||||
suite.baseApp.InitChain(&abci.RequestInitChain{
|
||||
ConsensusParams: &tmproto.ConsensusParams{},
|
||||
})
|
||||
|
||||
ctx := getDeliverStateCtx(suite.baseApp)
|
||||
ctx := getFinalizeBlockStateCtx(suite.baseApp)
|
||||
sm := ctx.StreamingManager()
|
||||
require.NotNil(t, sm, fmt.Sprintf("nil StreamingManager: %v", sm))
|
||||
require.Equal(t, listeners, sm.ABCIListeners, fmt.Sprintf("should contain same listeners: %v", listeners))
|
||||
@ -132,16 +131,15 @@ func Test_Ctx_with_StreamingManager(t *testing.T) {
|
||||
nBlocks := 2
|
||||
|
||||
for blockN := 0; blockN < nBlocks; blockN++ {
|
||||
header := tmproto.Header{Height: int64(blockN) + 1}
|
||||
suite.baseApp.BeginBlock(abci.RequestBeginBlock{Header: header})
|
||||
|
||||
ctx := getDeliverStateCtx(suite.baseApp)
|
||||
suite.baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{Height: int64(blockN) + 1})
|
||||
|
||||
ctx := getFinalizeBlockStateCtx(suite.baseApp)
|
||||
sm := ctx.StreamingManager()
|
||||
require.NotNil(t, sm, fmt.Sprintf("nil StreamingManager: %v", sm))
|
||||
require.Equal(t, listeners, sm.ABCIListeners, fmt.Sprintf("should contain same listeners: %v", listeners))
|
||||
require.Equal(t, true, sm.StopNodeOnErr, "should contain StopNodeOnErr = true")
|
||||
|
||||
suite.baseApp.EndBlock(abci.RequestEndBlock{})
|
||||
suite.baseApp.Commit()
|
||||
}
|
||||
}
|
||||
|
||||
@ -18,13 +18,14 @@ func (app *BaseApp) SimCheck(txEncoder sdk.TxEncoder, tx sdk.Tx) (sdk.GasInfo, *
|
||||
if err != nil {
|
||||
return sdk.GasInfo{}, nil, errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "%s", err)
|
||||
}
|
||||
gasInfo, result, _, _, err := app.runTx(runTxModeCheck, bz)
|
||||
|
||||
gasInfo, result, _, err := app.runTx(execModeCheck, bz)
|
||||
return gasInfo, result, err
|
||||
}
|
||||
|
||||
// Simulate executes a tx in simulate mode to get result and gas info.
|
||||
func (app *BaseApp) Simulate(txBytes []byte) (sdk.GasInfo, *sdk.Result, error) {
|
||||
gasInfo, result, _, _, err := app.runTx(runTxModeSimulate, txBytes)
|
||||
gasInfo, result, _, err := app.runTx(execModeSimulate, txBytes)
|
||||
return gasInfo, result, err
|
||||
}
|
||||
|
||||
@ -34,28 +35,38 @@ func (app *BaseApp) SimDeliver(txEncoder sdk.TxEncoder, tx sdk.Tx) (sdk.GasInfo,
|
||||
if err != nil {
|
||||
return sdk.GasInfo{}, nil, errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "%s", err)
|
||||
}
|
||||
gasInfo, result, _, _, err := app.runTx(runTxModeDeliver, bz)
|
||||
gasInfo, result, _, err := app.runTx(execModeFinalize, bz)
|
||||
return gasInfo, result, err
|
||||
}
|
||||
|
||||
// Context with current {check, deliver}State of the app used by tests.
|
||||
func (app *BaseApp) NewContext(isCheckTx bool, header cmtproto.Header) sdk.Context {
|
||||
func (app *BaseApp) SimTxFinalizeBlock(txEncoder sdk.TxEncoder, tx sdk.Tx) (sdk.GasInfo, *sdk.Result, error) {
|
||||
// See comment for Check().
|
||||
bz, err := txEncoder(tx)
|
||||
if err != nil {
|
||||
return sdk.GasInfo{}, nil, errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "%s", err)
|
||||
}
|
||||
|
||||
gasInfo, result, _, err := app.runTx(execModeFinalize, bz)
|
||||
return gasInfo, result, err
|
||||
}
|
||||
|
||||
func (app *BaseApp) NewContext(isCheckTx bool, header cmtproto.Header) sdk.Context { // todo discuss how to remove header, wrapper or no
|
||||
if isCheckTx {
|
||||
return sdk.NewContext(app.checkState.ms, header, true, app.logger).
|
||||
WithMinGasPrices(app.minGasPrices)
|
||||
}
|
||||
|
||||
return sdk.NewContext(app.deliverState.ms, header, false, app.logger)
|
||||
return sdk.NewContext(app.finalizeBlockState.ms, header, false, app.logger)
|
||||
}
|
||||
|
||||
func (app *BaseApp) NewUncachedContext(isCheckTx bool, header cmtproto.Header) sdk.Context {
|
||||
return sdk.NewContext(app.cms, header, isCheckTx, app.logger)
|
||||
}
|
||||
|
||||
func (app *BaseApp) GetContextForDeliverTx(txBytes []byte) sdk.Context {
|
||||
return app.getContextForTx(runTxModeDeliver, txBytes)
|
||||
func (app *BaseApp) GetContextForFinalizeBlock(txBytes []byte) sdk.Context {
|
||||
return app.getContextForTx(execModeFinalize, txBytes)
|
||||
}
|
||||
|
||||
func (app *BaseApp) GetContextForCheckTx(txBytes []byte) sdk.Context {
|
||||
return app.getContextForTx(runTxModeCheck, txBytes)
|
||||
return app.getContextForTx(execModeCheck, txBytes)
|
||||
}
|
||||
|
||||
@ -299,9 +299,9 @@ func getCheckStateCtx(app *baseapp.BaseApp) sdk.Context {
|
||||
return rf.MethodByName("Context").Call(nil)[0].Interface().(sdk.Context)
|
||||
}
|
||||
|
||||
func getDeliverStateCtx(app *baseapp.BaseApp) sdk.Context {
|
||||
func getFinalizeBlockStateCtx(app *baseapp.BaseApp) sdk.Context {
|
||||
v := reflect.ValueOf(app).Elem()
|
||||
f := v.FieldByName("deliverState")
|
||||
f := v.FieldByName("finalizeBlockState")
|
||||
rf := reflect.NewAt(f.Type(), unsafe.Pointer(f.UnsafeAddr())).Elem()
|
||||
return rf.MethodByName("Context").Call(nil)[0].Interface().(sdk.Context)
|
||||
}
|
||||
|
||||
@ -24,7 +24,7 @@ var (
|
||||
)
|
||||
|
||||
type (
|
||||
abciQueryFn = func(abci.RequestQuery) abci.ResponseQuery
|
||||
abciQueryFn = func(context.Context, *abci.RequestQuery) (*abci.ResponseQuery, error)
|
||||
|
||||
queryServer struct {
|
||||
clientCtx client.Context
|
||||
@ -218,7 +218,7 @@ func (s queryServer) GetNodeInfo(ctx context.Context, _ *GetNodeInfoRequest) (*G
|
||||
return &resp, nil
|
||||
}
|
||||
|
||||
func (s queryServer) ABCIQuery(_ context.Context, req *ABCIQueryRequest) (*ABCIQueryResponse, error) {
|
||||
func (s queryServer) ABCIQuery(ctx context.Context, req *ABCIQueryRequest) (*ABCIQueryResponse, error) {
|
||||
if s.queryFn == nil {
|
||||
return nil, status.Error(codes.Internal, "ABCI Query handler undefined")
|
||||
}
|
||||
@ -241,7 +241,10 @@ func (s queryServer) ABCIQuery(_ context.Context, req *ABCIQueryRequest) (*ABCIQ
|
||||
}
|
||||
}
|
||||
|
||||
res := s.queryFn(req.ToABCIRequestQuery())
|
||||
res, err := s.queryFn(ctx, req.ToABCIRequestQuery())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return FromABCIResponseQuery(res), nil
|
||||
}
|
||||
|
||||
|
||||
@ -6,8 +6,8 @@ import (
|
||||
|
||||
// ToABCIRequestQuery converts a gRPC ABCIQueryRequest type to an ABCI
|
||||
// RequestQuery type.
|
||||
func (req *ABCIQueryRequest) ToABCIRequestQuery() abci.RequestQuery {
|
||||
return abci.RequestQuery{
|
||||
func (req *ABCIQueryRequest) ToABCIRequestQuery() *abci.RequestQuery {
|
||||
return &abci.RequestQuery{
|
||||
Data: req.Data,
|
||||
Path: req.Path,
|
||||
Height: req.Height,
|
||||
@ -17,7 +17,7 @@ func (req *ABCIQueryRequest) ToABCIRequestQuery() abci.RequestQuery {
|
||||
|
||||
// FromABCIResponseQuery converts an ABCI ResponseQuery type to a gRPC
|
||||
// ABCIQueryResponse type.
|
||||
func FromABCIResponseQuery(res abci.ResponseQuery) *ABCIQueryResponse {
|
||||
func FromABCIResponseQuery(res *abci.ResponseQuery) *ABCIQueryResponse {
|
||||
var proofOps *ProofOps
|
||||
|
||||
if res.ProofOps != nil {
|
||||
|
||||
@ -83,21 +83,18 @@ func (s *IntegrationTestSuite) SetupSuite() {
|
||||
s.NoError(err)
|
||||
|
||||
// init chain will set the validator set and initialize the genesis accounts
|
||||
app.InitChain(
|
||||
abci.RequestInitChain{
|
||||
Validators: []abci.ValidatorUpdate{},
|
||||
ConsensusParams: sims.DefaultConsensusParams,
|
||||
AppStateBytes: stateBytes,
|
||||
},
|
||||
app.InitChain(&abci.RequestInitChain{
|
||||
Validators: []abci.ValidatorUpdate{},
|
||||
ConsensusParams: sims.DefaultConsensusParams,
|
||||
AppStateBytes: stateBytes,
|
||||
},
|
||||
)
|
||||
|
||||
app.Commit()
|
||||
app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{
|
||||
app.FinalizeBlock(&abci.RequestFinalizeBlock{
|
||||
Height: app.LastBlockHeight() + 1,
|
||||
AppHash: app.LastCommitID().Hash,
|
||||
ValidatorsHash: valSet.Hash(),
|
||||
Hash: app.LastCommitID().Hash,
|
||||
NextValidatorsHash: valSet.Hash(),
|
||||
}})
|
||||
})
|
||||
|
||||
// end of app init
|
||||
|
||||
|
||||
Binary file not shown.
@ -61,8 +61,21 @@ type VoteInfos interface {
|
||||
Get(int) VoteInfo
|
||||
}
|
||||
|
||||
// BlockIdFlag indicates which BlockID the signature is for
|
||||
type BlockIDFlag int32
|
||||
|
||||
const (
|
||||
BlockIDFlagUnknown BlockIDFlag = 0
|
||||
// BlockIDFlagAbsent - no vote was received from a validator.
|
||||
BlockIDFlagAbsent BlockIDFlag = 1
|
||||
// BlockIDFlagCommit - voted for the Commit.BlockID.
|
||||
BlockIDFlagCommit BlockIDFlag = 2
|
||||
// BlockIDFlagNil - voted for nil.
|
||||
BlockIDFlagNil BlockIDFlag = 3
|
||||
)
|
||||
|
||||
// VoteInfo is the vote information of ABCI
|
||||
type VoteInfo interface {
|
||||
Validator() Validator
|
||||
SignedLastBlock() bool
|
||||
GetBlockIDFlag() BlockIDFlag
|
||||
}
|
||||
|
||||
11
go.mod
11
go.mod
@ -19,7 +19,7 @@ require (
|
||||
github.com/chzyer/readline v1.5.1
|
||||
github.com/cockroachdb/apd/v2 v2.0.2
|
||||
github.com/cockroachdb/errors v1.9.1
|
||||
github.com/cometbft/cometbft v0.37.1
|
||||
github.com/cometbft/cometbft v0.38.0-alpha.2
|
||||
github.com/cosmos/btcutil v1.0.5
|
||||
github.com/cosmos/cosmos-db v1.0.0-rc.1
|
||||
github.com/cosmos/cosmos-proto v1.0.0-beta.3
|
||||
@ -68,11 +68,10 @@ require (
|
||||
require (
|
||||
filippo.io/edwards25519 v1.0.0 // indirect
|
||||
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
|
||||
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect
|
||||
github.com/DataDog/zstd v1.5.2 // indirect
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
|
||||
github.com/bufbuild/protocompile v0.4.0 // indirect
|
||||
github.com/bufbuild/protocompile v0.5.1 // indirect
|
||||
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
|
||||
github.com/cespare/xxhash v1.1.0 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.2.0 // indirect
|
||||
@ -82,7 +81,6 @@ require (
|
||||
github.com/cometbft/cometbft-db v0.7.0 // indirect
|
||||
github.com/cosmos/iavl v0.21.0 // indirect
|
||||
github.com/cosmos/ics23/go v0.10.0 // indirect
|
||||
github.com/creachadair/taskgroup v0.4.2 // indirect
|
||||
github.com/danieljoos/wincred v1.1.2 // indirect
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
|
||||
@ -107,8 +105,6 @@ require (
|
||||
github.com/google/orderedcode v0.0.1 // indirect
|
||||
github.com/gorilla/websocket v1.5.0 // indirect
|
||||
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
|
||||
github.com/gtank/merlin v0.1.1 // indirect
|
||||
github.com/gtank/ristretto255 v0.1.2 // indirect
|
||||
github.com/hashicorp/go-hclog v1.5.0 // indirect
|
||||
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
|
||||
github.com/hashicorp/go-plugin v1.4.9 // indirect
|
||||
@ -125,12 +121,12 @@ require (
|
||||
github.com/linxGnu/grocksdb v1.7.16 // indirect
|
||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
|
||||
github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect
|
||||
github.com/minio/highwayhash v1.0.2 // indirect
|
||||
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
|
||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||
github.com/mtibben/percent v0.2.1 // indirect
|
||||
github.com/nxadm/tail v1.4.8 // indirect
|
||||
github.com/oasisprotocol/curve25519-voi v0.0.0-20220708102147-0a8a51822cae // indirect
|
||||
github.com/oklog/run v1.1.0 // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.0.7 // indirect
|
||||
github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect
|
||||
@ -165,6 +161,7 @@ require (
|
||||
replace (
|
||||
// TODO: remove me after collections 0.2. is released.
|
||||
cosmossdk.io/collections => ./collections
|
||||
cosmossdk.io/core => ./core
|
||||
cosmossdk.io/store => ./store
|
||||
// TODO: remove after 0.7.0 release
|
||||
cosmossdk.io/x/tx => ./x/tx
|
||||
|
||||
38
go.sum
38
go.sum
@ -37,8 +37,6 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
|
||||
cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
|
||||
cosmossdk.io/api v0.4.1 h1:0ikaYM6GyxTYYcfBiyR8YnLCfhNnhKpEFnaSepCTmqg=
|
||||
cosmossdk.io/api v0.4.1/go.mod h1:jR7k5ok90LxW2lFUXvd8Vpo/dr4PpiyVegxdm7b1ZdE=
|
||||
cosmossdk.io/core v0.7.0 h1:GFss3qt2P9p23Cz24NnqLkslzb8n+B75A24x1JgJJp0=
|
||||
cosmossdk.io/core v0.7.0/go.mod h1:36hP0ZH/8ipsjzfcp0yKU4bqQXUGhS0/m1krWFCtwCc=
|
||||
cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z+zfw=
|
||||
cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU=
|
||||
cosmossdk.io/errors v1.0.0-beta.7.0.20230429155654-3ee8242364e4 h1:rOy7iw7HlwKc5Af5qIHLXdBx/F98o6du/I/WGwOW6eA=
|
||||
@ -53,11 +51,9 @@ filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5E
|
||||
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs=
|
||||
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4=
|
||||
github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8=
|
||||
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8=
|
||||
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg=
|
||||
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4=
|
||||
github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno=
|
||||
github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo=
|
||||
github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
|
||||
@ -109,10 +105,10 @@ github.com/bits-and-blooms/bitset v1.7.0 h1:YjAGVd3XmtK9ktAbX8Zg2g2PwLIMjGREZJHl
|
||||
github.com/bits-and-blooms/bitset v1.7.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA=
|
||||
github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U=
|
||||
github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04=
|
||||
github.com/btcsuite/btcd/btcutil v1.1.2 h1:XLMbX8JQEiwMcYft2EGi8zPUkoa0abKIU6/BJSRsjzQ=
|
||||
github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ=
|
||||
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U=
|
||||
github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA=
|
||||
github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8=
|
||||
github.com/bufbuild/protocompile v0.5.1 h1:mixz5lJX4Hiz4FpqFREJHIXLfaLBntfaJv1h+/jS+Qg=
|
||||
github.com/bufbuild/protocompile v0.5.1/go.mod h1:G5iLmavmF4NsYtpZFvE3B/zFch2GIY8+wjsYLR/lc40=
|
||||
github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM=
|
||||
github.com/bytedance/sonic v1.8.0 h1:ea0Xadu+sHlu7x5O3gKhRpQ1IKiMrSiHttPF0ybECuA=
|
||||
github.com/bytedance/sonic v1.8.0/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U=
|
||||
@ -169,8 +165,8 @@ github.com/cockroachdb/redact v1.1.3 h1:AKZds10rFSIj7qADf0g46UixK8NNLwWTNdCIGS5w
|
||||
github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg=
|
||||
github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI=
|
||||
github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM=
|
||||
github.com/cometbft/cometbft v0.37.1 h1:KLxkQTK2hICXYq21U2hn1W5hOVYUdQgDQ1uB+90xPIg=
|
||||
github.com/cometbft/cometbft v0.37.1/go.mod h1:Y2MMMN//O5K4YKd8ze4r9jmk4Y7h0ajqILXbH5JQFVs=
|
||||
github.com/cometbft/cometbft v0.38.0-alpha.2 h1:iorYtE7u4kBgSe4JtruHsGR1RNSdVlrDwGOYKZ7h3zs=
|
||||
github.com/cometbft/cometbft v0.38.0-alpha.2/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k=
|
||||
github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo=
|
||||
github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0=
|
||||
github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg=
|
||||
@ -188,7 +184,6 @@ github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQ
|
||||
github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I=
|
||||
github.com/cosmos/cosmos-sdk/db v1.0.0-beta.1.0.20220726092710-f848e4300a8a h1:2humuGPw3O5riJVFq/E2FRjF57UrO97W1qJcGVmK+6k=
|
||||
github.com/cosmos/cosmos-sdk/db v1.0.0-beta.1.0.20220726092710-f848e4300a8a/go.mod h1:c8IO23vgNxueCCJlSI9awQtcxsvc+buzaeThB85qfBU=
|
||||
github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y=
|
||||
github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY=
|
||||
github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw=
|
||||
github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE=
|
||||
@ -207,8 +202,6 @@ github.com/cosmos/ledger-cosmos-go v0.13.0/go.mod h1:ZcqYgnfNJ6lAXe4HPtWgarNEY+B
|
||||
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||
github.com/creachadair/taskgroup v0.4.2 h1:jsBLdAJE42asreGss2xZGZ8fJra7WtwnHWeJFxv2Li8=
|
||||
github.com/creachadair/taskgroup v0.4.2/go.mod h1:qiXUOSrbwAY3u0JPGTzObbE3yf9hcXHDKBZ2ZjpCbgM=
|
||||
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
|
||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
github.com/cucumber/common/gherkin/go/v22 v22.0.0 h1:4K8NqptbvdOrjL9DEea6HFjSpbdT9+Q5kgLpmmsHYl0=
|
||||
@ -325,7 +318,7 @@ github.com/goccy/go-json v0.10.0/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MG
|
||||
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0=
|
||||
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4=
|
||||
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||
github.com/gofrs/uuid v4.3.0+incompatible h1:CaSVZxm5B+7o45rtab4jC2G37WGYX1zQfuU2i6DSvnc=
|
||||
github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA=
|
||||
github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s=
|
||||
github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s=
|
||||
github.com/gogo/googleapis v1.4.1-0.20201022092350-68b0159b7869/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c=
|
||||
@ -445,11 +438,6 @@ github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
|
||||
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU=
|
||||
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0=
|
||||
github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s=
|
||||
github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is=
|
||||
github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s=
|
||||
github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uMzcc=
|
||||
github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIvY4OmlYW69o=
|
||||
github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE=
|
||||
github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8=
|
||||
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
@ -607,9 +595,6 @@ github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfr
|
||||
github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8=
|
||||
github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc=
|
||||
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
|
||||
github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM=
|
||||
github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 h1:QRUSJEgZn2Snx0EmT/QLXibWjSUDjKWvXIT19NBVp94=
|
||||
github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM=
|
||||
github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g=
|
||||
github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY=
|
||||
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
|
||||
@ -649,6 +634,8 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA
|
||||
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
|
||||
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
|
||||
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
|
||||
github.com/oasisprotocol/curve25519-voi v0.0.0-20220708102147-0a8a51822cae h1:FatpGJD2jmJfhZiFDElaC0QhZUDQnxUeAwTGkfAHN3I=
|
||||
github.com/oasisprotocol/curve25519-voi v0.0.0-20220708102147-0a8a51822cae/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s=
|
||||
github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs=
|
||||
github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
|
||||
github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA=
|
||||
@ -658,8 +645,8 @@ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W
|
||||
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
|
||||
github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA=
|
||||
github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY=
|
||||
github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc=
|
||||
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
|
||||
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
|
||||
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
|
||||
@ -901,7 +888,6 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U
|
||||
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
@ -951,7 +937,7 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||
golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8=
|
||||
golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs=
|
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
@ -1201,7 +1187,7 @@ golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
|
||||
golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||
golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||
golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM=
|
||||
golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
|
||||
@ -12,4 +12,4 @@ deps:
|
||||
- remote: buf.build
|
||||
owner: googleapis
|
||||
repository: googleapis
|
||||
commit: 75b4300737fb4efca0831636be94e517
|
||||
commit: 5ae7f88519b04fe1965da0f8a375a088
|
||||
|
||||
@ -27,7 +27,10 @@ message TxResponse {
|
||||
// non-deterministic.
|
||||
string raw_log = 6;
|
||||
// The output of the application's logger (typed). May be non-deterministic.
|
||||
repeated ABCIMessageLog logs = 7 [(gogoproto.castrepeated) = "ABCIMessageLogs", (gogoproto.nullable) = false];
|
||||
repeated ABCIMessageLog logs = 7 [
|
||||
(gogoproto.castrepeated) = "ABCIMessageLogs",
|
||||
(gogoproto.nullable) = false
|
||||
];
|
||||
// Additional information. May be non-deterministic.
|
||||
string info = 8;
|
||||
// Amount of gas requested for transaction.
|
||||
@ -58,7 +61,8 @@ message ABCIMessageLog {
|
||||
|
||||
// Events contains a slice of Event objects that were emitted during some
|
||||
// execution.
|
||||
repeated StringEvent events = 3 [(gogoproto.castrepeated) = "StringEvents", (gogoproto.nullable) = false];
|
||||
repeated StringEvent events = 3
|
||||
[(gogoproto.castrepeated) = "StringEvents", (gogoproto.nullable) = false];
|
||||
}
|
||||
|
||||
// StringEvent defines en Event object wrapper where all the attributes
|
||||
|
||||
@ -7,34 +7,14 @@ import "cosmos/store/v1beta1/listening.proto";
|
||||
|
||||
option go_package = "cosmossdk.io/store/streaming/abci";
|
||||
|
||||
// ListenBeginBlockRequest is the request type for the ListenBeginBlock RPC method
|
||||
message ListenBeginBlockRequest {
|
||||
tendermint.abci.RequestBeginBlock req = 1;
|
||||
tendermint.abci.ResponseBeginBlock res = 2;
|
||||
}
|
||||
|
||||
// ListenBeginBlockResponse is the response type for the ListenBeginBlock RPC method
|
||||
message ListenBeginBlockResponse {}
|
||||
|
||||
// ListenEndBlockRequest is the request type for the ListenEndBlock RPC method
|
||||
message ListenEndBlockRequest {
|
||||
tendermint.abci.RequestEndBlock req = 1;
|
||||
tendermint.abci.ResponseEndBlock res = 2;
|
||||
message ListenFinalizeBlockRequest {
|
||||
tendermint.abci.RequestFinalizeBlock req = 1;
|
||||
tendermint.abci.ResponseFinalizeBlock res = 2;
|
||||
}
|
||||
|
||||
// ListenEndBlockResponse is the response type for the ListenEndBlock RPC method
|
||||
message ListenEndBlockResponse {}
|
||||
|
||||
// ListenDeliverTxRequest is the request type for the ListenDeliverTx RPC method
|
||||
message ListenDeliverTxRequest {
|
||||
// explicitly pass in block height as neither RequestDeliverTx or ResponseDeliverTx contain it
|
||||
int64 block_height = 1;
|
||||
tendermint.abci.RequestDeliverTx req = 2;
|
||||
tendermint.abci.ResponseDeliverTx res = 3;
|
||||
}
|
||||
|
||||
// ListenDeliverTxResponse is the response type for the ListenDeliverTx RPC method
|
||||
message ListenDeliverTxResponse {}
|
||||
message ListenFinalizeBlockResponse {}
|
||||
|
||||
// ListenCommitRequest is the request type for the ListenCommit RPC method
|
||||
message ListenCommitRequest {
|
||||
@ -49,12 +29,8 @@ message ListenCommitResponse {}
|
||||
|
||||
// ABCIListenerService is the service for the BaseApp ABCIListener interface
|
||||
service ABCIListenerService {
|
||||
// ListenBeginBlock is the corresponding endpoint for ABCIListener.ListenBeginBlock
|
||||
rpc ListenBeginBlock(ListenBeginBlockRequest) returns (ListenBeginBlockResponse);
|
||||
// ListenEndBlock is the corresponding endpoint for ABCIListener.ListenEndBlock
|
||||
rpc ListenEndBlock(ListenEndBlockRequest) returns (ListenEndBlockResponse);
|
||||
// ListenDeliverTx is the corresponding endpoint for ABCIListener.ListenDeliverTx
|
||||
rpc ListenDeliverTx(ListenDeliverTxRequest) returns (ListenDeliverTxResponse);
|
||||
// ListenFinalizeBlock is the corresponding endpoint for ABCIListener.ListenEndBlock
|
||||
rpc ListenFinalizeBlock(ListenFinalizeBlockRequest) returns (ListenFinalizeBlockResponse);
|
||||
// ListenCommit is the corresponding endpoint for ABCIListener.ListenCommit
|
||||
rpc ListenCommit(ListenCommitRequest) returns (ListenCommitResponse);
|
||||
}
|
||||
|
||||
@ -11,8 +11,8 @@ option go_package = "cosmossdk.io/store/types";
|
||||
//
|
||||
// Since: cosmos-sdk 0.43
|
||||
message StoreKVPair {
|
||||
string store_key = 1; // the store key for the KVStore this pair originates from
|
||||
bool delete = 2; // true indicates a delete operation, false indicates a set operation
|
||||
string store_key = 1; // the store key for the KVStore this pair originates from
|
||||
bool delete = 2; // true indicates a delete operation, false indicates a set operation
|
||||
bytes key = 3;
|
||||
bytes value = 4;
|
||||
}
|
||||
@ -20,15 +20,9 @@ message StoreKVPair {
|
||||
// BlockMetadata contains all the abci event data of a block
|
||||
// the file streamer dump them into files together with the state changes.
|
||||
message BlockMetadata {
|
||||
// DeliverTx encapulate deliver tx request and response.
|
||||
message DeliverTx {
|
||||
tendermint.abci.RequestDeliverTx request = 1;
|
||||
tendermint.abci.ResponseDeliverTx response = 2;
|
||||
}
|
||||
tendermint.abci.RequestBeginBlock request_begin_block = 1;
|
||||
tendermint.abci.ResponseBeginBlock response_begin_block = 2;
|
||||
repeated DeliverTx deliver_txs = 3;
|
||||
tendermint.abci.RequestEndBlock request_end_block = 4;
|
||||
tendermint.abci.ResponseEndBlock response_end_block = 5;
|
||||
tendermint.abci.ResponseCommit response_commit = 6;
|
||||
tendermint.abci.ResponseCommit response_commit = 6;
|
||||
tendermint.abci.RequestFinalizeBlock request_finalize_block = 7;
|
||||
tendermint.abci.ResponseFinalizeBlock response_finalize_block = 8; // TODO: should we renumber this?
|
||||
|
||||
reserved 1, 2, 3, 4, 5; // reserved for from previous use in comet <= 0.37
|
||||
}
|
||||
|
||||
@ -6,39 +6,59 @@ option go_package = "github.com/cometbft/cometbft/abci/types";
|
||||
// For more information on gogo.proto, see:
|
||||
// https://github.com/cosmos/gogoproto/blob/master/extensions.md
|
||||
import "tendermint/crypto/proof.proto";
|
||||
import "tendermint/types/types.proto";
|
||||
import "tendermint/crypto/keys.proto";
|
||||
import "tendermint/types/params.proto";
|
||||
import "tendermint/types/validator.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "gogoproto/gogo.proto";
|
||||
|
||||
// This file is copied from http://github.com/tendermint/abci
|
||||
// NOTE: When using custom types, mind the warnings.
|
||||
// https://github.com/cosmos/gogoproto/blob/master/custom_types.md#warnings-and-issues
|
||||
|
||||
service ABCI {
|
||||
rpc Echo(RequestEcho) returns (ResponseEcho);
|
||||
rpc Flush(RequestFlush) returns (ResponseFlush);
|
||||
rpc Info(RequestInfo) returns (ResponseInfo);
|
||||
rpc CheckTx(RequestCheckTx) returns (ResponseCheckTx);
|
||||
rpc Query(RequestQuery) returns (ResponseQuery);
|
||||
rpc Commit(RequestCommit) returns (ResponseCommit);
|
||||
rpc InitChain(RequestInitChain) returns (ResponseInitChain);
|
||||
rpc ListSnapshots(RequestListSnapshots) returns (ResponseListSnapshots);
|
||||
rpc OfferSnapshot(RequestOfferSnapshot) returns (ResponseOfferSnapshot);
|
||||
rpc LoadSnapshotChunk(RequestLoadSnapshotChunk)
|
||||
returns (ResponseLoadSnapshotChunk);
|
||||
rpc ApplySnapshotChunk(RequestApplySnapshotChunk)
|
||||
returns (ResponseApplySnapshotChunk);
|
||||
rpc PrepareProposal(RequestPrepareProposal) returns (ResponsePrepareProposal);
|
||||
rpc ProcessProposal(RequestProcessProposal) returns (ResponseProcessProposal);
|
||||
rpc ExtendVote(RequestExtendVote) returns (ResponseExtendVote);
|
||||
rpc VerifyVoteExtension(RequestVerifyVoteExtension) returns (ResponseVerifyVoteExtension);
|
||||
rpc FinalizeBlock(RequestFinalizeBlock) returns (ResponseFinalizeBlock);
|
||||
}
|
||||
|
||||
//----------------------------------------
|
||||
// Request types
|
||||
|
||||
message Request {
|
||||
oneof value {
|
||||
RequestEcho echo = 1;
|
||||
RequestFlush flush = 2;
|
||||
RequestInfo info = 3;
|
||||
RequestInitChain init_chain = 5;
|
||||
RequestQuery query = 6;
|
||||
RequestBeginBlock begin_block = 7;
|
||||
RequestCheckTx check_tx = 8;
|
||||
RequestDeliverTx deliver_tx = 9;
|
||||
RequestEndBlock end_block = 10;
|
||||
RequestCommit commit = 11;
|
||||
RequestListSnapshots list_snapshots = 12;
|
||||
RequestOfferSnapshot offer_snapshot = 13;
|
||||
RequestLoadSnapshotChunk load_snapshot_chunk = 14;
|
||||
RequestApplySnapshotChunk apply_snapshot_chunk = 15;
|
||||
RequestPrepareProposal prepare_proposal = 16;
|
||||
RequestProcessProposal process_proposal = 17;
|
||||
RequestEcho echo = 1;
|
||||
RequestFlush flush = 2;
|
||||
RequestInfo info = 3;
|
||||
RequestInitChain init_chain = 5;
|
||||
RequestQuery query = 6;
|
||||
RequestCheckTx check_tx = 8;
|
||||
RequestCommit commit = 11;
|
||||
RequestListSnapshots list_snapshots = 12;
|
||||
RequestOfferSnapshot offer_snapshot = 13;
|
||||
RequestLoadSnapshotChunk load_snapshot_chunk = 14;
|
||||
RequestApplySnapshotChunk apply_snapshot_chunk = 15;
|
||||
RequestPrepareProposal prepare_proposal = 16;
|
||||
RequestProcessProposal process_proposal = 17;
|
||||
RequestExtendVote extend_vote = 18;
|
||||
RequestVerifyVoteExtension verify_vote_extension = 19;
|
||||
RequestFinalizeBlock finalize_block = 20;
|
||||
}
|
||||
reserved 4;
|
||||
reserved 4, 7, 9, 10; // SetOption, BeginBlock, DeliverTx, EndBlock
|
||||
}
|
||||
|
||||
message RequestEcho {
|
||||
@ -71,13 +91,6 @@ message RequestQuery {
|
||||
bool prove = 4;
|
||||
}
|
||||
|
||||
message RequestBeginBlock {
|
||||
bytes hash = 1;
|
||||
tendermint.types.Header header = 2 [(gogoproto.nullable) = false];
|
||||
CommitInfo last_commit_info = 3 [(gogoproto.nullable) = false];
|
||||
repeated Misbehavior byzantine_validators = 4 [(gogoproto.nullable) = false];
|
||||
}
|
||||
|
||||
enum CheckTxType {
|
||||
NEW = 0 [(gogoproto.enumvalue_customname) = "New"];
|
||||
RECHECK = 1 [(gogoproto.enumvalue_customname) = "Recheck"];
|
||||
@ -88,14 +101,6 @@ message RequestCheckTx {
|
||||
CheckTxType type = 2;
|
||||
}
|
||||
|
||||
message RequestDeliverTx {
|
||||
bytes tx = 1;
|
||||
}
|
||||
|
||||
message RequestEndBlock {
|
||||
int64 height = 1;
|
||||
}
|
||||
|
||||
message RequestCommit {}
|
||||
|
||||
// lists available snapshots
|
||||
@ -149,30 +154,61 @@ message RequestProcessProposal {
|
||||
bytes proposer_address = 8;
|
||||
}
|
||||
|
||||
// Extends a vote with application-injected data
|
||||
message RequestExtendVote {
|
||||
// the hash of the block that this vote may be referring to
|
||||
bytes hash = 1;
|
||||
// the height of the extended vote
|
||||
int64 height = 2;
|
||||
}
|
||||
|
||||
// Verify the vote extension
|
||||
message RequestVerifyVoteExtension {
|
||||
// the hash of the block that this received vote corresponds to
|
||||
bytes hash = 1;
|
||||
// the validator that signed the vote extension
|
||||
bytes validator_address = 2;
|
||||
int64 height = 3;
|
||||
bytes vote_extension = 4;
|
||||
}
|
||||
|
||||
message RequestFinalizeBlock {
|
||||
repeated bytes txs = 1;
|
||||
CommitInfo decided_last_commit = 2 [(gogoproto.nullable) = false];
|
||||
repeated Misbehavior misbehavior = 3 [(gogoproto.nullable) = false];
|
||||
// hash is the merkle root hash of the fields of the decided block.
|
||||
bytes hash = 4;
|
||||
int64 height = 5;
|
||||
google.protobuf.Timestamp time = 6 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
|
||||
bytes next_validators_hash = 7;
|
||||
// proposer_address is the address of the public key of the original proposer of the block.
|
||||
bytes proposer_address = 8;
|
||||
}
|
||||
|
||||
//----------------------------------------
|
||||
// Response types
|
||||
|
||||
message Response {
|
||||
oneof value {
|
||||
ResponseException exception = 1;
|
||||
ResponseEcho echo = 2;
|
||||
ResponseFlush flush = 3;
|
||||
ResponseInfo info = 4;
|
||||
ResponseInitChain init_chain = 6;
|
||||
ResponseQuery query = 7;
|
||||
ResponseBeginBlock begin_block = 8;
|
||||
ResponseCheckTx check_tx = 9;
|
||||
ResponseDeliverTx deliver_tx = 10;
|
||||
ResponseEndBlock end_block = 11;
|
||||
ResponseCommit commit = 12;
|
||||
ResponseListSnapshots list_snapshots = 13;
|
||||
ResponseOfferSnapshot offer_snapshot = 14;
|
||||
ResponseLoadSnapshotChunk load_snapshot_chunk = 15;
|
||||
ResponseApplySnapshotChunk apply_snapshot_chunk = 16;
|
||||
ResponsePrepareProposal prepare_proposal = 17;
|
||||
ResponseProcessProposal process_proposal = 18;
|
||||
ResponseException exception = 1;
|
||||
ResponseEcho echo = 2;
|
||||
ResponseFlush flush = 3;
|
||||
ResponseInfo info = 4;
|
||||
ResponseInitChain init_chain = 6;
|
||||
ResponseQuery query = 7;
|
||||
ResponseCheckTx check_tx = 9;
|
||||
ResponseCommit commit = 12;
|
||||
ResponseListSnapshots list_snapshots = 13;
|
||||
ResponseOfferSnapshot offer_snapshot = 14;
|
||||
ResponseLoadSnapshotChunk load_snapshot_chunk = 15;
|
||||
ResponseApplySnapshotChunk apply_snapshot_chunk = 16;
|
||||
ResponsePrepareProposal prepare_proposal = 17;
|
||||
ResponseProcessProposal process_proposal = 18;
|
||||
ResponseExtendVote extend_vote = 19;
|
||||
ResponseVerifyVoteExtension verify_vote_extension = 20;
|
||||
ResponseFinalizeBlock finalize_block = 21;
|
||||
}
|
||||
reserved 5;
|
||||
reserved 5, 8, 10, 11; // SetOption, BeginBlock, DeliverTx, EndBlock
|
||||
}
|
||||
|
||||
// nondeterministic
|
||||
@ -215,11 +251,6 @@ message ResponseQuery {
|
||||
string codespace = 10;
|
||||
}
|
||||
|
||||
message ResponseBeginBlock {
|
||||
repeated Event events = 1
|
||||
[(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"];
|
||||
}
|
||||
|
||||
message ResponseCheckTx {
|
||||
uint32 code = 1;
|
||||
bytes data = 2;
|
||||
@ -230,38 +261,15 @@ message ResponseCheckTx {
|
||||
repeated Event events = 7
|
||||
[(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"];
|
||||
string codespace = 8;
|
||||
string sender = 9;
|
||||
int64 priority = 10;
|
||||
|
||||
// mempool_error is set by CometBFT.
|
||||
// ABCI applictions creating a ResponseCheckTX should not set mempool_error.
|
||||
string mempool_error = 11;
|
||||
}
|
||||
|
||||
message ResponseDeliverTx {
|
||||
uint32 code = 1;
|
||||
bytes data = 2;
|
||||
string log = 3; // nondeterministic
|
||||
string info = 4; // nondeterministic
|
||||
int64 gas_wanted = 5 [json_name = "gas_wanted"];
|
||||
int64 gas_used = 6 [json_name = "gas_used"];
|
||||
repeated Event events = 7 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.jsontag) = "events,omitempty"
|
||||
]; // nondeterministic
|
||||
string codespace = 8;
|
||||
}
|
||||
|
||||
message ResponseEndBlock {
|
||||
repeated ValidatorUpdate validator_updates = 1 [(gogoproto.nullable) = false];
|
||||
tendermint.types.ConsensusParams consensus_param_updates = 2;
|
||||
repeated Event events = 3
|
||||
[(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"];
|
||||
// These reserved fields were used until v0.37 by the priority mempool (now
|
||||
// removed).
|
||||
reserved 9 to 11;
|
||||
reserved "sender", "priority", "mempool_error";
|
||||
}
|
||||
|
||||
message ResponseCommit {
|
||||
// reserve 1
|
||||
bytes data = 2;
|
||||
reserved 1, 2; // data was previously returned here
|
||||
int64 retain_height = 3;
|
||||
}
|
||||
|
||||
@ -315,6 +323,40 @@ message ResponseProcessProposal {
|
||||
}
|
||||
}
|
||||
|
||||
message ResponseExtendVote {
|
||||
bytes vote_extension = 1;
|
||||
}
|
||||
|
||||
message ResponseVerifyVoteExtension {
|
||||
VerifyStatus status = 1;
|
||||
|
||||
enum VerifyStatus {
|
||||
UNKNOWN = 0;
|
||||
ACCEPT = 1;
|
||||
// Rejecting the vote extension will reject the entire precommit by the sender.
|
||||
// Incorrectly implementing this thus has liveness implications as it may affect
|
||||
// CometBFT's ability to receive 2/3+ valid votes to finalize the block.
|
||||
// Honest nodes should never be rejected.
|
||||
REJECT = 2;
|
||||
}
|
||||
}
|
||||
|
||||
message ResponseFinalizeBlock {
|
||||
// set of block events emmitted as part of executing the block
|
||||
repeated Event events = 1
|
||||
[(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"];
|
||||
// the result of executing each transaction including the events
|
||||
// the particular transction emitted. This should match the order
|
||||
// of the transactions delivered in the block itself
|
||||
repeated ExecTxResult tx_results = 2;
|
||||
// a list of updates to the validator set. These will reflect the validator set at current height + 2.
|
||||
repeated ValidatorUpdate validator_updates = 3 [(gogoproto.nullable) = false];
|
||||
// updates to the consensus params, if any.
|
||||
tendermint.types.ConsensusParams consensus_param_updates = 4;
|
||||
// app_hash is the hash of the applications' state which is used to confirm that execution of the transactions was deterministic. It is up to the application to decide which algorithm to use.
|
||||
bytes app_hash = 5;
|
||||
}
|
||||
|
||||
//----------------------------------------
|
||||
// Misc.
|
||||
|
||||
@ -323,6 +365,9 @@ message CommitInfo {
|
||||
repeated VoteInfo votes = 2 [(gogoproto.nullable) = false];
|
||||
}
|
||||
|
||||
// ExtendedCommitInfo is similar to CommitInfo except that it is only used in
|
||||
// the PrepareProposal request such that CometBFT can provide vote extensions
|
||||
// to the application.
|
||||
message ExtendedCommitInfo {
|
||||
// The round at which the block proposer decided in the previous height.
|
||||
int32 round = 1;
|
||||
@ -332,7 +377,7 @@ message ExtendedCommitInfo {
|
||||
}
|
||||
|
||||
// Event allows application developers to attach additional information to
|
||||
// ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx.
|
||||
// ResponseFinalizeBlock and ResponseCheckTx.
|
||||
// Later, transactions may be queried using these events.
|
||||
message Event {
|
||||
string type = 1;
|
||||
@ -349,42 +394,63 @@ message EventAttribute {
|
||||
bool index = 3; // nondeterministic
|
||||
}
|
||||
|
||||
// ExecTxResult contains results of executing one individual transaction.
|
||||
//
|
||||
// * Its structure is equivalent to #ResponseDeliverTx which will be deprecated/deleted
|
||||
message ExecTxResult {
|
||||
uint32 code = 1;
|
||||
bytes data = 2;
|
||||
string log = 3; // nondeterministic
|
||||
string info = 4; // nondeterministic
|
||||
int64 gas_wanted = 5;
|
||||
int64 gas_used = 6;
|
||||
repeated Event events = 7
|
||||
[(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; // nondeterministic
|
||||
string codespace = 8;
|
||||
}
|
||||
|
||||
// TxResult contains results of executing the transaction.
|
||||
//
|
||||
// One usage is indexing transaction results.
|
||||
message TxResult {
|
||||
int64 height = 1;
|
||||
uint32 index = 2;
|
||||
bytes tx = 3;
|
||||
ResponseDeliverTx result = 4 [(gogoproto.nullable) = false];
|
||||
int64 height = 1;
|
||||
uint32 index = 2;
|
||||
bytes tx = 3;
|
||||
ExecTxResult result = 4 [(gogoproto.nullable) = false];
|
||||
}
|
||||
|
||||
//----------------------------------------
|
||||
// Blockchain Types
|
||||
|
||||
// Validator
|
||||
message Validator {
|
||||
bytes address = 1; // The first 20 bytes of SHA256(public key)
|
||||
// PubKey pub_key = 2 [(gogoproto.nullable)=false];
|
||||
int64 power = 3; // The voting power
|
||||
}
|
||||
|
||||
// ValidatorUpdate
|
||||
message ValidatorUpdate {
|
||||
tendermint.crypto.PublicKey pub_key = 1 [(gogoproto.nullable) = false];
|
||||
int64 power = 2;
|
||||
}
|
||||
|
||||
// VoteInfo
|
||||
message VoteInfo {
|
||||
Validator validator = 1 [(gogoproto.nullable) = false];
|
||||
bool signed_last_block = 2;
|
||||
tendermint.types.BlockIDFlag block_id_flag = 3;
|
||||
|
||||
reserved 2; // signed_last_block
|
||||
}
|
||||
|
||||
message ExtendedVoteInfo {
|
||||
Validator validator = 1 [(gogoproto.nullable) = false];
|
||||
bool signed_last_block = 2;
|
||||
bytes vote_extension = 3; // Reserved for future use
|
||||
// The validator that sent the vote.
|
||||
Validator validator = 1 [(gogoproto.nullable) = false];
|
||||
// Non-deterministic extension provided by the sending validator's application.
|
||||
bytes vote_extension = 3;
|
||||
// Vote extension signature created by CometBFT
|
||||
bytes extension_signature = 4;
|
||||
// block_id_flag indicates whether the validator voted for a block, nil, or did not vote at all
|
||||
tendermint.types.BlockIDFlag block_id_flag = 5;
|
||||
|
||||
reserved 2; // signed_last_block
|
||||
}
|
||||
|
||||
enum MisbehaviorType {
|
||||
@ -418,27 +484,3 @@ message Snapshot {
|
||||
bytes hash = 4; // Arbitrary snapshot hash, equal only if identical
|
||||
bytes metadata = 5; // Arbitrary application metadata
|
||||
}
|
||||
|
||||
//----------------------------------------
|
||||
// Service Definition
|
||||
|
||||
service ABCIApplication {
|
||||
rpc Echo(RequestEcho) returns (ResponseEcho);
|
||||
rpc Flush(RequestFlush) returns (ResponseFlush);
|
||||
rpc Info(RequestInfo) returns (ResponseInfo);
|
||||
rpc DeliverTx(RequestDeliverTx) returns (ResponseDeliverTx);
|
||||
rpc CheckTx(RequestCheckTx) returns (ResponseCheckTx);
|
||||
rpc Query(RequestQuery) returns (ResponseQuery);
|
||||
rpc Commit(RequestCommit) returns (ResponseCommit);
|
||||
rpc InitChain(RequestInitChain) returns (ResponseInitChain);
|
||||
rpc BeginBlock(RequestBeginBlock) returns (ResponseBeginBlock);
|
||||
rpc EndBlock(RequestEndBlock) returns (ResponseEndBlock);
|
||||
rpc ListSnapshots(RequestListSnapshots) returns (ResponseListSnapshots);
|
||||
rpc OfferSnapshot(RequestOfferSnapshot) returns (ResponseOfferSnapshot);
|
||||
rpc LoadSnapshotChunk(RequestLoadSnapshotChunk)
|
||||
returns (ResponseLoadSnapshotChunk);
|
||||
rpc ApplySnapshotChunk(RequestApplySnapshotChunk)
|
||||
returns (ResponseApplySnapshotChunk);
|
||||
rpc PrepareProposal(RequestPrepareProposal) returns (ResponsePrepareProposal);
|
||||
rpc ProcessProposal(RequestProcessProposal) returns (ResponseProcessProposal);
|
||||
}
|
||||
|
||||
@ -15,6 +15,7 @@ message ConsensusParams {
|
||||
EvidenceParams evidence = 2;
|
||||
ValidatorParams validator = 3;
|
||||
VersionParams version = 4;
|
||||
ABCIParams abci = 5;
|
||||
}
|
||||
|
||||
// BlockParams contains limits on the block size.
|
||||
@ -26,7 +27,7 @@ message BlockParams {
|
||||
// Note: must be greater or equal to -1
|
||||
int64 max_gas = 2;
|
||||
|
||||
reserved 3; // was TimeIotaMs see https://github.com/cometbft/cometbft/pull/5792
|
||||
reserved 3; // was TimeIotaMs see https://github.com/tendermint/tendermint/pull/5792
|
||||
}
|
||||
|
||||
// EvidenceParams determine how we handle evidence of malfeasance.
|
||||
@ -75,3 +76,17 @@ message HashedParams {
|
||||
int64 block_max_bytes = 1;
|
||||
int64 block_max_gas = 2;
|
||||
}
|
||||
|
||||
// ABCIParams configure functionality specific to the Application Blockchain Interface.
|
||||
message ABCIParams {
|
||||
// vote_extensions_enable_height configures the first height during which
|
||||
// vote extensions will be enabled. During this specified height, and for all
|
||||
// subsequent heights, precommit messages that do not contain valid extension data
|
||||
// will be considered invalid. Prior to this height, vote extensions will not
|
||||
// be used or accepted by validators on the network.
|
||||
//
|
||||
// Once enabled, vote extensions will be created by the application in ExtendVote,
|
||||
// passed to the application for validation in VerifyVoteExtension and given
|
||||
// to the application to use when proposing a block during PrepareProposal.
|
||||
int64 vote_extensions_enable_height = 1;
|
||||
}
|
||||
|
||||
@ -9,17 +9,6 @@ import "tendermint/crypto/proof.proto";
|
||||
import "tendermint/version/types.proto";
|
||||
import "tendermint/types/validator.proto";
|
||||
|
||||
// BlockIdFlag indicates which BlcokID the signature is for
|
||||
enum BlockIDFlag {
|
||||
option (gogoproto.goproto_enum_stringer) = true;
|
||||
option (gogoproto.goproto_enum_prefix) = false;
|
||||
|
||||
BLOCK_ID_FLAG_UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "BlockIDFlagUnknown"];
|
||||
BLOCK_ID_FLAG_ABSENT = 1 [(gogoproto.enumvalue_customname) = "BlockIDFlagAbsent"];
|
||||
BLOCK_ID_FLAG_COMMIT = 2 [(gogoproto.enumvalue_customname) = "BlockIDFlagCommit"];
|
||||
BLOCK_ID_FLAG_NIL = 3 [(gogoproto.enumvalue_customname) = "BlockIDFlagNil"];
|
||||
}
|
||||
|
||||
// SignedMsgType is a type of signed message in the consensus.
|
||||
enum SignedMsgType {
|
||||
option (gogoproto.goproto_enum_stringer) = true;
|
||||
@ -89,7 +78,7 @@ message Data {
|
||||
repeated bytes txs = 1;
|
||||
}
|
||||
|
||||
// Vote represents a prevote, precommit, or commit vote from validators for
|
||||
// Vote represents a prevote or precommit vote from validators for
|
||||
// consensus.
|
||||
message Vote {
|
||||
SignedMsgType type = 1;
|
||||
@ -101,7 +90,16 @@ message Vote {
|
||||
[(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
|
||||
bytes validator_address = 6;
|
||||
int32 validator_index = 7;
|
||||
bytes signature = 8;
|
||||
// Vote signature by the validator if they participated in consensus for the
|
||||
// associated block.
|
||||
bytes signature = 8;
|
||||
// Vote extension provided by the application. Only valid for precommit
|
||||
// messages.
|
||||
bytes extension = 9;
|
||||
// Vote extension signature by the validator if they participated in
|
||||
// consensus for the associated block.
|
||||
// Only valid for precommit messages.
|
||||
bytes extension_signature = 10;
|
||||
}
|
||||
|
||||
// Commit contains the evidence that a block was committed by a set of validators.
|
||||
@ -114,13 +112,36 @@ message Commit {
|
||||
|
||||
// CommitSig is a part of the Vote included in a Commit.
|
||||
message CommitSig {
|
||||
BlockIDFlag block_id_flag = 1;
|
||||
bytes validator_address = 2;
|
||||
google.protobuf.Timestamp timestamp = 3
|
||||
tendermint.types.BlockIDFlag block_id_flag = 1;
|
||||
bytes validator_address = 2;
|
||||
google.protobuf.Timestamp timestamp = 3
|
||||
[(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
|
||||
bytes signature = 4;
|
||||
}
|
||||
|
||||
message ExtendedCommit {
|
||||
int64 height = 1;
|
||||
int32 round = 2;
|
||||
BlockID block_id = 3
|
||||
[(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"];
|
||||
repeated ExtendedCommitSig extended_signatures = 4 [(gogoproto.nullable) = false];
|
||||
}
|
||||
|
||||
// ExtendedCommitSig retains all the same fields as CommitSig but adds vote
|
||||
// extension-related fields. We use two signatures to ensure backwards compatibility.
|
||||
// That is the digest of the original signature is still the same in prior versions
|
||||
message ExtendedCommitSig {
|
||||
tendermint.types.BlockIDFlag block_id_flag = 1;
|
||||
bytes validator_address = 2;
|
||||
google.protobuf.Timestamp timestamp = 3
|
||||
[(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
|
||||
bytes signature = 4;
|
||||
// Vote extension data
|
||||
bytes extension = 5;
|
||||
// Vote extension signature
|
||||
bytes extension_signature = 6;
|
||||
}
|
||||
|
||||
message Proposal {
|
||||
SignedMsgType type = 1;
|
||||
int64 height = 2;
|
||||
|
||||
@ -6,6 +6,18 @@ option go_package = "github.com/cometbft/cometbft/proto/tendermint/types";
|
||||
import "gogoproto/gogo.proto";
|
||||
import "tendermint/crypto/keys.proto";
|
||||
|
||||
// BlockIdFlag indicates which BlockID the signature is for
|
||||
enum BlockIDFlag {
|
||||
option (gogoproto.goproto_enum_stringer) = true;
|
||||
option (gogoproto.goproto_enum_prefix) = false;
|
||||
|
||||
BLOCK_ID_FLAG_UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "BlockIDFlagUnknown"]; // indicates an error condition
|
||||
BLOCK_ID_FLAG_ABSENT = 1 [(gogoproto.enumvalue_customname) = "BlockIDFlagAbsent"]; // the vote was not received
|
||||
BLOCK_ID_FLAG_COMMIT = 2 [(gogoproto.enumvalue_customname) = "BlockIDFlagCommit"]; // voted for the block that received the majority
|
||||
BLOCK_ID_FLAG_NIL = 3 [(gogoproto.enumvalue_customname) = "BlockIDFlagNil"]; // voted for nil
|
||||
}
|
||||
|
||||
|
||||
message ValidatorSet {
|
||||
repeated Validator validators = 1;
|
||||
Validator proposer = 2;
|
||||
|
||||
@ -18,6 +18,7 @@ import (
|
||||
nodeservice "github.com/cosmos/cosmos-sdk/client/grpc/node"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
|
||||
"github.com/cosmos/cosmos-sdk/server"
|
||||
"github.com/cosmos/cosmos-sdk/server/api"
|
||||
"github.com/cosmos/cosmos-sdk/server/config"
|
||||
servertypes "github.com/cosmos/cosmos-sdk/server/types"
|
||||
@ -127,13 +128,13 @@ func (a *App) Load(loadLatest bool) error {
|
||||
}
|
||||
|
||||
// BeginBlocker application updates every begin block
|
||||
func (a *App) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) (abci.ResponseBeginBlock, error) {
|
||||
return a.ModuleManager.BeginBlock(ctx, req)
|
||||
func (a *App) BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error) {
|
||||
return a.ModuleManager.BeginBlock(ctx)
|
||||
}
|
||||
|
||||
// EndBlocker application updates every end block
|
||||
func (a *App) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) (abci.ResponseEndBlock, error) {
|
||||
return a.ModuleManager.EndBlock(ctx, req)
|
||||
func (a *App) EndBlocker(ctx sdk.Context) (sdk.EndBlock, error) {
|
||||
return a.ModuleManager.EndBlock(ctx)
|
||||
}
|
||||
|
||||
// Precommiter application updates every commit
|
||||
@ -147,7 +148,7 @@ func (a *App) PrepareCheckStater(ctx sdk.Context) {
|
||||
}
|
||||
|
||||
// InitChainer initializes the chain.
|
||||
func (a *App) InitChainer(ctx sdk.Context, req abci.RequestInitChain) (abci.ResponseInitChain, error) {
|
||||
func (a *App) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error) {
|
||||
var genesisState map[string]json.RawMessage
|
||||
if err := json.Unmarshal(req.AppStateBytes, &genesisState); err != nil {
|
||||
panic(err)
|
||||
@ -179,11 +180,12 @@ func (a *App) RegisterTxService(clientCtx client.Context) {
|
||||
|
||||
// RegisterTendermintService implements the Application.RegisterTendermintService method.
|
||||
func (a *App) RegisterTendermintService(clientCtx client.Context) {
|
||||
cmtApp := server.NewCometABCIWrapper(a)
|
||||
cmtservice.RegisterTendermintService(
|
||||
clientCtx,
|
||||
a.GRPCQueryRouter(),
|
||||
a.interfaceRegistry,
|
||||
a.Query,
|
||||
cmtApp.Query,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@ -6,18 +6,19 @@ import (
|
||||
|
||||
runtimev1alpha1 "cosmossdk.io/api/cosmos/app/runtime/v1alpha1"
|
||||
appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1"
|
||||
"cosmossdk.io/depinject"
|
||||
"cosmossdk.io/log"
|
||||
"github.com/cosmos/gogoproto/proto"
|
||||
"google.golang.org/protobuf/reflect/protodesc"
|
||||
"google.golang.org/protobuf/reflect/protoregistry"
|
||||
|
||||
"cosmossdk.io/core/appmodule"
|
||||
"cosmossdk.io/core/comet"
|
||||
"cosmossdk.io/core/event"
|
||||
"cosmossdk.io/core/genesis"
|
||||
"cosmossdk.io/core/header"
|
||||
"cosmossdk.io/core/store"
|
||||
"cosmossdk.io/depinject"
|
||||
"cosmossdk.io/log"
|
||||
storetypes "cosmossdk.io/store/types"
|
||||
"github.com/cosmos/gogoproto/proto"
|
||||
"google.golang.org/protobuf/reflect/protodesc"
|
||||
"google.golang.org/protobuf/reflect/protoregistry"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/baseapp"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
@ -86,10 +87,7 @@ func ProvideApp() (
|
||||
protoregistry.MessageTypeResolver,
|
||||
error,
|
||||
) {
|
||||
protoFiles, err := proto.MergedRegistry()
|
||||
if err != nil {
|
||||
return nil, nil, nil, nil, nil, nil, nil, nil, nil, err
|
||||
}
|
||||
protoFiles := proto.HybridResolver
|
||||
protoTypes := protoregistry.GlobalTypes
|
||||
|
||||
// At startup, check that all proto annotations are correct.
|
||||
|
||||
@ -22,13 +22,13 @@ type AppI interface {
|
||||
LegacyAmino() *codec.LegacyAmino
|
||||
|
||||
// Application updates every begin block.
|
||||
BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) (abci.ResponseBeginBlock, error)
|
||||
BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error)
|
||||
|
||||
// Application updates every end block.
|
||||
EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) (abci.ResponseEndBlock, error)
|
||||
EndBlocker(ctx sdk.Context) (sdk.EndBlock, error)
|
||||
|
||||
// Application update at chain (i.e app) initialization.
|
||||
InitChainer(ctx sdk.Context, req abci.RequestInitChain) (abci.ResponseInitChain, error)
|
||||
InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error)
|
||||
|
||||
// Loads the app at a given height.
|
||||
LoadHeight(height int64) error
|
||||
|
||||
@ -104,7 +104,7 @@ func (s *Server) Start(ctx context.Context, cfg config.Config) error {
|
||||
cmtCfg.WriteTimeout = time.Duration(cfg.API.RPCWriteTimeout) * time.Second
|
||||
cmtCfg.MaxBodyBytes = int64(cfg.API.RPCMaxBodyBytes)
|
||||
|
||||
listener, err := tmrpcserver.Listen(cfg.API.Address, cmtCfg)
|
||||
listener, err := tmrpcserver.Listen(cfg.API.Address, cmtCfg.MaxOpenConnections)
|
||||
if err != nil {
|
||||
s.mtx.Unlock()
|
||||
return err
|
||||
|
||||
72
server/cmt_abci.go
Normal file
72
server/cmt_abci.go
Normal file
@ -0,0 +1,72 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
abci "github.com/cometbft/cometbft/abci/types"
|
||||
servertypes "github.com/cosmos/cosmos-sdk/server/types"
|
||||
)
|
||||
|
||||
type cometABCIWrapper struct {
|
||||
app servertypes.ABCI
|
||||
}
|
||||
|
||||
func NewCometABCIWrapper(app servertypes.ABCI) abci.Application {
|
||||
return cometABCIWrapper{app: app}
|
||||
}
|
||||
|
||||
func (w cometABCIWrapper) Info(_ context.Context, req *abci.RequestInfo) (*abci.ResponseInfo, error) {
|
||||
return w.app.Info(req)
|
||||
}
|
||||
|
||||
func (w cometABCIWrapper) Query(ctx context.Context, req *abci.RequestQuery) (*abci.ResponseQuery, error) {
|
||||
return w.app.Query(ctx, req)
|
||||
}
|
||||
|
||||
func (w cometABCIWrapper) CheckTx(_ context.Context, req *abci.RequestCheckTx) (*abci.ResponseCheckTx, error) {
|
||||
return w.app.CheckTx(req)
|
||||
}
|
||||
|
||||
func (w cometABCIWrapper) InitChain(_ context.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error) {
|
||||
return w.app.InitChain(req)
|
||||
}
|
||||
|
||||
func (w cometABCIWrapper) PrepareProposal(_ context.Context, req *abci.RequestPrepareProposal) (*abci.ResponsePrepareProposal, error) {
|
||||
return w.app.PrepareProposal(req)
|
||||
}
|
||||
|
||||
func (w cometABCIWrapper) ProcessProposal(_ context.Context, req *abci.RequestProcessProposal) (*abci.ResponseProcessProposal, error) {
|
||||
return w.app.ProcessProposal(req)
|
||||
}
|
||||
|
||||
func (w cometABCIWrapper) FinalizeBlock(_ context.Context, req *abci.RequestFinalizeBlock) (*abci.ResponseFinalizeBlock, error) {
|
||||
return w.app.FinalizeBlock(req)
|
||||
}
|
||||
|
||||
func (w cometABCIWrapper) ExtendVote(ctx context.Context, req *abci.RequestExtendVote) (*abci.ResponseExtendVote, error) {
|
||||
return w.app.ExtendVote(ctx, req)
|
||||
}
|
||||
|
||||
func (w cometABCIWrapper) VerifyVoteExtension(_ context.Context, req *abci.RequestVerifyVoteExtension) (*abci.ResponseVerifyVoteExtension, error) {
|
||||
return w.app.VerifyVoteExtension(req)
|
||||
}
|
||||
|
||||
func (w cometABCIWrapper) Commit(_ context.Context, _ *abci.RequestCommit) (*abci.ResponseCommit, error) {
|
||||
return w.app.Commit()
|
||||
}
|
||||
|
||||
func (w cometABCIWrapper) ListSnapshots(_ context.Context, req *abci.RequestListSnapshots) (*abci.ResponseListSnapshots, error) {
|
||||
return w.app.ListSnapshots(req)
|
||||
}
|
||||
|
||||
func (w cometABCIWrapper) OfferSnapshot(_ context.Context, req *abci.RequestOfferSnapshot) (*abci.ResponseOfferSnapshot, error) {
|
||||
return w.app.OfferSnapshot(req)
|
||||
}
|
||||
|
||||
func (w cometABCIWrapper) LoadSnapshotChunk(_ context.Context, req *abci.RequestLoadSnapshotChunk) (*abci.ResponseLoadSnapshotChunk, error) {
|
||||
return w.app.LoadSnapshotChunk(req)
|
||||
}
|
||||
|
||||
func (w cometABCIWrapper) ApplySnapshotChunk(_ context.Context, req *abci.RequestApplySnapshotChunk) (*abci.ResponseApplySnapshotChunk, error) {
|
||||
return w.app.ApplySnapshotChunk(req)
|
||||
}
|
||||
@ -6,6 +6,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"cosmossdk.io/log"
|
||||
cmtcfg "github.com/cometbft/cometbft/config"
|
||||
"github.com/cometbft/cometbft/light"
|
||||
"github.com/cometbft/cometbft/node"
|
||||
"github.com/cometbft/cometbft/p2p"
|
||||
@ -284,13 +285,13 @@ func BootstrapStateCmd(appCreator types.AppCreator) *cobra.Command {
|
||||
height = app.CommitMultiStore().LastCommitID().Version
|
||||
}
|
||||
|
||||
blockStoreDB, err := node.DefaultDBProvider(&node.DBContext{ID: "blockstore", Config: cfg})
|
||||
blockStoreDB, err := cmtcfg.DefaultDBProvider(&cmtcfg.DBContext{ID: "blockstore", Config: cfg})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
blockStore := store.NewBlockStore(blockStoreDB)
|
||||
|
||||
stateDB, err := node.DefaultDBProvider(&node.DBContext{ID: "state", Config: cfg})
|
||||
stateDB, err := cmtcfg.DefaultDBProvider(&cmtcfg.DBContext{ID: "state", Config: cfg})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@ -17,6 +17,7 @@ import (
|
||||
bam "github.com/cosmos/cosmos-sdk/baseapp"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
|
||||
servertypes "github.com/cosmos/cosmos-sdk/server/types"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
|
||||
)
|
||||
@ -24,7 +25,7 @@ import (
|
||||
// NewApp creates a simple mock kvstore app for testing. It should work
|
||||
// similar to a real app. Make sure rootDir is empty before running the test,
|
||||
// in order to guarantee consistent results.
|
||||
func NewApp(rootDir string, logger log.Logger) (abci.Application, error) {
|
||||
func NewApp(rootDir string, logger log.Logger) (servertypes.ABCI, error) {
|
||||
db, err := db.NewGoLevelDB("mock", filepath.Join(rootDir, "data"), nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -96,21 +97,21 @@ type GenesisJSON struct {
|
||||
|
||||
// InitChainer returns a function that can initialize the chain
|
||||
// with key/value pairs
|
||||
func InitChainer(key storetypes.StoreKey) func(sdk.Context, abci.RequestInitChain) (abci.ResponseInitChain, error) {
|
||||
return func(ctx sdk.Context, req abci.RequestInitChain) (abci.ResponseInitChain, error) {
|
||||
func InitChainer(key storetypes.StoreKey) func(sdk.Context, *abci.RequestInitChain) (*abci.ResponseInitChain, error) {
|
||||
return func(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error) {
|
||||
stateJSON := req.AppStateBytes
|
||||
|
||||
genesisState := new(GenesisJSON)
|
||||
err := json.Unmarshal(stateJSON, genesisState)
|
||||
if err != nil {
|
||||
return abci.ResponseInitChain{}, err
|
||||
return &abci.ResponseInitChain{}, err
|
||||
}
|
||||
|
||||
for _, val := range genesisState.Values {
|
||||
store := ctx.KVStore(key)
|
||||
store.Set([]byte(val.Key), []byte(val.Value))
|
||||
}
|
||||
return abci.ResponseInitChain{}, nil
|
||||
return &abci.ResponseInitChain{}, nil
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,22 +1,23 @@
|
||||
package mock
|
||||
|
||||
import (
|
||||
"context"
|
||||
"math/rand"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"cosmossdk.io/log"
|
||||
abci "github.com/cometbft/cometbft/abci/types"
|
||||
cmtproto "github.com/cometbft/cometbft/proto/tendermint/types"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
servertypes "github.com/cosmos/cosmos-sdk/server/types"
|
||||
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
|
||||
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
|
||||
)
|
||||
|
||||
// SetupApp initializes a new application,
|
||||
// failing t if initialization fails.
|
||||
func SetupApp(t *testing.T) abci.Application {
|
||||
func SetupApp(t *testing.T) servertypes.ABCI {
|
||||
t.Helper()
|
||||
|
||||
logger := log.NewTestLogger(t)
|
||||
@ -38,7 +39,12 @@ func TestInitApp(t *testing.T) {
|
||||
req := abci.RequestInitChain{
|
||||
AppStateBytes: appState,
|
||||
}
|
||||
app.InitChain(req)
|
||||
res, err := app.InitChain(&req)
|
||||
require.NoError(t, err)
|
||||
app.FinalizeBlock(&abci.RequestFinalizeBlock{
|
||||
Hash: res.AppHash,
|
||||
Height: 1,
|
||||
})
|
||||
app.Commit()
|
||||
|
||||
// make sure we can query these values
|
||||
@ -47,7 +53,8 @@ func TestInitApp(t *testing.T) {
|
||||
Data: []byte("foo"),
|
||||
}
|
||||
|
||||
qres := app.Query(query)
|
||||
qres, err := app.Query(context.Background(), &query)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, uint32(0), qres.Code, qres.Log)
|
||||
require.Equal(t, []byte("bar"), qres.Value)
|
||||
}
|
||||
@ -64,18 +71,16 @@ func TestDeliverTx(t *testing.T) {
|
||||
tx := NewTx(key, value, randomAccounts[0].Address)
|
||||
txBytes := tx.GetSignBytes()
|
||||
|
||||
app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{
|
||||
AppHash: []byte("apphash"),
|
||||
Height: 1,
|
||||
}})
|
||||
res, err := app.FinalizeBlock(&abci.RequestFinalizeBlock{
|
||||
Hash: []byte("apphash"),
|
||||
Height: 1,
|
||||
Txs: [][]byte{txBytes},
|
||||
})
|
||||
require.NoError(t, err)
|
||||
require.NotEmpty(t, res.AppHash)
|
||||
|
||||
dres := app.DeliverTx(abci.RequestDeliverTx{Tx: txBytes})
|
||||
require.Equal(t, uint32(0), dres.Code, dres.Log)
|
||||
|
||||
app.EndBlock(abci.RequestEndBlock{})
|
||||
|
||||
cres := app.Commit()
|
||||
require.NotEmpty(t, cres.Data)
|
||||
_, err = app.Commit()
|
||||
require.NoError(t, err)
|
||||
|
||||
// make sure we can query these values
|
||||
query := abci.RequestQuery{
|
||||
@ -83,7 +88,8 @@ func TestDeliverTx(t *testing.T) {
|
||||
Data: []byte(key),
|
||||
}
|
||||
|
||||
qres := app.Query(query)
|
||||
qres, err := app.Query(context.Background(), &query)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, uint32(0), qres.Code, qres.Log)
|
||||
require.Equal(t, []byte(value), qres.Value)
|
||||
}
|
||||
|
||||
110
server/start.go
110
server/start.go
@ -255,7 +255,8 @@ func startStandAlone(svrCtx *Context, app types.Application, opts StartCmdOption
|
||||
addr := svrCtx.Viper.GetString(flagAddress)
|
||||
transport := svrCtx.Viper.GetString(flagTransport)
|
||||
|
||||
svr, err := server.NewServer(addr, transport, app)
|
||||
cmtApp := NewCometABCIWrapper(app)
|
||||
svr, err := server.NewServer(addr, transport, cmtApp)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error creating listener: %v", err)
|
||||
}
|
||||
@ -337,50 +338,25 @@ func startInProcess(svrCtx *Context, svrCfg serverconfig.Config, clientCtx clien
|
||||
return g.Wait()
|
||||
}
|
||||
|
||||
func startApp(svrCtx *Context, appCreator types.AppCreator, opts StartCmdOptions) (app types.Application, cleanupFn func(), err error) {
|
||||
traceWriter, traceCleanupFn, err := setupTraceWriter(svrCtx)
|
||||
if err != nil {
|
||||
return app, traceCleanupFn, err
|
||||
}
|
||||
|
||||
home := svrCtx.Config.RootDir
|
||||
db, err := opts.DBOpener(home, GetAppDBBackend(svrCtx.Viper))
|
||||
if err != nil {
|
||||
return app, traceCleanupFn, err
|
||||
}
|
||||
|
||||
app = appCreator(svrCtx.Logger, db, traceWriter, svrCtx.Viper)
|
||||
cleanupFn = func() {
|
||||
traceCleanupFn()
|
||||
if localErr := app.Close(); localErr != nil {
|
||||
svrCtx.Logger.Error(localErr.Error())
|
||||
}
|
||||
}
|
||||
return app, cleanupFn, nil
|
||||
}
|
||||
|
||||
func getCtx(svrCtx *Context, block bool) (*errgroup.Group, context.Context) {
|
||||
ctx, cancelFn := context.WithCancel(context.Background())
|
||||
g, ctx := errgroup.WithContext(ctx)
|
||||
// listen for quit signals so the calling parent process can gracefully exit
|
||||
ListenForQuitSignals(g, block, cancelFn, svrCtx.Logger)
|
||||
return g, ctx
|
||||
}
|
||||
|
||||
func startCmtNode(cfg *cmtcfg.Config, app types.Application, svrCtx *Context) (tmNode *node.Node, cleanupFn func(), err error) {
|
||||
cleanupFn = func() {}
|
||||
// TODO: Move nodeKey into being created within the function.
|
||||
func startCmtNode(
|
||||
cfg *cmtcfg.Config,
|
||||
app types.Application,
|
||||
svrCtx *Context,
|
||||
) (tmNode *node.Node, cleanupFn func(), err error) {
|
||||
nodeKey, err := p2p.LoadOrGenNodeKey(cfg.NodeKeyFile())
|
||||
if err != nil {
|
||||
return nil, cleanupFn, err
|
||||
}
|
||||
|
||||
cmtApp := NewCometABCIWrapper(app)
|
||||
tmNode, err = node.NewNode(
|
||||
cfg,
|
||||
pvm.LoadOrGenFilePV(cfg.PrivValidatorKeyFile(), cfg.PrivValidatorStateFile()),
|
||||
nodeKey,
|
||||
proxy.NewLocalClientCreator(app),
|
||||
proxy.NewLocalClientCreator(cmtApp),
|
||||
getGenDocProvider(cfg),
|
||||
node.DefaultDBProvider,
|
||||
cmtcfg.DefaultDBProvider,
|
||||
node.DefaultMetricsProvider(cfg.Instrumentation),
|
||||
servercmtlog.CometLoggerWrapper{Logger: svrCtx.Logger},
|
||||
)
|
||||
@ -448,9 +424,14 @@ func setupTraceWriter(svrCtx *Context) (traceWriter io.WriteCloser, cleanup func
|
||||
return traceWriter, cleanup, nil
|
||||
}
|
||||
|
||||
func startGrpcServer(ctx context.Context, g *errgroup.Group, config serverconfig.GRPCConfig, clientCtx client.Context, svrCtx *Context, app types.Application) (
|
||||
*grpc.Server, client.Context, error,
|
||||
) {
|
||||
func startGrpcServer(
|
||||
ctx context.Context,
|
||||
g *errgroup.Group,
|
||||
config serverconfig.GRPCConfig,
|
||||
clientCtx client.Context,
|
||||
svrCtx *Context,
|
||||
app types.Application,
|
||||
) (*grpc.Server, client.Context, error) {
|
||||
if !config.Enable {
|
||||
// return grpcServer as nil if gRPC is disabled
|
||||
return nil, clientCtx, nil
|
||||
@ -502,22 +483,23 @@ func startGrpcServer(ctx context.Context, g *errgroup.Group, config serverconfig
|
||||
return grpcSrv, clientCtx, nil
|
||||
}
|
||||
|
||||
func startAPIServer(ctx context.Context, g *errgroup.Group, cmtCfg *cmtcfg.Config, svrCfg serverconfig.Config,
|
||||
clientCtx client.Context, svrCtx *Context, app types.Application, home string, grpcSrv *grpc.Server, metrics *telemetry.Metrics,
|
||||
func startAPIServer(
|
||||
ctx context.Context,
|
||||
g *errgroup.Group,
|
||||
cmtCfg *cmtcfg.Config,
|
||||
svrCfg serverconfig.Config,
|
||||
clientCtx client.Context,
|
||||
svrCtx *Context,
|
||||
app types.Application,
|
||||
home string,
|
||||
grpcSrv *grpc.Server,
|
||||
metrics *telemetry.Metrics,
|
||||
) error {
|
||||
if !svrCfg.API.Enable {
|
||||
return nil
|
||||
}
|
||||
// TODO: Why do we reload and unmarshal the entire genesis doc in order to get the chain ID.
|
||||
// surely theres a better way. This is likely a serious node start time overhead.
|
||||
// Shouldn't it be in cmtCfg.ChainID() ?
|
||||
genDocProvider := getGenDocProvider(cmtCfg)
|
||||
genDoc, err := genDocProvider()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
clientCtx = clientCtx.WithHomeDir(home).WithChainID(genDoc.ChainID)
|
||||
clientCtx = clientCtx.WithHomeDir(home)
|
||||
|
||||
apiSrv := api.New(clientCtx, svrCtx.Logger.With("module", "api-server"), grpcSrv)
|
||||
app.RegisterAPIRoutes(apiSrv, svrCfg.API)
|
||||
@ -594,3 +576,33 @@ func emitServerInfoMetrics() {
|
||||
|
||||
telemetry.SetGaugeWithLabels([]string{"server", "info"}, 1, ls)
|
||||
}
|
||||
|
||||
func getCtx(svrCtx *Context, block bool) (*errgroup.Group, context.Context) {
|
||||
ctx, cancelFn := context.WithCancel(context.Background())
|
||||
g, ctx := errgroup.WithContext(ctx)
|
||||
// listen for quit signals so the calling parent process can gracefully exit
|
||||
ListenForQuitSignals(g, block, cancelFn, svrCtx.Logger)
|
||||
return g, ctx
|
||||
}
|
||||
|
||||
func startApp(svrCtx *Context, appCreator types.AppCreator, opts StartCmdOptions) (app types.Application, cleanupFn func(), err error) {
|
||||
traceWriter, traceCleanupFn, err := setupTraceWriter(svrCtx)
|
||||
if err != nil {
|
||||
return app, traceCleanupFn, err
|
||||
}
|
||||
|
||||
home := svrCtx.Config.RootDir
|
||||
db, err := opts.DBOpener(home, GetAppDBBackend(svrCtx.Viper))
|
||||
if err != nil {
|
||||
return app, traceCleanupFn, err
|
||||
}
|
||||
|
||||
app = appCreator(svrCtx.Logger, db, traceWriter, svrCtx.Viper)
|
||||
cleanupFn = func() {
|
||||
traceCleanupFn()
|
||||
if localErr := app.Close(); localErr != nil {
|
||||
svrCtx.Logger.Error(localErr.Error())
|
||||
}
|
||||
}
|
||||
return app, cleanupFn, nil
|
||||
}
|
||||
|
||||
37
server/types/abci.go
Normal file
37
server/types/abci.go
Normal file
@ -0,0 +1,37 @@
|
||||
package types
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
abci "github.com/cometbft/cometbft/abci/types"
|
||||
)
|
||||
|
||||
// ABCI is an interface that enables any finite, deterministic state machine
|
||||
// to be driven by a blockchain-based replication engine via the ABCI.
|
||||
type ABCI interface {
|
||||
// Info/Query Connection
|
||||
Info(*abci.RequestInfo) (*abci.ResponseInfo, error) // Return application info
|
||||
Query(context.Context, *abci.RequestQuery) (*abci.ResponseQuery, error) // Query for state
|
||||
|
||||
// Mempool Connection
|
||||
CheckTx(*abci.RequestCheckTx) (*abci.ResponseCheckTx, error) // Validate a tx for the mempool
|
||||
|
||||
// Consensus Connection
|
||||
InitChain(*abci.RequestInitChain) (*abci.ResponseInitChain, error) // Initialize blockchain w validators/other info from CometBFT
|
||||
PrepareProposal(*abci.RequestPrepareProposal) (*abci.ResponsePrepareProposal, error)
|
||||
ProcessProposal(*abci.RequestProcessProposal) (*abci.ResponseProcessProposal, error)
|
||||
// Deliver the decided block with its txs to the Application
|
||||
FinalizeBlock(*abci.RequestFinalizeBlock) (*abci.ResponseFinalizeBlock, error)
|
||||
// Create application specific vote extension
|
||||
ExtendVote(context.Context, *abci.RequestExtendVote) (*abci.ResponseExtendVote, error)
|
||||
// Verify application's vote extension data
|
||||
VerifyVoteExtension(*abci.RequestVerifyVoteExtension) (*abci.ResponseVerifyVoteExtension, error)
|
||||
// Commit the state and return the application Merkle root hash
|
||||
Commit() (*abci.ResponseCommit, error)
|
||||
|
||||
// State Sync Connection
|
||||
ListSnapshots(*abci.RequestListSnapshots) (*abci.ResponseListSnapshots, error) // List available snapshots
|
||||
OfferSnapshot(*abci.RequestOfferSnapshot) (*abci.ResponseOfferSnapshot, error) // Offer a snapshot to the application
|
||||
LoadSnapshotChunk(*abci.RequestLoadSnapshotChunk) (*abci.ResponseLoadSnapshotChunk, error) // Load a snapshot chunk
|
||||
ApplySnapshotChunk(*abci.RequestApplySnapshotChunk) (*abci.ResponseApplySnapshotChunk, error) // Apply a shapshot chunk
|
||||
}
|
||||
@ -7,7 +7,6 @@ import (
|
||||
"cosmossdk.io/log"
|
||||
"cosmossdk.io/store/snapshots"
|
||||
storetypes "cosmossdk.io/store/types"
|
||||
abci "github.com/cometbft/cometbft/abci/types"
|
||||
cmtproto "github.com/cometbft/cometbft/proto/tendermint/types"
|
||||
cmttypes "github.com/cometbft/cometbft/types"
|
||||
dbm "github.com/cosmos/cosmos-db"
|
||||
@ -35,7 +34,7 @@ type (
|
||||
// The interface defines the necessary contracts to be implemented in order
|
||||
// to fully bootstrap and start an application.
|
||||
Application interface {
|
||||
abci.Application
|
||||
ABCI
|
||||
|
||||
RegisterAPIRoutes(*api.Server, config.APIConfig)
|
||||
|
||||
|
||||
@ -567,13 +567,13 @@ func (app *SimApp) setPostHandler() {
|
||||
func (app *SimApp) Name() string { return app.BaseApp.Name() }
|
||||
|
||||
// BeginBlocker application updates every begin block
|
||||
func (app *SimApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) (abci.ResponseBeginBlock, error) {
|
||||
return app.ModuleManager.BeginBlock(ctx, req)
|
||||
func (app *SimApp) BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error) {
|
||||
return app.ModuleManager.BeginBlock(ctx)
|
||||
}
|
||||
|
||||
// EndBlocker application updates every end block
|
||||
func (app *SimApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) (abci.ResponseEndBlock, error) {
|
||||
return app.ModuleManager.EndBlock(ctx, req)
|
||||
func (app *SimApp) EndBlocker(ctx sdk.Context) (sdk.EndBlock, error) {
|
||||
return app.ModuleManager.EndBlock(ctx)
|
||||
}
|
||||
|
||||
func (a *SimApp) Configurator() module.Configurator {
|
||||
@ -581,7 +581,7 @@ func (a *SimApp) Configurator() module.Configurator {
|
||||
}
|
||||
|
||||
// InitChainer application update at chain initialization
|
||||
func (app *SimApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) (abci.ResponseInitChain, error) {
|
||||
func (app *SimApp) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error) {
|
||||
var genesisState GenesisState
|
||||
if err := json.Unmarshal(req.AppStateBytes, &genesisState); err != nil {
|
||||
panic(err)
|
||||
@ -703,11 +703,12 @@ func (app *SimApp) RegisterTxService(clientCtx client.Context) {
|
||||
|
||||
// RegisterTendermintService implements the Application.RegisterTendermintService method.
|
||||
func (app *SimApp) RegisterTendermintService(clientCtx client.Context) {
|
||||
cmtApp := server.NewCometABCIWrapper(app)
|
||||
cmtservice.RegisterTendermintService(
|
||||
clientCtx,
|
||||
app.BaseApp.GRPCQueryRouter(),
|
||||
app.interfaceRegistry,
|
||||
app.Query,
|
||||
cmtApp.Query,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@ -5,7 +5,10 @@ import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"cosmossdk.io/core/appmodule"
|
||||
"cosmossdk.io/log"
|
||||
"cosmossdk.io/x/evidence"
|
||||
feegrantmodule "cosmossdk.io/x/feegrant/module"
|
||||
"cosmossdk.io/x/upgrade"
|
||||
abci "github.com/cometbft/cometbft/abci/types"
|
||||
cmtproto "github.com/cometbft/cometbft/proto/tendermint/types"
|
||||
@ -14,9 +17,6 @@ import (
|
||||
"github.com/golang/mock/gomock"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"cosmossdk.io/core/appmodule"
|
||||
"cosmossdk.io/log"
|
||||
feegrantmodule "cosmossdk.io/x/feegrant/module"
|
||||
"github.com/cosmos/cosmos-sdk/baseapp"
|
||||
"github.com/cosmos/cosmos-sdk/testutil/mock"
|
||||
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
|
||||
@ -64,11 +64,18 @@ func TestSimAppExportAndBlockedAddrs(t *testing.T) {
|
||||
)
|
||||
}
|
||||
|
||||
app.Commit()
|
||||
// finalize block so we have CheckTx state set
|
||||
_, err := app.FinalizeBlock(&abci.RequestFinalizeBlock{
|
||||
Height: 1,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
_, err = app.Commit()
|
||||
require.NoError(t, err)
|
||||
|
||||
// Making a new app object with the db, so that initchain hasn't been called
|
||||
app2 := NewSimApp(logger.With("instance", "second"), db, nil, true, simtestutil.NewAppOptionsWithFlagHome(t.TempDir()))
|
||||
_, err := app2.ExportAppStateAndValidators(false, []string{}, []string{})
|
||||
_, err = app2.ExportAppStateAndValidators(false, []string{}, []string{})
|
||||
require.NoError(t, err, "ExportAppStateAndValidators should not have an error")
|
||||
}
|
||||
|
||||
@ -107,7 +114,7 @@ func TestRunMigrations(t *testing.T) {
|
||||
}
|
||||
|
||||
// Initialize the chain
|
||||
app.InitChain(abci.RequestInitChain{})
|
||||
app.InitChain(&abci.RequestInitChain{})
|
||||
app.Commit()
|
||||
|
||||
testCases := []struct {
|
||||
|
||||
@ -17,7 +17,7 @@ require (
|
||||
cosmossdk.io/x/feegrant v0.0.0-20230117113717-50e7c4a4ceff
|
||||
cosmossdk.io/x/nft v0.0.0-20230113085233-fae3332d62fc
|
||||
cosmossdk.io/x/upgrade v0.0.0-20230127052425-54c8e1568335
|
||||
github.com/cometbft/cometbft v0.37.1
|
||||
github.com/cometbft/cometbft v0.38.0-alpha.2
|
||||
github.com/cosmos/cosmos-db v1.0.0-rc.1
|
||||
// this version is not used as it is always replaced by the latest Cosmos SDK version
|
||||
github.com/cosmos/cosmos-sdk v0.48.0
|
||||
@ -43,7 +43,6 @@ require (
|
||||
filippo.io/edwards25519 v1.0.0 // indirect
|
||||
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
|
||||
github.com/99designs/keyring v1.2.1 // indirect
|
||||
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect
|
||||
github.com/DataDog/zstd v1.5.2 // indirect
|
||||
github.com/armon/go-metrics v0.4.1 // indirect
|
||||
github.com/aws/aws-sdk-go v1.44.224 // indirect
|
||||
@ -72,7 +71,6 @@ require (
|
||||
github.com/cosmos/ledger-cosmos-go v0.13.0 // indirect
|
||||
github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect
|
||||
github.com/creachadair/atomicfile v0.3.0 // indirect
|
||||
github.com/creachadair/taskgroup v0.4.2 // indirect
|
||||
github.com/creachadair/tomledit v0.0.24 // indirect
|
||||
github.com/danieljoos/wincred v1.1.2 // indirect
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
@ -109,8 +107,6 @@ require (
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
|
||||
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
|
||||
github.com/gtank/merlin v0.1.1 // indirect
|
||||
github.com/gtank/ristretto255 v0.1.2 // indirect
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
|
||||
github.com/hashicorp/go-getter v1.7.1 // indirect
|
||||
github.com/hashicorp/go-hclog v1.5.0 // indirect
|
||||
@ -139,12 +135,12 @@ require (
|
||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||
github.com/mattn/go-isatty v0.0.19 // indirect
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
|
||||
github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect
|
||||
github.com/minio/highwayhash v1.0.2 // indirect
|
||||
github.com/mitchellh/go-homedir v1.1.0 // indirect
|
||||
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
|
||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||
github.com/mtibben/percent v0.2.1 // indirect
|
||||
github.com/oasisprotocol/curve25519-voi v0.0.0-20220708102147-0a8a51822cae // indirect
|
||||
github.com/oklog/run v1.1.0 // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.0.7 // indirect
|
||||
github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect
|
||||
@ -201,6 +197,7 @@ replace (
|
||||
cosmossdk.io/client/v2 => ../client/v2
|
||||
// TODO: remove me after collections 0.2. is released.
|
||||
cosmossdk.io/collections => ../collections
|
||||
cosmossdk.io/core => ../core
|
||||
cosmossdk.io/store => ../store
|
||||
cosmossdk.io/tools/confix => ../tools/confix
|
||||
cosmossdk.io/tools/rosetta => ../tools/rosetta
|
||||
@ -208,7 +205,6 @@ replace (
|
||||
cosmossdk.io/x/evidence => ../x/evidence
|
||||
cosmossdk.io/x/feegrant => ../x/feegrant
|
||||
cosmossdk.io/x/nft => ../x/nft
|
||||
// TODO: remove after 0.7.0 release
|
||||
cosmossdk.io/x/tx => ../x/tx
|
||||
cosmossdk.io/x/upgrade => ../x/upgrade
|
||||
)
|
||||
|
||||
@ -188,8 +188,6 @@ cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xX
|
||||
cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg=
|
||||
cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0=
|
||||
cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M=
|
||||
cosmossdk.io/core v0.7.0 h1:GFss3qt2P9p23Cz24NnqLkslzb8n+B75A24x1JgJJp0=
|
||||
cosmossdk.io/core v0.7.0/go.mod h1:36hP0ZH/8ipsjzfcp0yKU4bqQXUGhS0/m1krWFCtwCc=
|
||||
cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z+zfw=
|
||||
cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU=
|
||||
cosmossdk.io/errors v1.0.0-beta.7.0.20230429155654-3ee8242364e4 h1:rOy7iw7HlwKc5Af5qIHLXdBx/F98o6du/I/WGwOW6eA=
|
||||
@ -204,11 +202,9 @@ filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5E
|
||||
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs=
|
||||
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4=
|
||||
github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8=
|
||||
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8=
|
||||
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg=
|
||||
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4=
|
||||
github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno=
|
||||
github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo=
|
||||
github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
|
||||
@ -265,7 +261,7 @@ github.com/bits-and-blooms/bitset v1.7.0 h1:YjAGVd3XmtK9ktAbX8Zg2g2PwLIMjGREZJHl
|
||||
github.com/bits-and-blooms/bitset v1.7.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA=
|
||||
github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U=
|
||||
github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04=
|
||||
github.com/btcsuite/btcd/btcutil v1.1.2 h1:XLMbX8JQEiwMcYft2EGi8zPUkoa0abKIU6/BJSRsjzQ=
|
||||
github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ=
|
||||
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U=
|
||||
github.com/bufbuild/protocompile v0.5.1 h1:mixz5lJX4Hiz4FpqFREJHIXLfaLBntfaJv1h+/jS+Qg=
|
||||
github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM=
|
||||
@ -328,8 +324,8 @@ github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE
|
||||
github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM=
|
||||
github.com/coinbase/rosetta-sdk-go/types v1.0.0 h1:jpVIwLcPoOeCR6o1tU+Xv7r5bMONNbHU7MuEHboiFuA=
|
||||
github.com/coinbase/rosetta-sdk-go/types v1.0.0/go.mod h1:eq7W2TMRH22GTW0N0beDnN931DW0/WOI1R2sdHNHG4c=
|
||||
github.com/cometbft/cometbft v0.37.1 h1:KLxkQTK2hICXYq21U2hn1W5hOVYUdQgDQ1uB+90xPIg=
|
||||
github.com/cometbft/cometbft v0.37.1/go.mod h1:Y2MMMN//O5K4YKd8ze4r9jmk4Y7h0ajqILXbH5JQFVs=
|
||||
github.com/cometbft/cometbft v0.38.0-alpha.2 h1:iorYtE7u4kBgSe4JtruHsGR1RNSdVlrDwGOYKZ7h3zs=
|
||||
github.com/cometbft/cometbft v0.38.0-alpha.2/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k=
|
||||
github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo=
|
||||
github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0=
|
||||
github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg=
|
||||
@ -345,7 +341,6 @@ github.com/cosmos/cosmos-db v1.0.0-rc.1 h1:SjnT8B6WKMW9WEIX32qMhnEEKcI7ZP0+G1Sa9
|
||||
github.com/cosmos/cosmos-db v1.0.0-rc.1/go.mod h1:Dnmk3flSf5lkwCqvvjNpoxjpXzhxnCAFzKHlbaForso=
|
||||
github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o=
|
||||
github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I=
|
||||
github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y=
|
||||
github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY=
|
||||
github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw=
|
||||
github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE=
|
||||
@ -368,8 +363,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||
github.com/creachadair/atomicfile v0.3.0 h1:4HvescJCWkiLOqHkhtCeNAY4+8DVyYkQgwBDyAAvDWI=
|
||||
github.com/creachadair/atomicfile v0.3.0/go.mod h1:mwfrkRxFKwpNAflYZzytbSwxvbK6fdGRRlp0KEQc0qU=
|
||||
github.com/creachadair/taskgroup v0.4.2 h1:jsBLdAJE42asreGss2xZGZ8fJra7WtwnHWeJFxv2Li8=
|
||||
github.com/creachadair/taskgroup v0.4.2/go.mod h1:qiXUOSrbwAY3u0JPGTzObbE3yf9hcXHDKBZ2ZjpCbgM=
|
||||
github.com/creachadair/tomledit v0.0.24 h1:5Xjr25R2esu1rKCbQEmjZYlrhFkDspoAbAKb6QKQDhQ=
|
||||
github.com/creachadair/tomledit v0.0.24/go.mod h1:9qHbShRWQzSCcn617cMzg4eab1vbLCOjOshAWSzWr8U=
|
||||
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
|
||||
@ -490,7 +483,7 @@ github.com/goccy/go-json v0.10.0/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MG
|
||||
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0=
|
||||
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4=
|
||||
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||
github.com/gofrs/uuid v4.3.0+incompatible h1:CaSVZxm5B+7o45rtab4jC2G37WGYX1zQfuU2i6DSvnc=
|
||||
github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA=
|
||||
github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s=
|
||||
github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s=
|
||||
github.com/gogo/googleapis v1.4.1-0.20201022092350-68b0159b7869/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c=
|
||||
@ -640,11 +633,6 @@ github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
|
||||
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU=
|
||||
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0=
|
||||
github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s=
|
||||
github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is=
|
||||
github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s=
|
||||
github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uMzcc=
|
||||
github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIvY4OmlYW69o=
|
||||
github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE=
|
||||
github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8=
|
||||
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
@ -815,9 +803,6 @@ github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfr
|
||||
github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8=
|
||||
github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc=
|
||||
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
|
||||
github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM=
|
||||
github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 h1:QRUSJEgZn2Snx0EmT/QLXibWjSUDjKWvXIT19NBVp94=
|
||||
github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM=
|
||||
github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g=
|
||||
github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY=
|
||||
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
|
||||
@ -857,6 +842,8 @@ github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OS
|
||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
|
||||
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
|
||||
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
|
||||
github.com/oasisprotocol/curve25519-voi v0.0.0-20220708102147-0a8a51822cae h1:FatpGJD2jmJfhZiFDElaC0QhZUDQnxUeAwTGkfAHN3I=
|
||||
github.com/oasisprotocol/curve25519-voi v0.0.0-20220708102147-0a8a51822cae/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s=
|
||||
github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs=
|
||||
github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
|
||||
github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA=
|
||||
@ -866,8 +853,8 @@ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W
|
||||
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
|
||||
github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA=
|
||||
github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY=
|
||||
github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc=
|
||||
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
|
||||
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
|
||||
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
|
||||
@ -1115,7 +1102,6 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U
|
||||
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
@ -1165,7 +1151,7 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||
golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8=
|
||||
golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs=
|
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
@ -1475,7 +1461,7 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||
golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||
golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM=
|
||||
golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
|
||||
@ -288,7 +288,7 @@ func TestAppSimulationAfterImport(t *testing.T) {
|
||||
newApp := NewSimApp(log.NewNopLogger(), newDB, nil, true, appOptions, fauxMerkleModeOpt, baseapp.SetChainID(SimAppChainID))
|
||||
require.Equal(t, "SimApp", newApp.Name())
|
||||
|
||||
newApp.InitChain(abci.RequestInitChain{
|
||||
newApp.InitChain(&abci.RequestInitChain{
|
||||
AppStateBytes: exported.AppState,
|
||||
ChainId: SimAppChainID,
|
||||
})
|
||||
|
||||
@ -10,7 +10,6 @@ import (
|
||||
sdkmath "cosmossdk.io/math"
|
||||
abci "github.com/cometbft/cometbft/abci/types"
|
||||
cmtjson "github.com/cometbft/cometbft/libs/json"
|
||||
cmtproto "github.com/cometbft/cometbft/proto/tendermint/types"
|
||||
cmttypes "github.com/cometbft/cometbft/types"
|
||||
dbm "github.com/cosmos/cosmos-db"
|
||||
"github.com/stretchr/testify/require"
|
||||
@ -83,13 +82,12 @@ func NewSimappWithCustomOptions(t *testing.T, isCheckTx bool, options SetupOptio
|
||||
require.NoError(t, err)
|
||||
|
||||
// Initialize the chain
|
||||
app.InitChain(
|
||||
abci.RequestInitChain{
|
||||
Validators: []abci.ValidatorUpdate{},
|
||||
ConsensusParams: simtestutil.DefaultConsensusParams,
|
||||
AppStateBytes: stateBytes,
|
||||
},
|
||||
)
|
||||
_, err = app.InitChain(&abci.RequestInitChain{
|
||||
Validators: []abci.ValidatorUpdate{},
|
||||
ConsensusParams: simtestutil.DefaultConsensusParams,
|
||||
AppStateBytes: stateBytes,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
return app
|
||||
@ -135,22 +133,21 @@ func SetupWithGenesisValSet(t *testing.T, valSet *cmttypes.ValidatorSet, genAccs
|
||||
require.NoError(t, err)
|
||||
|
||||
// init chain will set the validator set and initialize the genesis accounts
|
||||
app.InitChain(
|
||||
abci.RequestInitChain{
|
||||
Validators: []abci.ValidatorUpdate{},
|
||||
ConsensusParams: simtestutil.DefaultConsensusParams,
|
||||
AppStateBytes: stateBytes,
|
||||
},
|
||||
_, err = app.InitChain(&abci.RequestInitChain{
|
||||
Validators: []abci.ValidatorUpdate{},
|
||||
ConsensusParams: simtestutil.DefaultConsensusParams,
|
||||
AppStateBytes: stateBytes,
|
||||
},
|
||||
)
|
||||
require.NoError(t, err)
|
||||
|
||||
// commit genesis changes
|
||||
app.Commit()
|
||||
app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{
|
||||
require.NoError(t, err)
|
||||
_, err = app.FinalizeBlock(&abci.RequestFinalizeBlock{
|
||||
Height: app.LastBlockHeight() + 1,
|
||||
AppHash: app.LastCommitID().Hash,
|
||||
ValidatorsHash: valSet.Hash(),
|
||||
Hash: app.LastCommitID().Hash,
|
||||
NextValidatorsHash: valSet.Hash(),
|
||||
}})
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
return app
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@ require (
|
||||
cosmossdk.io/log v1.1.0
|
||||
cosmossdk.io/math v1.0.1
|
||||
github.com/armon/go-metrics v0.4.1
|
||||
github.com/cometbft/cometbft v0.37.1
|
||||
github.com/cometbft/cometbft v0.38.0-alpha.1
|
||||
github.com/cosmos/cosmos-db v1.0.0-rc.1
|
||||
github.com/cosmos/gogoproto v1.4.10
|
||||
github.com/cosmos/iavl v0.21.0
|
||||
@ -39,7 +39,6 @@ require (
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
|
||||
github.com/fatih/color v1.15.0 // indirect
|
||||
github.com/fsnotify/fsnotify v1.6.0 // indirect
|
||||
github.com/getsentry/sentry-go v0.18.0 // indirect
|
||||
github.com/gogo/protobuf v1.3.2 // indirect
|
||||
github.com/golang/snappy v0.0.4 // indirect
|
||||
@ -57,6 +56,7 @@ require (
|
||||
github.com/mattn/go-isatty v0.0.19 // indirect
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
|
||||
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
|
||||
github.com/oasisprotocol/curve25519-voi v0.0.0-20220708102147-0a8a51822cae // indirect
|
||||
github.com/oklog/run v1.1.0 // indirect
|
||||
github.com/onsi/gomega v1.20.0 // indirect
|
||||
github.com/petermattis/goid v0.0.0-20221215004737-a150e88a970d // indirect
|
||||
|
||||
12
store/go.sum
12
store/go.sum
@ -29,9 +29,9 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
|
||||
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
|
||||
github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U=
|
||||
github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04=
|
||||
github.com/btcsuite/btcd/btcutil v1.1.2 h1:XLMbX8JQEiwMcYft2EGi8zPUkoa0abKIU6/BJSRsjzQ=
|
||||
github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ=
|
||||
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U=
|
||||
github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA=
|
||||
github.com/bufbuild/protocompile v0.5.1 h1:mixz5lJX4Hiz4FpqFREJHIXLfaLBntfaJv1h+/jS+Qg=
|
||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
|
||||
@ -55,8 +55,8 @@ github.com/cockroachdb/pebble v0.0.0-20230226194802-02d779ffbc46/go.mod h1:9lRMC
|
||||
github.com/cockroachdb/redact v1.1.3 h1:AKZds10rFSIj7qADf0g46UixK8NNLwWTNdCIGS5wfSQ=
|
||||
github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg=
|
||||
github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM=
|
||||
github.com/cometbft/cometbft v0.37.1 h1:KLxkQTK2hICXYq21U2hn1W5hOVYUdQgDQ1uB+90xPIg=
|
||||
github.com/cometbft/cometbft v0.37.1/go.mod h1:Y2MMMN//O5K4YKd8ze4r9jmk4Y7h0ajqILXbH5JQFVs=
|
||||
github.com/cometbft/cometbft v0.38.0-alpha.1 h1:BmDIGG49GeSpx4BXtyGqIfTkTUDXFHgvfaFNGETGH0o=
|
||||
github.com/cometbft/cometbft v0.38.0-alpha.1/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k=
|
||||
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
|
||||
github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk=
|
||||
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
|
||||
@ -96,7 +96,6 @@ github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMo
|
||||
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
|
||||
github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU=
|
||||
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
|
||||
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
|
||||
github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc=
|
||||
github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c=
|
||||
github.com/getsentry/sentry-go v0.18.0 h1:MtBW5H9QgdcJabtZcuJG80BMOwaBpkRDZkxRkNC1sN0=
|
||||
@ -263,6 +262,8 @@ github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OS
|
||||
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
|
||||
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
|
||||
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
|
||||
github.com/oasisprotocol/curve25519-voi v0.0.0-20220708102147-0a8a51822cae h1:FatpGJD2jmJfhZiFDElaC0QhZUDQnxUeAwTGkfAHN3I=
|
||||
github.com/oasisprotocol/curve25519-voi v0.0.0-20220708102147-0a8a51822cae/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s=
|
||||
github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA=
|
||||
github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU=
|
||||
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
@ -470,7 +471,6 @@ golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBc
|
||||
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU=
|
||||
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
|
||||
@ -304,7 +304,7 @@ func (st *Store) Import(version int64) (*iavl.Importer, error) {
|
||||
}
|
||||
|
||||
// Handle gatest the latest height, if height is 0
|
||||
func getHeight(tree Tree, req abci.RequestQuery) int64 {
|
||||
func getHeight(tree Tree, req *abci.RequestQuery) int64 {
|
||||
height := req.Height
|
||||
if height == 0 {
|
||||
latest := tree.Version()
|
||||
@ -324,7 +324,7 @@ func getHeight(tree Tree, req abci.RequestQuery) int64 {
|
||||
// If latest-1 is not present, use latest (which must be present)
|
||||
// if you care to have the latest data to see a tx results, you must
|
||||
// explicitly set the height you want to see
|
||||
func (st *Store) Query(req abci.RequestQuery) (res abci.ResponseQuery) {
|
||||
func (st *Store) Query(req *abci.RequestQuery) (res *abci.ResponseQuery) {
|
||||
defer st.metrics.MeasureSince("store", "iavl", "query")
|
||||
|
||||
if len(req.Data) == 0 {
|
||||
@ -335,7 +335,9 @@ func (st *Store) Query(req abci.RequestQuery) (res abci.ResponseQuery) {
|
||||
|
||||
// store the height we chose in the response, with 0 being changed to the
|
||||
// latest height
|
||||
res.Height = getHeight(tree, req)
|
||||
res = &abci.ResponseQuery{
|
||||
Height: getHeight(tree, req),
|
||||
}
|
||||
|
||||
switch req.Path {
|
||||
case "/key": // get by key
|
||||
|
||||
@ -138,7 +138,7 @@ func TestGetImmutable(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, newStore.Get([]byte("hello")), []byte("adios"))
|
||||
|
||||
res := newStore.Query(abci.RequestQuery{Data: []byte("hello"), Height: cID.Version, Path: "/key", Prove: true})
|
||||
res := newStore.Query(&abci.RequestQuery{Data: []byte("hello"), Height: cID.Version, Path: "/key", Prove: true})
|
||||
require.Equal(t, res.Value, []byte("adios"))
|
||||
require.NotNil(t, res.ProofOps)
|
||||
|
||||
@ -505,7 +505,7 @@ func TestIAVLStoreQuery(t *testing.T) {
|
||||
querySub := abci.RequestQuery{Path: "/subspace", Data: ksub, Height: ver}
|
||||
|
||||
// query subspace before anything set
|
||||
qres := iavlStore.Query(querySub)
|
||||
qres := iavlStore.Query(&querySub)
|
||||
require.Equal(t, uint32(0), qres.Code)
|
||||
require.Equal(t, valExpSubEmpty, qres.Value)
|
||||
|
||||
@ -514,24 +514,24 @@ func TestIAVLStoreQuery(t *testing.T) {
|
||||
iavlStore.Set(k2, v2)
|
||||
|
||||
// set data without commit, doesn't show up
|
||||
qres = iavlStore.Query(query)
|
||||
qres = iavlStore.Query(&query)
|
||||
require.Equal(t, uint32(0), qres.Code)
|
||||
require.Nil(t, qres.Value)
|
||||
|
||||
// commit it, but still don't see on old version
|
||||
cid = iavlStore.Commit()
|
||||
qres = iavlStore.Query(query)
|
||||
qres = iavlStore.Query(&query)
|
||||
require.Equal(t, uint32(0), qres.Code)
|
||||
require.Nil(t, qres.Value)
|
||||
|
||||
// but yes on the new version
|
||||
query.Height = cid.Version
|
||||
qres = iavlStore.Query(query)
|
||||
qres = iavlStore.Query(&query)
|
||||
require.Equal(t, uint32(0), qres.Code)
|
||||
require.Equal(t, v1, qres.Value)
|
||||
|
||||
// and for the subspace
|
||||
qres = iavlStore.Query(querySub)
|
||||
qres = iavlStore.Query(&querySub)
|
||||
require.Equal(t, uint32(0), qres.Code)
|
||||
require.Equal(t, valExpSub1, qres.Value)
|
||||
|
||||
@ -540,28 +540,28 @@ func TestIAVLStoreQuery(t *testing.T) {
|
||||
cid = iavlStore.Commit()
|
||||
|
||||
// query will return old values, as height is fixed
|
||||
qres = iavlStore.Query(query)
|
||||
qres = iavlStore.Query(&query)
|
||||
require.Equal(t, uint32(0), qres.Code)
|
||||
require.Equal(t, v1, qres.Value)
|
||||
|
||||
// update to latest in the query and we are happy
|
||||
query.Height = cid.Version
|
||||
qres = iavlStore.Query(query)
|
||||
qres = iavlStore.Query(&query)
|
||||
require.Equal(t, uint32(0), qres.Code)
|
||||
require.Equal(t, v3, qres.Value)
|
||||
query2 := abci.RequestQuery{Path: "/key", Data: k2, Height: cid.Version}
|
||||
|
||||
qres = iavlStore.Query(query2)
|
||||
qres = iavlStore.Query(&query2)
|
||||
require.Equal(t, uint32(0), qres.Code)
|
||||
require.Equal(t, v2, qres.Value)
|
||||
// and for the subspace
|
||||
qres = iavlStore.Query(querySub)
|
||||
qres = iavlStore.Query(&querySub)
|
||||
require.Equal(t, uint32(0), qres.Code)
|
||||
require.Equal(t, valExpSub2, qres.Value)
|
||||
|
||||
// default (height 0) will show latest -1
|
||||
query0 := abci.RequestQuery{Path: "/key", Data: k1}
|
||||
qres = iavlStore.Query(query0)
|
||||
qres = iavlStore.Query(&query0)
|
||||
require.Equal(t, uint32(0), qres.Code)
|
||||
require.Equal(t, v1, qres.Value)
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@ func TestVerifyIAVLStoreQueryProof(t *testing.T) {
|
||||
cid := store.Commit()
|
||||
|
||||
// Get Proof
|
||||
res := store.Query(abci.RequestQuery{
|
||||
res := store.Query(&abci.RequestQuery{
|
||||
Path: "/key", // required path to get key/value+proof
|
||||
Data: []byte("MYKEY"),
|
||||
Prove: true,
|
||||
@ -70,7 +70,7 @@ func TestVerifyMultiStoreQueryProof(t *testing.T) {
|
||||
cid := store.Commit()
|
||||
|
||||
// Get Proof
|
||||
res := store.Query(abci.RequestQuery{
|
||||
res := store.Query(&abci.RequestQuery{
|
||||
Path: "/iavlStoreKey/key", // required path to get key/value+proof
|
||||
Data: []byte("MYKEY"),
|
||||
Prove: true,
|
||||
@ -126,7 +126,7 @@ func TestVerifyMultiStoreQueryProofAbsence(t *testing.T) {
|
||||
cid := store.Commit() // Commit with empty iavl store.
|
||||
|
||||
// Get Proof
|
||||
res := store.Query(abci.RequestQuery{
|
||||
res := store.Query(&abci.RequestQuery{
|
||||
Path: "/iavlStoreKey/key", // required path to get key/value+proof
|
||||
Data: []byte("MYABSENTKEY"),
|
||||
Prove: true,
|
||||
|
||||
@ -726,7 +726,7 @@ func (rs *Store) GetStoreByName(name string) types.Store {
|
||||
// modified to remove the substore prefix.
|
||||
// Ie. `req.Path` here is `/<substore>/<path>`, and trimmed to `/<path>` for the substore.
|
||||
// TODO: add proof for `multistore -> substore`.
|
||||
func (rs *Store) Query(req abci.RequestQuery) abci.ResponseQuery {
|
||||
func (rs *Store) Query(req *abci.RequestQuery) *abci.ResponseQuery {
|
||||
path := req.Path
|
||||
storeName, subpath, err := parsePath(path)
|
||||
if err != nil {
|
||||
|
||||
@ -457,37 +457,39 @@ func TestMultiStoreQuery(t *testing.T) {
|
||||
|
||||
// Test bad path.
|
||||
query := abci.RequestQuery{Path: "/key", Data: k, Height: ver}
|
||||
qres := multi.Query(query)
|
||||
qres := multi.Query(&query)
|
||||
require.EqualValues(t, types.ErrUnknownRequest.ABCICode(), qres.Code)
|
||||
require.EqualValues(t, types.ErrUnknownRequest.Codespace(), qres.Codespace)
|
||||
|
||||
query.Path = "h897fy32890rf63296r92"
|
||||
qres = multi.Query(query)
|
||||
qres = multi.Query(&query)
|
||||
require.EqualValues(t, types.ErrUnknownRequest.ABCICode(), qres.Code)
|
||||
require.EqualValues(t, types.ErrUnknownRequest.Codespace(), qres.Codespace)
|
||||
|
||||
// Test invalid store name.
|
||||
query.Path = "/garbage/key"
|
||||
qres = multi.Query(query)
|
||||
qres = multi.Query(&query)
|
||||
require.EqualValues(t, types.ErrUnknownRequest.ABCICode(), qres.Code)
|
||||
require.EqualValues(t, types.ErrUnknownRequest.Codespace(), qres.Codespace)
|
||||
|
||||
// Test valid query with data.
|
||||
query.Path = "/store1/key"
|
||||
qres = multi.Query(query)
|
||||
qres = multi.Query(&query)
|
||||
require.EqualValues(t, 0, qres.Code)
|
||||
require.Equal(t, v, qres.Value)
|
||||
|
||||
// Test valid but empty query.
|
||||
query.Path = "/store2/key"
|
||||
query.Prove = true
|
||||
qres = multi.Query(query)
|
||||
qres = multi.Query(&query)
|
||||
require.EqualValues(t, 0, qres.Code)
|
||||
require.Nil(t, qres.Value)
|
||||
|
||||
// Test store2 data.
|
||||
// Since we are using the request as a reference, the path will be modified.
|
||||
query.Data = k2
|
||||
qres = multi.Query(query)
|
||||
query.Path = "/store2/key"
|
||||
qres = multi.Query(&query)
|
||||
require.EqualValues(t, 0, qres.Code)
|
||||
require.Equal(t, v2, qres.Value)
|
||||
}
|
||||
|
||||
@ -43,38 +43,13 @@ func (a *FilePlugin) writeToFile(file string, data []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (a *FilePlugin) ListenBeginBlock(ctx context.Context, req abci.RequestBeginBlock, res abci.ResponseBeginBlock) error {
|
||||
a.BlockHeight = req.Header.Height
|
||||
d1 := []byte(fmt.Sprintf("%d:::%v\n", a.BlockHeight, req))
|
||||
d2 := []byte(fmt.Sprintf("%d:::%v\n", a.BlockHeight, res))
|
||||
if err := a.writeToFile("begin-block-req", d1); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := a.writeToFile("begin-block-res", d2); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (a *FilePlugin) ListenEndBlock(ctx context.Context, req abci.RequestEndBlock, res abci.ResponseEndBlock) error {
|
||||
func (a *FilePlugin) ListenFinalizeBlock(ctx context.Context, req abci.RequestFinalizeBlock, res abci.ResponseFinalizeBlock) error {
|
||||
d1 := []byte(fmt.Sprintf("%d:::%v\n", a.BlockHeight, req))
|
||||
d2 := []byte(fmt.Sprintf("%d:::%v\n", a.BlockHeight, req))
|
||||
if err := a.writeToFile("end-block-req", d1); err != nil {
|
||||
if err := a.writeToFile("finalize-block-req", d1); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := a.writeToFile("end-block-res", d2); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (a *FilePlugin) ListenDeliverTx(ctx context.Context, req abci.RequestDeliverTx, res abci.ResponseDeliverTx) error {
|
||||
d1 := []byte(fmt.Sprintf("%d:::%v\n", a.BlockHeight, req))
|
||||
d2 := []byte(fmt.Sprintf("%d:::%v\n", a.BlockHeight, res))
|
||||
if err := a.writeToFile("deliver-tx-req", d1); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := a.writeToFile("deliver-tx-res", d2); err != nil {
|
||||
if err := a.writeToFile("finalize-block-res", d2); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
|
||||
Binary file not shown.
@ -17,22 +17,10 @@ type StdoutPlugin struct {
|
||||
BlockHeight int64
|
||||
}
|
||||
|
||||
func (a *StdoutPlugin) ListenBeginBlock(ctx context.Context, req abci.RequestBeginBlock, res abci.ResponseBeginBlock) error {
|
||||
a.BlockHeight = req.Header.Height
|
||||
func (a *StdoutPlugin) ListenFinalizeBlock(ctx context.Context, req abci.RequestFinalizeBlock, res abci.ResponseFinalizeBlock) error {
|
||||
a.BlockHeight = req.Height
|
||||
// process tx messages (i.e: sent to external system)
|
||||
fmt.Printf("listen-begin-block: block-height=%d req=%v res=%v", a.BlockHeight, req, res)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (a *StdoutPlugin) ListenEndBlock(ctx context.Context, req abci.RequestEndBlock, res abci.ResponseEndBlock) error {
|
||||
// process end block messages (i.e: sent to external system)
|
||||
fmt.Printf("listen-end-block: block-height=%d req=%v res=%v", a.BlockHeight, req, res)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (a *StdoutPlugin) ListenDeliverTx(ctx context.Context, req abci.RequestDeliverTx, res abci.ResponseDeliverTx) error {
|
||||
// process tx messages (i.e: sent to external system)
|
||||
fmt.Printf("listen-deliver-tx: block-height=%d req=%v res=%v", a.BlockHeight, req, res)
|
||||
fmt.Printf("listen-finalize-block: block-height=%d req=%v res=%v", a.BlockHeight, req, res)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@ -17,52 +17,18 @@ type GRPCClient struct {
|
||||
client ABCIListenerServiceClient
|
||||
}
|
||||
|
||||
// ListenBeginBlock listens to begin block request and responses.
|
||||
// In addition, it retrieves a types.Context from a context.Context instance.
|
||||
// It panics if a types.Context was not properly attached.
|
||||
// When the node is configured to stop on listening errors,
|
||||
// it will terminate immediately and exit with a non-zero code.
|
||||
func (m *GRPCClient) ListenBeginBlock(goCtx context.Context, req abci.RequestBeginBlock, res abci.ResponseBeginBlock) error {
|
||||
ctx := goCtx.(storetypes.Context)
|
||||
sm := ctx.StreamingManager()
|
||||
request := &ListenBeginBlockRequest{Req: &req, Res: &res}
|
||||
_, err := m.client.ListenBeginBlock(goCtx, request)
|
||||
if err != nil && sm.StopNodeOnErr {
|
||||
ctx.Logger().Error("BeginBlock listening hook failed", "height", ctx.BlockHeight(), "err", err)
|
||||
cleanupAndExit()
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// ListenEndBlock listens to end block request and responses.
|
||||
// In addition, it retrieves a types.Context from a context.Context instance.
|
||||
// It panics if a types.Context was not properly attached.
|
||||
// When the node is configured to stop on listening errors,
|
||||
// it will terminate immediately and exit with a non-zero code.
|
||||
func (m *GRPCClient) ListenEndBlock(goCtx context.Context, req abci.RequestEndBlock, res abci.ResponseEndBlock) error {
|
||||
func (m *GRPCClient) ListenFinalizeBlock(goCtx context.Context, req abci.RequestFinalizeBlock, res abci.ResponseFinalizeBlock) error {
|
||||
ctx := goCtx.(storetypes.Context)
|
||||
sm := ctx.StreamingManager()
|
||||
request := &ListenEndBlockRequest{Req: &req, Res: &res}
|
||||
_, err := m.client.ListenEndBlock(goCtx, request)
|
||||
request := &ListenFinalizeBlockRequest{Req: &req, Res: &res}
|
||||
_, err := m.client.ListenFinalizeBlock(goCtx, request)
|
||||
if err != nil && sm.StopNodeOnErr {
|
||||
ctx.Logger().Error("EndBlock listening hook failed", "height", ctx.BlockHeight(), "err", err)
|
||||
cleanupAndExit()
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// ListenDeliverTx listens to deliver tx request and responses.
|
||||
// In addition, it retrieves a types.Context from a context.Context instance.
|
||||
// It panics if a types.Context was not properly attached.
|
||||
// When the node is configured to stop on listening errors,
|
||||
// it will terminate immediately and exit with a non-zero code.
|
||||
func (m *GRPCClient) ListenDeliverTx(goCtx context.Context, req abci.RequestDeliverTx, res abci.ResponseDeliverTx) error {
|
||||
ctx := goCtx.(storetypes.Context)
|
||||
sm := ctx.StreamingManager()
|
||||
request := &ListenDeliverTxRequest{BlockHeight: ctx.BlockHeight(), Req: &req, Res: &res}
|
||||
_, err := m.client.ListenDeliverTx(goCtx, request)
|
||||
if err != nil && sm.StopNodeOnErr {
|
||||
ctx.Logger().Error("DeliverTx listening hook failed", "height", ctx.BlockHeight(), "err", err)
|
||||
ctx.Logger().Error("FinalizeBlock listening hook failed", "height", ctx.BlockHeight(), "err", err)
|
||||
cleanupAndExit()
|
||||
}
|
||||
return err
|
||||
@ -98,25 +64,11 @@ type GRPCServer struct {
|
||||
Impl storetypes.ABCIListener
|
||||
}
|
||||
|
||||
func (m GRPCServer) ListenBeginBlock(ctx context.Context, request *ListenBeginBlockRequest) (*ListenBeginBlockResponse, error) {
|
||||
if err := m.Impl.ListenBeginBlock(ctx, *request.Req, *request.Res); err != nil {
|
||||
func (m GRPCServer) ListenFinalizeBlock(ctx context.Context, request *ListenFinalizeBlockRequest) (*ListenFinalizeBlockResponse, error) {
|
||||
if err := m.Impl.ListenFinalizeBlock(ctx, *request.Req, *request.Res); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &ListenBeginBlockResponse{}, nil
|
||||
}
|
||||
|
||||
func (m GRPCServer) ListenEndBlock(ctx context.Context, request *ListenEndBlockRequest) (*ListenEndBlockResponse, error) {
|
||||
if err := m.Impl.ListenEndBlock(ctx, *request.Req, *request.Res); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &ListenEndBlockResponse{}, nil
|
||||
}
|
||||
|
||||
func (m GRPCServer) ListenDeliverTx(ctx context.Context, request *ListenDeliverTxRequest) (*ListenDeliverTxResponse, error) {
|
||||
if err := m.Impl.ListenDeliverTx(ctx, *request.Req, *request.Res); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &ListenDeliverTxResponse{}, nil
|
||||
return &ListenFinalizeBlockResponse{}, nil
|
||||
}
|
||||
|
||||
func (m GRPCServer) ListenCommit(ctx context.Context, request *ListenCommitRequest) (*ListenCommitResponse, error) {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -27,13 +27,9 @@ type PluginTestSuite struct {
|
||||
|
||||
workDir string
|
||||
|
||||
beginBlockReq abci.RequestBeginBlock
|
||||
beginBlockRes abci.ResponseBeginBlock
|
||||
endBlockReq abci.RequestEndBlock
|
||||
endBlockRes abci.ResponseEndBlock
|
||||
deliverTxReq abci.RequestDeliverTx
|
||||
deliverTxRes abci.ResponseDeliverTx
|
||||
commitRes abci.ResponseCommit
|
||||
finalizeBlockReq abci.RequestFinalizeBlock
|
||||
finalizeBlockRes abci.ResponseFinalizeBlock
|
||||
commitRes abci.ResponseCommit
|
||||
|
||||
changeSet []*storetypes.StoreKVPair
|
||||
}
|
||||
@ -71,33 +67,28 @@ func (s *PluginTestSuite) SetupTest() {
|
||||
s.loggerCtx = NewMockContext(header, logger, streamingService)
|
||||
|
||||
// test abci message types
|
||||
s.beginBlockReq = abci.RequestBeginBlock{
|
||||
Header: s.loggerCtx.BlockHeader(),
|
||||
ByzantineValidators: []abci.Misbehavior{},
|
||||
Hash: []byte{1, 2, 3, 4, 5, 6, 7, 8, 9},
|
||||
LastCommitInfo: abci.CommitInfo{Round: 1, Votes: []abci.VoteInfo{}},
|
||||
|
||||
s.finalizeBlockReq = abci.RequestFinalizeBlock{
|
||||
Height: s.loggerCtx.BlockHeight(),
|
||||
Txs: [][]byte{{1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}},
|
||||
Misbehavior: []abci.Misbehavior{},
|
||||
Hash: []byte{1, 2, 3, 4, 5, 6, 7, 8, 9},
|
||||
DecidedLastCommit: abci.CommitInfo{},
|
||||
}
|
||||
s.beginBlockRes = abci.ResponseBeginBlock{
|
||||
Events: []abci.Event{{Type: "testEventType1"}},
|
||||
}
|
||||
s.endBlockReq = abci.RequestEndBlock{Height: s.loggerCtx.BlockHeight()}
|
||||
s.endBlockRes = abci.ResponseEndBlock{
|
||||
s.finalizeBlockRes = abci.ResponseFinalizeBlock{
|
||||
Events: []abci.Event{},
|
||||
ConsensusParamUpdates: &tmproto.ConsensusParams{},
|
||||
ValidatorUpdates: []abci.ValidatorUpdate{},
|
||||
}
|
||||
s.deliverTxReq = abci.RequestDeliverTx{
|
||||
Tx: []byte{9, 8, 7, 6, 5, 4, 3, 2, 1},
|
||||
}
|
||||
s.deliverTxRes = abci.ResponseDeliverTx{
|
||||
Events: []abci.Event{},
|
||||
Code: 1,
|
||||
Codespace: "mockCodeSpace",
|
||||
Data: []byte{5, 6, 7, 8},
|
||||
GasUsed: 2,
|
||||
GasWanted: 3,
|
||||
Info: "mockInfo",
|
||||
Log: "mockLog",
|
||||
TxResults: []*abci.ExecTxResult{{
|
||||
Events: []abci.Event{},
|
||||
Code: 1,
|
||||
Codespace: "mockCodeSpace",
|
||||
Data: []byte{5, 6, 7, 8},
|
||||
GasUsed: 2,
|
||||
GasWanted: 3,
|
||||
Info: "mockInfo",
|
||||
Log: "mockLog",
|
||||
}},
|
||||
}
|
||||
s.commitRes = abci.ResponseCommit{}
|
||||
|
||||
@ -121,17 +112,10 @@ func (s *PluginTestSuite) TestABCIGRPCPlugin() {
|
||||
abciListeners := s.loggerCtx.StreamingManager().ABCIListeners
|
||||
for _, abciListener := range abciListeners {
|
||||
for i := range [50]int{} {
|
||||
err := abciListener.ListenBeginBlock(s.loggerCtx, s.beginBlockReq, s.beginBlockRes)
|
||||
assert.NoError(t, err, "ListenBeginBlock")
|
||||
|
||||
err = abciListener.ListenEndBlock(s.loggerCtx, s.endBlockReq, s.endBlockRes)
|
||||
err := abciListener.ListenFinalizeBlock(s.loggerCtx, s.finalizeBlockReq, s.finalizeBlockRes)
|
||||
assert.NoError(t, err, "ListenEndBlock")
|
||||
|
||||
for range [50]int{} {
|
||||
err = abciListener.ListenDeliverTx(s.loggerCtx, s.deliverTxReq, s.deliverTxRes)
|
||||
assert.NoError(t, err, "ListenDeliverTx")
|
||||
}
|
||||
|
||||
err = abciListener.ListenCommit(s.loggerCtx, s.commitRes, s.changeSet)
|
||||
assert.NoError(t, err, "ListenCommit")
|
||||
|
||||
|
||||
@ -32,9 +32,9 @@ var (
|
||||
|
||||
// QueryResult returns a ResponseQuery from an error. It will try to parse ABCI
|
||||
// info from the error.
|
||||
func QueryResult(err error, debug bool) abci.ResponseQuery {
|
||||
func QueryResult(err error, debug bool) *abci.ResponseQuery {
|
||||
space, code, log := errors.ABCIInfo(err, debug)
|
||||
return abci.ResponseQuery{
|
||||
return &abci.ResponseQuery{
|
||||
Codespace: space,
|
||||
Code: code,
|
||||
Log: log,
|
||||
|
||||
@ -99,12 +99,9 @@ func (m *StoreKVPair) GetValue() []byte {
|
||||
// BlockMetadata contains all the abci event data of a block
|
||||
// the file streamer dump them into files together with the state changes.
|
||||
type BlockMetadata struct {
|
||||
RequestBeginBlock *types.RequestBeginBlock `protobuf:"bytes,1,opt,name=request_begin_block,json=requestBeginBlock,proto3" json:"request_begin_block,omitempty"`
|
||||
ResponseBeginBlock *types.ResponseBeginBlock `protobuf:"bytes,2,opt,name=response_begin_block,json=responseBeginBlock,proto3" json:"response_begin_block,omitempty"`
|
||||
DeliverTxs []*BlockMetadata_DeliverTx `protobuf:"bytes,3,rep,name=deliver_txs,json=deliverTxs,proto3" json:"deliver_txs,omitempty"`
|
||||
RequestEndBlock *types.RequestEndBlock `protobuf:"bytes,4,opt,name=request_end_block,json=requestEndBlock,proto3" json:"request_end_block,omitempty"`
|
||||
ResponseEndBlock *types.ResponseEndBlock `protobuf:"bytes,5,opt,name=response_end_block,json=responseEndBlock,proto3" json:"response_end_block,omitempty"`
|
||||
ResponseCommit *types.ResponseCommit `protobuf:"bytes,6,opt,name=response_commit,json=responseCommit,proto3" json:"response_commit,omitempty"`
|
||||
ResponseCommit *types.ResponseCommit `protobuf:"bytes,6,opt,name=response_commit,json=responseCommit,proto3" json:"response_commit,omitempty"`
|
||||
RequestFinalizeBlock *types.RequestFinalizeBlock `protobuf:"bytes,7,opt,name=request_finalize_block,json=requestFinalizeBlock,proto3" json:"request_finalize_block,omitempty"`
|
||||
ResponseFinalizeBlock *types.ResponseFinalizeBlock `protobuf:"bytes,8,opt,name=response_finalize_block,json=responseFinalizeBlock,proto3" json:"response_finalize_block,omitempty"`
|
||||
}
|
||||
|
||||
func (m *BlockMetadata) Reset() { *m = BlockMetadata{} }
|
||||
@ -140,41 +137,6 @@ func (m *BlockMetadata) XXX_DiscardUnknown() {
|
||||
|
||||
var xxx_messageInfo_BlockMetadata proto.InternalMessageInfo
|
||||
|
||||
func (m *BlockMetadata) GetRequestBeginBlock() *types.RequestBeginBlock {
|
||||
if m != nil {
|
||||
return m.RequestBeginBlock
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *BlockMetadata) GetResponseBeginBlock() *types.ResponseBeginBlock {
|
||||
if m != nil {
|
||||
return m.ResponseBeginBlock
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *BlockMetadata) GetDeliverTxs() []*BlockMetadata_DeliverTx {
|
||||
if m != nil {
|
||||
return m.DeliverTxs
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *BlockMetadata) GetRequestEndBlock() *types.RequestEndBlock {
|
||||
if m != nil {
|
||||
return m.RequestEndBlock
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *BlockMetadata) GetResponseEndBlock() *types.ResponseEndBlock {
|
||||
if m != nil {
|
||||
return m.ResponseEndBlock
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *BlockMetadata) GetResponseCommit() *types.ResponseCommit {
|
||||
if m != nil {
|
||||
return m.ResponseCommit
|
||||
@ -182,55 +144,16 @@ func (m *BlockMetadata) GetResponseCommit() *types.ResponseCommit {
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeliverTx encapulate deliver tx request and response.
|
||||
type BlockMetadata_DeliverTx struct {
|
||||
Request *types.RequestDeliverTx `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"`
|
||||
Response *types.ResponseDeliverTx `protobuf:"bytes,2,opt,name=response,proto3" json:"response,omitempty"`
|
||||
}
|
||||
|
||||
func (m *BlockMetadata_DeliverTx) Reset() { *m = BlockMetadata_DeliverTx{} }
|
||||
func (m *BlockMetadata_DeliverTx) String() string { return proto.CompactTextString(m) }
|
||||
func (*BlockMetadata_DeliverTx) ProtoMessage() {}
|
||||
func (*BlockMetadata_DeliverTx) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_b6caeb9d7b7c7c10, []int{1, 0}
|
||||
}
|
||||
func (m *BlockMetadata_DeliverTx) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *BlockMetadata_DeliverTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_BlockMetadata_DeliverTx.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return b[:n], nil
|
||||
}
|
||||
}
|
||||
func (m *BlockMetadata_DeliverTx) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_BlockMetadata_DeliverTx.Merge(m, src)
|
||||
}
|
||||
func (m *BlockMetadata_DeliverTx) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *BlockMetadata_DeliverTx) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_BlockMetadata_DeliverTx.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_BlockMetadata_DeliverTx proto.InternalMessageInfo
|
||||
|
||||
func (m *BlockMetadata_DeliverTx) GetRequest() *types.RequestDeliverTx {
|
||||
func (m *BlockMetadata) GetRequestFinalizeBlock() *types.RequestFinalizeBlock {
|
||||
if m != nil {
|
||||
return m.Request
|
||||
return m.RequestFinalizeBlock
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *BlockMetadata_DeliverTx) GetResponse() *types.ResponseDeliverTx {
|
||||
func (m *BlockMetadata) GetResponseFinalizeBlock() *types.ResponseFinalizeBlock {
|
||||
if m != nil {
|
||||
return m.Response
|
||||
return m.ResponseFinalizeBlock
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@ -238,7 +161,6 @@ func (m *BlockMetadata_DeliverTx) GetResponse() *types.ResponseDeliverTx {
|
||||
func init() {
|
||||
proto.RegisterType((*StoreKVPair)(nil), "cosmos.store.v1beta1.StoreKVPair")
|
||||
proto.RegisterType((*BlockMetadata)(nil), "cosmos.store.v1beta1.BlockMetadata")
|
||||
proto.RegisterType((*BlockMetadata_DeliverTx)(nil), "cosmos.store.v1beta1.BlockMetadata.DeliverTx")
|
||||
}
|
||||
|
||||
func init() {
|
||||
@ -246,36 +168,31 @@ func init() {
|
||||
}
|
||||
|
||||
var fileDescriptor_b6caeb9d7b7c7c10 = []byte{
|
||||
// 458 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x93, 0x4f, 0x6f, 0xd3, 0x30,
|
||||
0x18, 0xc6, 0x9b, 0xb5, 0x2b, 0xed, 0x5b, 0x60, 0xc3, 0x54, 0x28, 0xda, 0xa4, 0x90, 0x15, 0x0e,
|
||||
0xbd, 0xe0, 0x68, 0xe5, 0x88, 0xc4, 0xa1, 0x80, 0x84, 0x34, 0xfe, 0x29, 0xfc, 0x39, 0x70, 0x89,
|
||||
0x92, 0xe6, 0xd5, 0x64, 0x9a, 0xda, 0xc5, 0xf6, 0xaa, 0xf5, 0x1b, 0x70, 0xe4, 0x63, 0x71, 0xdc,
|
||||
0x91, 0x23, 0x6a, 0xbf, 0x07, 0x42, 0xb1, 0xd3, 0x74, 0x19, 0xcd, 0xcd, 0x7e, 0xf2, 0x3c, 0xbf,
|
||||
0x3c, 0xaf, 0x2d, 0xc3, 0xe3, 0x89, 0x50, 0x33, 0xa1, 0x02, 0xa5, 0x85, 0xc4, 0x60, 0x71, 0x9a,
|
||||
0xa0, 0x8e, 0x4f, 0x83, 0x8c, 0x29, 0x8d, 0x9c, 0xf1, 0x73, 0x3a, 0x97, 0x42, 0x0b, 0xd2, 0xb7,
|
||||
0x2e, 0x6a, 0x5c, 0xb4, 0x70, 0x1d, 0x1d, 0x6b, 0xe4, 0x29, 0xca, 0x19, 0xe3, 0x3a, 0x88, 0x93,
|
||||
0x09, 0x0b, 0xf4, 0x72, 0x8e, 0xca, 0x46, 0x06, 0xdf, 0xa0, 0xf7, 0x31, 0x77, 0x9f, 0x7d, 0xf9,
|
||||
0x10, 0x33, 0x49, 0x8e, 0xa1, 0x6b, 0xc2, 0xd1, 0x14, 0x97, 0xae, 0xe3, 0x3b, 0xc3, 0x6e, 0xd8,
|
||||
0x31, 0xc2, 0x19, 0x2e, 0xc9, 0x03, 0x68, 0xa7, 0x98, 0xa1, 0x46, 0x77, 0xcf, 0x77, 0x86, 0x9d,
|
||||
0xb0, 0xd8, 0x91, 0x43, 0x68, 0xe6, 0xf6, 0xa6, 0xef, 0x0c, 0x6f, 0x87, 0xf9, 0x92, 0xf4, 0x61,
|
||||
0x7f, 0x11, 0x67, 0x17, 0xe8, 0xb6, 0x8c, 0x66, 0x37, 0x83, 0xbf, 0x2d, 0xb8, 0x33, 0xce, 0xc4,
|
||||
0x64, 0xfa, 0x16, 0x75, 0x9c, 0xc6, 0x3a, 0x26, 0x21, 0xdc, 0x97, 0xf8, 0xfd, 0x02, 0x95, 0x8e,
|
||||
0x12, 0x3c, 0x67, 0x3c, 0x4a, 0xf2, 0xcf, 0xe6, 0xc7, 0xbd, 0xd1, 0x80, 0x6e, 0x8b, 0xd3, 0xbc,
|
||||
0x38, 0x0d, 0xad, 0x77, 0x9c, 0x5b, 0x0d, 0x28, 0xbc, 0x27, 0x6f, 0x4a, 0xe4, 0x33, 0xf4, 0x25,
|
||||
0xaa, 0xb9, 0xe0, 0x0a, 0x2b, 0xd0, 0x3d, 0x03, 0x7d, 0xb4, 0x03, 0x6a, 0xcd, 0xd7, 0xa8, 0x44,
|
||||
0xfe, 0xa7, 0x91, 0x77, 0xd0, 0x4b, 0x31, 0x63, 0x0b, 0x94, 0x91, 0xbe, 0x54, 0x6e, 0xd3, 0x6f,
|
||||
0x0e, 0x7b, 0xa3, 0x27, 0x74, 0xd7, 0x89, 0xd3, 0xca, 0x90, 0xf4, 0xa5, 0x8d, 0x7d, 0xba, 0x0c,
|
||||
0x21, 0xdd, 0x2c, 0x15, 0x79, 0x03, 0x9b, 0xee, 0x11, 0xf2, 0xb4, 0xe8, 0xd8, 0x32, 0x1d, 0xfd,
|
||||
0xba, 0xc1, 0x5f, 0xf1, 0xd4, 0x16, 0x3c, 0x90, 0x55, 0x81, 0xbc, 0x87, 0xb2, 0xf3, 0x35, 0xdc,
|
||||
0xbe, 0xc1, 0x9d, 0xd4, 0x8e, 0x5c, 0xf2, 0x0e, 0xe5, 0x0d, 0x85, 0xbc, 0x86, 0x83, 0x12, 0x38,
|
||||
0x11, 0xb3, 0x19, 0xd3, 0x6e, 0xdb, 0xd0, 0x1e, 0xd6, 0xd2, 0x5e, 0x18, 0x5b, 0x78, 0x57, 0x56,
|
||||
0xf6, 0x47, 0x3f, 0x1c, 0xe8, 0x96, 0x47, 0x40, 0x9e, 0xc1, 0xad, 0xa2, 0x7b, 0x71, 0xcb, 0x27,
|
||||
0x75, 0xc3, 0x6e, 0x8f, 0x6d, 0x93, 0x20, 0xcf, 0xa1, 0xb3, 0x81, 0x17, 0xd7, 0x39, 0xa8, 0x6d,
|
||||
0xb3, 0x8d, 0x97, 0x99, 0xf1, 0xe8, 0xd7, 0xca, 0x73, 0xae, 0x56, 0x9e, 0xf3, 0x67, 0xe5, 0x39,
|
||||
0x3f, 0xd7, 0x5e, 0xe3, 0x6a, 0xed, 0x35, 0x7e, 0xaf, 0xbd, 0xc6, 0x57, 0xd7, 0xde, 0xa3, 0x4a,
|
||||
0xa7, 0x94, 0x89, 0xe2, 0x95, 0x99, 0x67, 0x92, 0xb4, 0xcd, 0x3b, 0x79, 0xfa, 0x2f, 0x00, 0x00,
|
||||
0xff, 0xff, 0x2b, 0x2f, 0x77, 0x06, 0x82, 0x03, 0x00, 0x00,
|
||||
// 374 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0xdf, 0x8a, 0xd3, 0x40,
|
||||
0x18, 0xc5, 0x3b, 0xc9, 0x34, 0xce, 0xce, 0xfa, 0x27, 0x0c, 0x75, 0x0d, 0x2e, 0xc4, 0xb0, 0xa8,
|
||||
0xe4, 0x2a, 0x61, 0xd7, 0x37, 0xa8, 0x20, 0x92, 0x22, 0x48, 0x04, 0x2f, 0x14, 0x0c, 0x93, 0xe4,
|
||||
0x53, 0xc6, 0x26, 0x99, 0x3a, 0x33, 0x2d, 0xd4, 0xa7, 0xf0, 0x61, 0x7c, 0x08, 0x2f, 0x7b, 0xe9,
|
||||
0xa5, 0xb4, 0x2f, 0x22, 0x99, 0x04, 0xa5, 0x52, 0xef, 0x72, 0x0e, 0xbf, 0xef, 0xe4, 0xc0, 0x19,
|
||||
0xfa, 0xb8, 0x92, 0xba, 0x95, 0x3a, 0xd5, 0x46, 0x2a, 0x48, 0x37, 0xd7, 0x25, 0x18, 0x7e, 0x9d,
|
||||
0x36, 0x42, 0x1b, 0xe8, 0x44, 0xf7, 0x29, 0x59, 0x29, 0x69, 0x24, 0x9b, 0x0d, 0x54, 0x62, 0xa9,
|
||||
0x64, 0xa4, 0x1e, 0x5e, 0x1a, 0xe8, 0x6a, 0x50, 0xad, 0xe8, 0x4c, 0xca, 0xcb, 0x4a, 0xa4, 0x66,
|
||||
0xbb, 0x02, 0x3d, 0x9c, 0x5c, 0x7d, 0xa6, 0xe7, 0x6f, 0x7a, 0x7a, 0xf1, 0xf6, 0x35, 0x17, 0x8a,
|
||||
0x5d, 0xd2, 0x33, 0x7b, 0x5c, 0x2c, 0x61, 0x1b, 0xa0, 0x08, 0xc5, 0x67, 0x39, 0xb1, 0xc6, 0x02,
|
||||
0xb6, 0xec, 0x82, 0x7a, 0x35, 0x34, 0x60, 0x20, 0x70, 0x22, 0x14, 0x93, 0x7c, 0x54, 0xcc, 0xa7,
|
||||
0x6e, 0x8f, 0xbb, 0x11, 0x8a, 0x6f, 0xe7, 0xfd, 0x27, 0x9b, 0xd1, 0xe9, 0x86, 0x37, 0x6b, 0x08,
|
||||
0xb0, 0xf5, 0x06, 0x71, 0xf5, 0xdd, 0xa1, 0x77, 0xe6, 0x8d, 0xac, 0x96, 0xaf, 0xc0, 0xf0, 0x9a,
|
||||
0x1b, 0xce, 0x5e, 0xd2, 0x7b, 0x0a, 0xf4, 0x4a, 0x76, 0x1a, 0x8a, 0x4a, 0xb6, 0xad, 0x30, 0x81,
|
||||
0x17, 0xa1, 0xf8, 0xfc, 0xe6, 0x51, 0xf2, 0xb7, 0x74, 0xd2, 0x97, 0x4e, 0xf2, 0x91, 0x7b, 0x6e,
|
||||
0xb1, 0xfc, 0xae, 0x3a, 0xd2, 0xec, 0x3d, 0xbd, 0x50, 0xf0, 0x65, 0x0d, 0xda, 0x14, 0x1f, 0x45,
|
||||
0xc7, 0x1b, 0xf1, 0x15, 0x8a, 0xb2, 0xff, 0x57, 0x70, 0xcb, 0x06, 0x3e, 0x39, 0x11, 0x68, 0xf1,
|
||||
0x17, 0x23, 0x6d, 0x8b, 0xe5, 0x33, 0x75, 0xc2, 0x65, 0x1f, 0xe8, 0x83, 0x3f, 0x35, 0xff, 0x49,
|
||||
0x27, 0x36, 0xfd, 0xe9, 0x7f, 0xeb, 0x1e, 0xc7, 0xdf, 0x57, 0xa7, 0xec, 0x0c, 0x13, 0xe4, 0x3b,
|
||||
0x19, 0x26, 0x8e, 0xef, 0x66, 0x98, 0xb8, 0x3e, 0xce, 0x30, 0xc1, 0xfe, 0x34, 0xc3, 0x64, 0xea,
|
||||
0x7b, 0xf3, 0x9b, 0x1f, 0xfb, 0x10, 0xed, 0xf6, 0x21, 0xfa, 0xb5, 0x0f, 0xd1, 0xb7, 0x43, 0x38,
|
||||
0xd9, 0x1d, 0xc2, 0xc9, 0xcf, 0x43, 0x38, 0x79, 0x17, 0x0c, 0x7b, 0xeb, 0x7a, 0x99, 0x08, 0x39,
|
||||
0xbe, 0x0d, 0x3b, 0x6e, 0xe9, 0xd9, 0x75, 0x9f, 0xfd, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x68, 0x61,
|
||||
0xc9, 0x0c, 0x38, 0x02, 0x00, 0x00,
|
||||
}
|
||||
|
||||
func (m *StoreKVPair) Marshal() (dAtA []byte, err error) {
|
||||
@ -352,6 +269,30 @@ func (m *BlockMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.ResponseFinalizeBlock != nil {
|
||||
{
|
||||
size, err := m.ResponseFinalizeBlock.MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintListening(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x42
|
||||
}
|
||||
if m.RequestFinalizeBlock != nil {
|
||||
{
|
||||
size, err := m.RequestFinalizeBlock.MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintListening(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x3a
|
||||
}
|
||||
if m.ResponseCommit != nil {
|
||||
{
|
||||
size, err := m.ResponseCommit.MarshalToSizedBuffer(dAtA[:i])
|
||||
@ -364,115 +305,6 @@ func (m *BlockMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i--
|
||||
dAtA[i] = 0x32
|
||||
}
|
||||
if m.ResponseEndBlock != nil {
|
||||
{
|
||||
size, err := m.ResponseEndBlock.MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintListening(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x2a
|
||||
}
|
||||
if m.RequestEndBlock != nil {
|
||||
{
|
||||
size, err := m.RequestEndBlock.MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintListening(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x22
|
||||
}
|
||||
if len(m.DeliverTxs) > 0 {
|
||||
for iNdEx := len(m.DeliverTxs) - 1; iNdEx >= 0; iNdEx-- {
|
||||
{
|
||||
size, err := m.DeliverTxs[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintListening(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x1a
|
||||
}
|
||||
}
|
||||
if m.ResponseBeginBlock != nil {
|
||||
{
|
||||
size, err := m.ResponseBeginBlock.MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintListening(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
if m.RequestBeginBlock != nil {
|
||||
{
|
||||
size, err := m.RequestBeginBlock.MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintListening(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *BlockMetadata_DeliverTx) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *BlockMetadata_DeliverTx) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *BlockMetadata_DeliverTx) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.Response != nil {
|
||||
{
|
||||
size, err := m.Response.MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintListening(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
if m.Request != nil {
|
||||
{
|
||||
size, err := m.Request.MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintListening(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
@ -517,47 +349,16 @@ func (m *BlockMetadata) Size() (n int) {
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
if m.RequestBeginBlock != nil {
|
||||
l = m.RequestBeginBlock.Size()
|
||||
n += 1 + l + sovListening(uint64(l))
|
||||
}
|
||||
if m.ResponseBeginBlock != nil {
|
||||
l = m.ResponseBeginBlock.Size()
|
||||
n += 1 + l + sovListening(uint64(l))
|
||||
}
|
||||
if len(m.DeliverTxs) > 0 {
|
||||
for _, e := range m.DeliverTxs {
|
||||
l = e.Size()
|
||||
n += 1 + l + sovListening(uint64(l))
|
||||
}
|
||||
}
|
||||
if m.RequestEndBlock != nil {
|
||||
l = m.RequestEndBlock.Size()
|
||||
n += 1 + l + sovListening(uint64(l))
|
||||
}
|
||||
if m.ResponseEndBlock != nil {
|
||||
l = m.ResponseEndBlock.Size()
|
||||
n += 1 + l + sovListening(uint64(l))
|
||||
}
|
||||
if m.ResponseCommit != nil {
|
||||
l = m.ResponseCommit.Size()
|
||||
n += 1 + l + sovListening(uint64(l))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *BlockMetadata_DeliverTx) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
if m.Request != nil {
|
||||
l = m.Request.Size()
|
||||
if m.RequestFinalizeBlock != nil {
|
||||
l = m.RequestFinalizeBlock.Size()
|
||||
n += 1 + l + sovListening(uint64(l))
|
||||
}
|
||||
if m.Response != nil {
|
||||
l = m.Response.Size()
|
||||
if m.ResponseFinalizeBlock != nil {
|
||||
l = m.ResponseFinalizeBlock.Size()
|
||||
n += 1 + l + sovListening(uint64(l))
|
||||
}
|
||||
return n
|
||||
@ -768,184 +569,6 @@ func (m *BlockMetadata) Unmarshal(dAtA []byte) error {
|
||||
return fmt.Errorf("proto: BlockMetadata: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field RequestBeginBlock", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowListening
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
return ErrInvalidLengthListening
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthListening
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if m.RequestBeginBlock == nil {
|
||||
m.RequestBeginBlock = &types.RequestBeginBlock{}
|
||||
}
|
||||
if err := m.RequestBeginBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
case 2:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field ResponseBeginBlock", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowListening
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
return ErrInvalidLengthListening
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthListening
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if m.ResponseBeginBlock == nil {
|
||||
m.ResponseBeginBlock = &types.ResponseBeginBlock{}
|
||||
}
|
||||
if err := m.ResponseBeginBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
case 3:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field DeliverTxs", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowListening
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
return ErrInvalidLengthListening
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthListening
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.DeliverTxs = append(m.DeliverTxs, &BlockMetadata_DeliverTx{})
|
||||
if err := m.DeliverTxs[len(m.DeliverTxs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
case 4:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field RequestEndBlock", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowListening
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
return ErrInvalidLengthListening
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthListening
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if m.RequestEndBlock == nil {
|
||||
m.RequestEndBlock = &types.RequestEndBlock{}
|
||||
}
|
||||
if err := m.RequestEndBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
case 5:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field ResponseEndBlock", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowListening
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
return ErrInvalidLengthListening
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthListening
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if m.ResponseEndBlock == nil {
|
||||
m.ResponseEndBlock = &types.ResponseEndBlock{}
|
||||
}
|
||||
if err := m.ResponseEndBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
case 6:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field ResponseCommit", wireType)
|
||||
@ -982,59 +605,9 @@ func (m *BlockMetadata) Unmarshal(dAtA []byte) error {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipListening(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||
return ErrInvalidLengthListening
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *BlockMetadata_DeliverTx) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowListening
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: DeliverTx: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: DeliverTx: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
case 7:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Request", wireType)
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field RequestFinalizeBlock", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
@ -1061,16 +634,16 @@ func (m *BlockMetadata_DeliverTx) Unmarshal(dAtA []byte) error {
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if m.Request == nil {
|
||||
m.Request = &types.RequestDeliverTx{}
|
||||
if m.RequestFinalizeBlock == nil {
|
||||
m.RequestFinalizeBlock = &types.RequestFinalizeBlock{}
|
||||
}
|
||||
if err := m.Request.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
if err := m.RequestFinalizeBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
case 2:
|
||||
case 8:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Response", wireType)
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field ResponseFinalizeBlock", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
@ -1097,10 +670,10 @@ func (m *BlockMetadata_DeliverTx) Unmarshal(dAtA []byte) error {
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if m.Response == nil {
|
||||
m.Response = &types.ResponseDeliverTx{}
|
||||
if m.ResponseFinalizeBlock == nil {
|
||||
m.ResponseFinalizeBlock = &types.ResponseFinalizeBlock{}
|
||||
}
|
||||
if err := m.Response.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
if err := m.ResponseFinalizeBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
|
||||
@ -40,7 +40,7 @@ type CommitStore interface {
|
||||
//
|
||||
// This is an optional, but useful extension to any CommitStore
|
||||
type Queryable interface {
|
||||
Query(abci.RequestQuery) abci.ResponseQuery
|
||||
Query(*abci.RequestQuery) *abci.ResponseQuery
|
||||
}
|
||||
|
||||
//----------------------------------------
|
||||
|
||||
@ -11,12 +11,8 @@ import (
|
||||
// The error results are propagated to consensus state machine,
|
||||
// if you don't want to affect consensus, handle the errors internally and always return `nil` in these APIs.
|
||||
type ABCIListener interface {
|
||||
// ListenBeginBlock updates the streaming service with the latest BeginBlock messages
|
||||
ListenBeginBlock(ctx context.Context, req abci.RequestBeginBlock, res abci.ResponseBeginBlock) error
|
||||
// ListenEndBlock updates the steaming service with the latest EndBlock messages
|
||||
ListenEndBlock(ctx context.Context, req abci.RequestEndBlock, res abci.ResponseEndBlock) error
|
||||
// ListenDeliverTx updates the steaming service with the latest DeliverTx messages
|
||||
ListenDeliverTx(ctx context.Context, req abci.RequestDeliverTx, res abci.ResponseDeliverTx) error
|
||||
// ListenFinalizeBlock updates the streaming service with the latest FinalizeBlock messages
|
||||
ListenFinalizeBlock(ctx context.Context, req abci.RequestFinalizeBlock, res abci.ResponseFinalizeBlock) error
|
||||
// ListenCommit updates the steaming service with the latest Commit messages and state changes
|
||||
ListenCommit(ctx context.Context, res abci.ResponseCommit, changeSet []*StoreKVPair) error
|
||||
}
|
||||
|
||||
@ -82,7 +82,7 @@ func (s *E2ETestSuite) SetupSuite() {
|
||||
|
||||
// Make sure not to forget to persist `myParams` into the actual store,
|
||||
// this is done in InitChain.
|
||||
app.SetInitChainer(func(ctx sdk.Context, req abci.RequestInitChain) (abci.ResponseInitChain, error) {
|
||||
app.SetInitChainer(func(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error) {
|
||||
subspace.SetParamSet(ctx, ¶mSet)
|
||||
|
||||
return app.InitChainer(ctx, req)
|
||||
|
||||
@ -14,7 +14,6 @@ import (
|
||||
"testing"
|
||||
|
||||
abci "github.com/cometbft/cometbft/abci/types"
|
||||
cmtproto "github.com/cometbft/cometbft/proto/tendermint/types"
|
||||
dbm "github.com/cosmos/cosmos-db"
|
||||
"github.com/spf13/cobra"
|
||||
"gotest.tools/v3/assert"
|
||||
@ -96,7 +95,9 @@ func TestExportCmd_Height(t *testing.T) {
|
||||
|
||||
// Fast forward to block `tc.fastForward`.
|
||||
for i := int64(2); i <= tc.fastForward; i++ {
|
||||
app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: i}})
|
||||
app.FinalizeBlock(&abci.RequestFinalizeBlock{
|
||||
Height: i,
|
||||
})
|
||||
app.Commit()
|
||||
}
|
||||
|
||||
@ -181,13 +182,15 @@ func setupApp(t *testing.T, tempDir string) (*simapp.SimApp, context.Context, ge
|
||||
err = genutil.ExportGenesisFile(&appGenesis, serverCtx.Config.GenesisFile())
|
||||
assert.NilError(t, err)
|
||||
|
||||
app.InitChain(
|
||||
abci.RequestInitChain{
|
||||
Validators: []abci.ValidatorUpdate{},
|
||||
ConsensusParams: simtestutil.DefaultConsensusParams,
|
||||
AppStateBytes: appGenesis.AppState,
|
||||
},
|
||||
app.InitChain(&abci.RequestInitChain{
|
||||
Validators: []abci.ValidatorUpdate{},
|
||||
ConsensusParams: simtestutil.DefaultConsensusParams,
|
||||
AppStateBytes: appGenesis.AppState,
|
||||
},
|
||||
)
|
||||
app.FinalizeBlock(&abci.RequestFinalizeBlock{
|
||||
Height: 1,
|
||||
})
|
||||
app.Commit()
|
||||
|
||||
cmd := server.ExportCmd(
|
||||
|
||||
10
tests/go.mod
10
tests/go.mod
@ -16,7 +16,7 @@ require (
|
||||
cosmossdk.io/x/nft v0.0.0-20230113085233-fae3332d62fc
|
||||
cosmossdk.io/x/tx v0.7.0
|
||||
cosmossdk.io/x/upgrade v0.0.0-20230127052425-54c8e1568335
|
||||
github.com/cometbft/cometbft v0.37.1
|
||||
github.com/cometbft/cometbft v0.38.0-alpha.2
|
||||
github.com/cosmos/cosmos-db v1.0.0-rc.1
|
||||
github.com/cosmos/cosmos-proto v1.0.0-beta.3
|
||||
// this version is not used as it is always replaced by the latest Cosmos SDK version
|
||||
@ -43,7 +43,6 @@ require (
|
||||
filippo.io/edwards25519 v1.0.0 // indirect
|
||||
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
|
||||
github.com/99designs/keyring v1.2.1 // indirect
|
||||
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect
|
||||
github.com/DataDog/zstd v1.5.2 // indirect
|
||||
github.com/armon/go-metrics v0.4.1 // indirect
|
||||
github.com/aws/aws-sdk-go v1.44.224 // indirect
|
||||
@ -68,7 +67,6 @@ require (
|
||||
github.com/cosmos/iavl v0.21.0 // indirect
|
||||
github.com/cosmos/ics23/go v0.10.0 // indirect
|
||||
github.com/cosmos/ledger-cosmos-go v0.13.0 // indirect
|
||||
github.com/creachadair/taskgroup v0.4.2 // indirect
|
||||
github.com/danieljoos/wincred v1.1.2 // indirect
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
|
||||
@ -103,8 +101,6 @@ require (
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
|
||||
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
|
||||
github.com/gtank/merlin v0.1.1 // indirect
|
||||
github.com/gtank/ristretto255 v0.1.2 // indirect
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
|
||||
github.com/hashicorp/go-getter v1.7.1 // indirect
|
||||
github.com/hashicorp/go-hclog v1.5.0 // indirect
|
||||
@ -133,12 +129,12 @@ require (
|
||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||
github.com/mattn/go-isatty v0.0.19 // indirect
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
|
||||
github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect
|
||||
github.com/minio/highwayhash v1.0.2 // indirect
|
||||
github.com/mitchellh/go-homedir v1.1.0 // indirect
|
||||
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
|
||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||
github.com/mtibben/percent v0.2.1 // indirect
|
||||
github.com/oasisprotocol/curve25519-voi v0.0.0-20220708102147-0a8a51822cae // indirect
|
||||
github.com/oklog/run v1.1.0 // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.0.7 // indirect
|
||||
github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect
|
||||
@ -196,12 +192,12 @@ replace (
|
||||
cosmossdk.io/api => ../api
|
||||
// TODO: remove me after collections v0.2.0 is released
|
||||
cosmossdk.io/collections => ../collections
|
||||
cosmossdk.io/core => ../core
|
||||
cosmossdk.io/store => ../store
|
||||
cosmossdk.io/x/circuit => ../x/circuit
|
||||
cosmossdk.io/x/evidence => ../x/evidence
|
||||
cosmossdk.io/x/feegrant => ../x/feegrant
|
||||
cosmossdk.io/x/nft => ../x/nft
|
||||
// TODO: remove after 0.7.0 release
|
||||
cosmossdk.io/x/tx => ../x/tx
|
||||
cosmossdk.io/x/upgrade => ../x/upgrade
|
||||
)
|
||||
|
||||
32
tests/go.sum
32
tests/go.sum
@ -190,8 +190,6 @@ cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1V
|
||||
cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M=
|
||||
cosmossdk.io/client/v2 v2.0.0-20230309163709-87da587416ba h1:LuPHCncU2KLMNPItFECs709uo46I9wSu2fAWYVCx+/U=
|
||||
cosmossdk.io/client/v2 v2.0.0-20230309163709-87da587416ba/go.mod h1:SXdwqO7cN5htalh/lhXWP8V4zKtBrhhcSTU+ytuEtmM=
|
||||
cosmossdk.io/core v0.7.0 h1:GFss3qt2P9p23Cz24NnqLkslzb8n+B75A24x1JgJJp0=
|
||||
cosmossdk.io/core v0.7.0/go.mod h1:36hP0ZH/8ipsjzfcp0yKU4bqQXUGhS0/m1krWFCtwCc=
|
||||
cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z+zfw=
|
||||
cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU=
|
||||
cosmossdk.io/errors v1.0.0-beta.7.0.20230429155654-3ee8242364e4 h1:rOy7iw7HlwKc5Af5qIHLXdBx/F98o6du/I/WGwOW6eA=
|
||||
@ -206,11 +204,9 @@ filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5E
|
||||
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs=
|
||||
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4=
|
||||
github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8=
|
||||
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8=
|
||||
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg=
|
||||
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4=
|
||||
github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno=
|
||||
github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo=
|
||||
github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
|
||||
@ -267,7 +263,7 @@ github.com/bits-and-blooms/bitset v1.7.0 h1:YjAGVd3XmtK9ktAbX8Zg2g2PwLIMjGREZJHl
|
||||
github.com/bits-and-blooms/bitset v1.7.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA=
|
||||
github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U=
|
||||
github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04=
|
||||
github.com/btcsuite/btcd/btcutil v1.1.2 h1:XLMbX8JQEiwMcYft2EGi8zPUkoa0abKIU6/BJSRsjzQ=
|
||||
github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ=
|
||||
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U=
|
||||
github.com/bufbuild/protocompile v0.5.1 h1:mixz5lJX4Hiz4FpqFREJHIXLfaLBntfaJv1h+/jS+Qg=
|
||||
github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM=
|
||||
@ -328,8 +324,8 @@ github.com/cockroachdb/redact v1.1.3 h1:AKZds10rFSIj7qADf0g46UixK8NNLwWTNdCIGS5w
|
||||
github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg=
|
||||
github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI=
|
||||
github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM=
|
||||
github.com/cometbft/cometbft v0.37.1 h1:KLxkQTK2hICXYq21U2hn1W5hOVYUdQgDQ1uB+90xPIg=
|
||||
github.com/cometbft/cometbft v0.37.1/go.mod h1:Y2MMMN//O5K4YKd8ze4r9jmk4Y7h0ajqILXbH5JQFVs=
|
||||
github.com/cometbft/cometbft v0.38.0-alpha.2 h1:iorYtE7u4kBgSe4JtruHsGR1RNSdVlrDwGOYKZ7h3zs=
|
||||
github.com/cometbft/cometbft v0.38.0-alpha.2/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k=
|
||||
github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo=
|
||||
github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0=
|
||||
github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg=
|
||||
@ -345,7 +341,6 @@ github.com/cosmos/cosmos-db v1.0.0-rc.1 h1:SjnT8B6WKMW9WEIX32qMhnEEKcI7ZP0+G1Sa9
|
||||
github.com/cosmos/cosmos-db v1.0.0-rc.1/go.mod h1:Dnmk3flSf5lkwCqvvjNpoxjpXzhxnCAFzKHlbaForso=
|
||||
github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o=
|
||||
github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I=
|
||||
github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y=
|
||||
github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY=
|
||||
github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw=
|
||||
github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE=
|
||||
@ -364,8 +359,6 @@ github.com/cosmos/ledger-cosmos-go v0.13.0/go.mod h1:ZcqYgnfNJ6lAXe4HPtWgarNEY+B
|
||||
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||
github.com/creachadair/taskgroup v0.4.2 h1:jsBLdAJE42asreGss2xZGZ8fJra7WtwnHWeJFxv2Li8=
|
||||
github.com/creachadair/taskgroup v0.4.2/go.mod h1:qiXUOSrbwAY3u0JPGTzObbE3yf9hcXHDKBZ2ZjpCbgM=
|
||||
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
|
||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
github.com/cucumber/common/gherkin/go/v22 v22.0.0 h1:4K8NqptbvdOrjL9DEea6HFjSpbdT9+Q5kgLpmmsHYl0=
|
||||
@ -486,7 +479,7 @@ github.com/goccy/go-json v0.10.0/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MG
|
||||
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0=
|
||||
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4=
|
||||
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||
github.com/gofrs/uuid v4.3.0+incompatible h1:CaSVZxm5B+7o45rtab4jC2G37WGYX1zQfuU2i6DSvnc=
|
||||
github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA=
|
||||
github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s=
|
||||
github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s=
|
||||
github.com/gogo/googleapis v1.4.1-0.20201022092350-68b0159b7869/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c=
|
||||
@ -637,11 +630,6 @@ github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
|
||||
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU=
|
||||
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0=
|
||||
github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s=
|
||||
github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is=
|
||||
github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s=
|
||||
github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uMzcc=
|
||||
github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIvY4OmlYW69o=
|
||||
github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE=
|
||||
github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8=
|
||||
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
@ -812,9 +800,6 @@ github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfr
|
||||
github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8=
|
||||
github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc=
|
||||
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
|
||||
github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM=
|
||||
github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 h1:QRUSJEgZn2Snx0EmT/QLXibWjSUDjKWvXIT19NBVp94=
|
||||
github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM=
|
||||
github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g=
|
||||
github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY=
|
||||
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
|
||||
@ -855,6 +840,8 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA
|
||||
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
|
||||
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
|
||||
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
|
||||
github.com/oasisprotocol/curve25519-voi v0.0.0-20220708102147-0a8a51822cae h1:FatpGJD2jmJfhZiFDElaC0QhZUDQnxUeAwTGkfAHN3I=
|
||||
github.com/oasisprotocol/curve25519-voi v0.0.0-20220708102147-0a8a51822cae/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s=
|
||||
github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs=
|
||||
github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
|
||||
github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA=
|
||||
@ -1117,7 +1104,6 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U
|
||||
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
@ -1167,7 +1153,7 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||
golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8=
|
||||
golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs=
|
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
@ -1477,7 +1463,7 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||
golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||
golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM=
|
||||
golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
|
||||
@ -116,7 +116,7 @@ func initFixture(t testing.TB) *fixture {
|
||||
Address: valAddr,
|
||||
Power: 100,
|
||||
},
|
||||
SignedLastBlock: true,
|
||||
BlockIdFlag: types.BlockIDFlagCommit,
|
||||
},
|
||||
})
|
||||
|
||||
@ -268,7 +268,7 @@ func TestMsgWithdrawDelegatorReward(t *testing.T) {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
res, err := f.app.RunMsg(
|
||||
tc.msg,
|
||||
integration.WithAutomaticBeginEndBlock(),
|
||||
integration.WithAutomaticFinalizeBlock(),
|
||||
integration.WithAutomaticCommit(),
|
||||
)
|
||||
|
||||
@ -417,7 +417,7 @@ func TestMsgSetWithdrawAddress(t *testing.T) {
|
||||
tc.preRun()
|
||||
res, err := f.app.RunMsg(
|
||||
tc.msg,
|
||||
integration.WithAutomaticBeginEndBlock(),
|
||||
integration.WithAutomaticFinalizeBlock(),
|
||||
integration.WithAutomaticCommit(),
|
||||
)
|
||||
if tc.expErr {
|
||||
@ -510,7 +510,7 @@ func TestMsgWithdrawValidatorCommission(t *testing.T) {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
res, err := f.app.RunMsg(
|
||||
tc.msg,
|
||||
integration.WithAutomaticBeginEndBlock(),
|
||||
integration.WithAutomaticFinalizeBlock(),
|
||||
integration.WithAutomaticCommit(),
|
||||
)
|
||||
if tc.expErr {
|
||||
@ -612,7 +612,7 @@ func TestMsgFundCommunityPool(t *testing.T) {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
res, err := f.app.RunMsg(
|
||||
tc.msg,
|
||||
integration.WithAutomaticBeginEndBlock(),
|
||||
integration.WithAutomaticFinalizeBlock(),
|
||||
integration.WithAutomaticCommit(),
|
||||
)
|
||||
if tc.expErr {
|
||||
@ -739,7 +739,7 @@ func TestMsgUpdateParams(t *testing.T) {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
res, err := f.app.RunMsg(
|
||||
tc.msg,
|
||||
integration.WithAutomaticBeginEndBlock(),
|
||||
integration.WithAutomaticFinalizeBlock(),
|
||||
integration.WithAutomaticCommit(),
|
||||
)
|
||||
if tc.expErr {
|
||||
@ -817,7 +817,7 @@ func TestMsgCommunityPoolSpend(t *testing.T) {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
res, err := f.app.RunMsg(
|
||||
tc.msg,
|
||||
integration.WithAutomaticBeginEndBlock(),
|
||||
integration.WithAutomaticFinalizeBlock(),
|
||||
integration.WithAutomaticCommit(),
|
||||
)
|
||||
if tc.expErr {
|
||||
@ -914,7 +914,7 @@ func TestMsgDepositValidatorRewardsPool(t *testing.T) {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
res, err := f.app.RunMsg(
|
||||
tc.msg,
|
||||
integration.WithAutomaticBeginEndBlock(),
|
||||
integration.WithAutomaticFinalizeBlock(),
|
||||
integration.WithAutomaticCommit(),
|
||||
)
|
||||
if tc.expErr {
|
||||
|
||||
@ -184,13 +184,13 @@ func TestHandleDoubleSign(t *testing.T) {
|
||||
f.slashingKeeper.SetValidatorSigningInfo(f.sdkCtx, sdk.ConsAddress(val.Address()), info)
|
||||
|
||||
// handle a signature to set signing info
|
||||
f.slashingKeeper.HandleValidatorSignature(ctx, val.Address(), selfDelegation.Int64(), true)
|
||||
f.slashingKeeper.HandleValidatorSignature(ctx, val.Address(), selfDelegation.Int64(), comet.BlockIDFlagCommit)
|
||||
|
||||
// double sign less than max age
|
||||
oldTokens := f.stakingKeeper.Validator(ctx, operatorAddr).GetTokens()
|
||||
|
||||
nci := NewCometInfo(abci.RequestBeginBlock{
|
||||
ByzantineValidators: []abci.Misbehavior{{
|
||||
nci := NewCometInfo(abci.RequestFinalizeBlock{
|
||||
Misbehavior: []abci.Misbehavior{{
|
||||
Validator: abci.Validator{Address: val.Address(), Power: power},
|
||||
Type: abci.MisbehaviorType_DUPLICATE_VOTE,
|
||||
Time: time.Now().UTC(),
|
||||
@ -259,8 +259,8 @@ func TestHandleDoubleSign_TooOld(t *testing.T) {
|
||||
)
|
||||
assert.DeepEqual(t, amt, f.stakingKeeper.Validator(ctx, operatorAddr).GetBondedTokens())
|
||||
|
||||
nci := NewCometInfo(abci.RequestBeginBlock{
|
||||
ByzantineValidators: []abci.Misbehavior{{
|
||||
nci := NewCometInfo(abci.RequestFinalizeBlock{
|
||||
Misbehavior: []abci.Misbehavior{{
|
||||
Validator: abci.Validator{Address: val.Address(), Power: power},
|
||||
Type: abci.MisbehaviorType_DUPLICATE_VOTE,
|
||||
Time: ctx.BlockTime(),
|
||||
@ -326,9 +326,9 @@ type CometService struct {
|
||||
Evidence []abci.Misbehavior
|
||||
}
|
||||
|
||||
func NewCometInfo(bg abci.RequestBeginBlock) comet.BlockInfo {
|
||||
func NewCometInfo(bg abci.RequestFinalizeBlock) comet.BlockInfo {
|
||||
return CometService{
|
||||
Evidence: bg.ByzantineValidators,
|
||||
Evidence: bg.Misbehavior,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -75,8 +75,9 @@ func TestImportExportQueues(t *testing.T) {
|
||||
ctx := s1.app.BaseApp.NewContext(false, cmtproto.Header{})
|
||||
addrs := simtestutil.AddTestAddrs(s1.BankKeeper, s1.StakingKeeper, ctx, 1, valTokens)
|
||||
|
||||
header := cmtproto.Header{Height: s1.app.LastBlockHeight() + 1}
|
||||
s1.app.BeginBlock(abci.RequestBeginBlock{Header: header})
|
||||
s1.app.FinalizeBlock(&abci.RequestFinalizeBlock{
|
||||
Height: s1.app.LastBlockHeight() + 1,
|
||||
})
|
||||
|
||||
ctx = s1.app.BaseApp.NewContext(false, cmtproto.Header{})
|
||||
// Create two proposals, put the second into the voting period
|
||||
@ -130,19 +131,19 @@ func TestImportExportQueues(t *testing.T) {
|
||||
)
|
||||
assert.NilError(t, err)
|
||||
|
||||
s2.app.InitChain(
|
||||
abci.RequestInitChain{
|
||||
Validators: []abci.ValidatorUpdate{},
|
||||
ConsensusParams: simtestutil.DefaultConsensusParams,
|
||||
AppStateBytes: stateBytes,
|
||||
},
|
||||
)
|
||||
s2.app.InitChain(&abci.RequestInitChain{
|
||||
Validators: []abci.ValidatorUpdate{},
|
||||
ConsensusParams: simtestutil.DefaultConsensusParams,
|
||||
AppStateBytes: stateBytes,
|
||||
})
|
||||
|
||||
s2.app.Commit()
|
||||
s2.app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{Height: s2.app.LastBlockHeight() + 1}})
|
||||
s2.app.FinalizeBlock(&abci.RequestFinalizeBlock{
|
||||
Height: s2.app.LastBlockHeight() + 1,
|
||||
})
|
||||
|
||||
header = cmtproto.Header{Height: s2.app.LastBlockHeight() + 1}
|
||||
s2.app.BeginBlock(abci.RequestBeginBlock{Header: header})
|
||||
s2.app.FinalizeBlock(&abci.RequestFinalizeBlock{
|
||||
Height: s2.app.LastBlockHeight() + 1,
|
||||
})
|
||||
|
||||
ctx2 := s2.app.BaseApp.NewContext(false, cmtproto.Header{})
|
||||
|
||||
|
||||
@ -4,6 +4,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"cosmossdk.io/core/comet"
|
||||
"cosmossdk.io/log"
|
||||
storetypes "cosmossdk.io/store/types"
|
||||
|
||||
@ -179,7 +180,7 @@ func TestUnJailNotBonded(t *testing.T) {
|
||||
}
|
||||
_, err = f.app.RunMsg(
|
||||
&msgUnjail,
|
||||
integration.WithAutomaticBeginEndBlock(),
|
||||
integration.WithAutomaticFinalizeBlock(),
|
||||
integration.WithAutomaticCommit(),
|
||||
)
|
||||
assert.ErrorContains(t, err, "cannot be unjailed")
|
||||
@ -195,7 +196,7 @@ func TestUnJailNotBonded(t *testing.T) {
|
||||
// verify we can immediately unjail
|
||||
_, err = f.app.RunMsg(
|
||||
&msgUnjail,
|
||||
integration.WithAutomaticBeginEndBlock(),
|
||||
integration.WithAutomaticFinalizeBlock(),
|
||||
integration.WithAutomaticCommit(),
|
||||
)
|
||||
assert.NilError(t, err)
|
||||
@ -231,9 +232,9 @@ func TestHandleNewValidator(t *testing.T) {
|
||||
assert.DeepEqual(t, amt, f.stakingKeeper.Validator(f.ctx, addr).GetBondedTokens())
|
||||
|
||||
// Now a validator, for two blocks
|
||||
f.slashingKeeper.HandleValidatorSignature(f.ctx, val.Address(), 100, true)
|
||||
f.slashingKeeper.HandleValidatorSignature(f.ctx, val.Address(), 100, comet.BlockIDFlagCommit)
|
||||
f.ctx = f.ctx.WithBlockHeight(f.slashingKeeper.SignedBlocksWindow(f.ctx) + 2)
|
||||
f.slashingKeeper.HandleValidatorSignature(f.ctx, val.Address(), 100, false)
|
||||
f.slashingKeeper.HandleValidatorSignature(f.ctx, val.Address(), 100, comet.BlockIDFlagAbsent)
|
||||
|
||||
info, found := f.slashingKeeper.GetValidatorSigningInfo(f.ctx, sdk.ConsAddress(val.Address()))
|
||||
assert.Assert(t, found)
|
||||
@ -274,13 +275,13 @@ func TestHandleAlreadyJailed(t *testing.T) {
|
||||
height := int64(0)
|
||||
for ; height < f.slashingKeeper.SignedBlocksWindow(f.ctx); height++ {
|
||||
f.ctx = f.ctx.WithBlockHeight(height)
|
||||
f.slashingKeeper.HandleValidatorSignature(f.ctx, val.Address(), power, true)
|
||||
f.slashingKeeper.HandleValidatorSignature(f.ctx, val.Address(), power, comet.BlockIDFlagCommit)
|
||||
}
|
||||
|
||||
// 501 blocks missed
|
||||
for ; height < f.slashingKeeper.SignedBlocksWindow(f.ctx)+(f.slashingKeeper.SignedBlocksWindow(f.ctx)-f.slashingKeeper.MinSignedPerWindow(f.ctx))+1; height++ {
|
||||
f.ctx = f.ctx.WithBlockHeight(height)
|
||||
f.slashingKeeper.HandleValidatorSignature(f.ctx, val.Address(), power, false)
|
||||
f.slashingKeeper.HandleValidatorSignature(f.ctx, val.Address(), power, comet.BlockIDFlagAbsent)
|
||||
}
|
||||
|
||||
// end block
|
||||
@ -296,7 +297,7 @@ func TestHandleAlreadyJailed(t *testing.T) {
|
||||
|
||||
// another block missed
|
||||
f.ctx = f.ctx.WithBlockHeight(height)
|
||||
f.slashingKeeper.HandleValidatorSignature(f.ctx, val.Address(), power, false)
|
||||
f.slashingKeeper.HandleValidatorSignature(f.ctx, val.Address(), power, comet.BlockIDFlagAbsent)
|
||||
|
||||
// validator should not have been slashed twice
|
||||
validator, _ = f.stakingKeeper.GetValidatorByConsAddr(f.ctx, sdk.GetConsAddress(val))
|
||||
@ -338,7 +339,7 @@ func TestValidatorDippingInAndOut(t *testing.T) {
|
||||
height := int64(0)
|
||||
for ; height < int64(100); height++ {
|
||||
f.ctx = f.ctx.WithBlockHeight(height)
|
||||
f.slashingKeeper.HandleValidatorSignature(f.ctx, val.Address(), power, true)
|
||||
f.slashingKeeper.HandleValidatorSignature(f.ctx, val.Address(), power, comet.BlockIDFlagCommit)
|
||||
}
|
||||
|
||||
// kick first validator out of validator set
|
||||
@ -363,7 +364,7 @@ func TestValidatorDippingInAndOut(t *testing.T) {
|
||||
newPower := power + 50
|
||||
|
||||
// validator misses a block
|
||||
f.slashingKeeper.HandleValidatorSignature(f.ctx, val.Address(), newPower, false)
|
||||
f.slashingKeeper.HandleValidatorSignature(f.ctx, val.Address(), newPower, comet.BlockIDFlagAbsent)
|
||||
height++
|
||||
|
||||
// shouldn't be jailed/kicked yet
|
||||
@ -374,7 +375,7 @@ func TestValidatorDippingInAndOut(t *testing.T) {
|
||||
// misses 500 blocks + within the signing windows i.e. 700-1700
|
||||
// validators misses all 1000 blocks of a SignedBlockWindows
|
||||
for ; height < latest+1; height++ {
|
||||
f.slashingKeeper.HandleValidatorSignature(f.ctx.WithBlockHeight(height), val.Address(), newPower, false)
|
||||
f.slashingKeeper.HandleValidatorSignature(f.ctx.WithBlockHeight(height), val.Address(), newPower, comet.BlockIDFlagAbsent)
|
||||
}
|
||||
|
||||
// should now be jailed & kicked
|
||||
@ -401,7 +402,7 @@ func TestValidatorDippingInAndOut(t *testing.T) {
|
||||
// validator rejoins and starts signing again
|
||||
f.stakingKeeper.Unjail(f.ctx, consAddr)
|
||||
|
||||
f.slashingKeeper.HandleValidatorSignature(f.ctx, val.Address(), newPower, true)
|
||||
f.slashingKeeper.HandleValidatorSignature(f.ctx, val.Address(), newPower, comet.BlockIDFlagCommit)
|
||||
|
||||
// validator should not be kicked since we reset counter/array when it was jailed
|
||||
f.stakingKeeper.EndBlocker(f.ctx)
|
||||
@ -416,7 +417,7 @@ func TestValidatorDippingInAndOut(t *testing.T) {
|
||||
latest = f.slashingKeeper.SignedBlocksWindow(f.ctx) + height
|
||||
for ; height < latest+f.slashingKeeper.MinSignedPerWindow(f.ctx); height++ {
|
||||
f.ctx = f.ctx.WithBlockHeight(height)
|
||||
f.slashingKeeper.HandleValidatorSignature(f.ctx, val.Address(), newPower, false)
|
||||
f.slashingKeeper.HandleValidatorSignature(f.ctx, val.Address(), newPower, comet.BlockIDFlagAbsent)
|
||||
}
|
||||
|
||||
// validator should now be jailed & kicked
|
||||
|
||||
@ -22,7 +22,6 @@ func TestRollback(t *testing.T) {
|
||||
AppOpts: simtestutil.NewAppOptionsWithFlagHome(t.TempDir()),
|
||||
}
|
||||
app := simapp.NewSimappWithCustomOptions(t, false, options)
|
||||
app.Commit()
|
||||
ver0 := app.LastBlockHeight()
|
||||
// commit 10 blocks
|
||||
for i := int64(1); i <= 10; i++ {
|
||||
@ -30,10 +29,16 @@ func TestRollback(t *testing.T) {
|
||||
Height: ver0 + i,
|
||||
AppHash: app.LastCommitID().Hash,
|
||||
}
|
||||
app.BeginBlock(abci.RequestBeginBlock{Header: header})
|
||||
|
||||
app.FinalizeBlock(&abci.RequestFinalizeBlock{
|
||||
Height: header.Height,
|
||||
})
|
||||
ctx := app.NewContext(false, header)
|
||||
store := ctx.KVStore(app.GetKey("bank"))
|
||||
store.Set([]byte("key"), []byte(fmt.Sprintf("value%d", i)))
|
||||
app.FinalizeBlock(&abci.RequestFinalizeBlock{
|
||||
Height: header.Height,
|
||||
})
|
||||
app.Commit()
|
||||
}
|
||||
|
||||
@ -57,10 +62,13 @@ func TestRollback(t *testing.T) {
|
||||
Height: ver0 + i,
|
||||
AppHash: app.LastCommitID().Hash,
|
||||
}
|
||||
app.BeginBlock(abci.RequestBeginBlock{Header: header})
|
||||
app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: header.Height})
|
||||
ctx := app.NewContext(false, header)
|
||||
store := ctx.KVStore(app.GetKey("bank"))
|
||||
store.Set([]byte("key"), []byte(fmt.Sprintf("VALUE%d", i)))
|
||||
app.FinalizeBlock(&abci.RequestFinalizeBlock{
|
||||
Height: header.Height,
|
||||
})
|
||||
app.Commit()
|
||||
}
|
||||
|
||||
|
||||
@ -157,7 +157,7 @@ func Example_oneModule() {
|
||||
Params: params,
|
||||
},
|
||||
// this allows to the begin and end blocker of the module before and after the message
|
||||
integration.WithAutomaticBeginEndBlock(),
|
||||
integration.WithAutomaticFinalizeBlock(),
|
||||
// this allows to commit the state after the message
|
||||
integration.WithAutomaticCommit(),
|
||||
)
|
||||
|
||||
@ -2,17 +2,17 @@ package integration
|
||||
|
||||
// Config is the configuration for the integration app.
|
||||
type Config struct {
|
||||
AutomaticBeginEndBlock bool
|
||||
AutomaticFinalizeBlock bool
|
||||
AutomaticCommit bool
|
||||
}
|
||||
|
||||
// Option is a function that can be used to configure the integration app.
|
||||
type Option func(*Config)
|
||||
|
||||
// WithAutomaticBlockCreation enables begin/end block calls.
|
||||
func WithAutomaticBeginEndBlock() Option {
|
||||
// WithAutomaticFinalizeBlock calls ABCI finalize block.
|
||||
func WithAutomaticFinalizeBlock() Option {
|
||||
return func(cfg *Config) {
|
||||
cfg.AutomaticBeginEndBlock = true
|
||||
cfg.AutomaticFinalizeBlock = true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -4,13 +4,12 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
cmtabcitypes "github.com/cometbft/cometbft/abci/types"
|
||||
cmtproto "github.com/cometbft/cometbft/proto/tendermint/types"
|
||||
|
||||
"cosmossdk.io/log"
|
||||
"cosmossdk.io/store"
|
||||
"cosmossdk.io/store/metrics"
|
||||
storetypes "cosmossdk.io/store/types"
|
||||
cmtabcitypes "github.com/cometbft/cometbft/abci/types"
|
||||
cmtproto "github.com/cometbft/cometbft/proto/tendermint/types"
|
||||
dbm "github.com/cosmos/cosmos-db"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/baseapp"
|
||||
@ -32,13 +31,21 @@ const appName = "integration-app"
|
||||
type App struct {
|
||||
*baseapp.BaseApp
|
||||
|
||||
ctx sdk.Context
|
||||
logger log.Logger
|
||||
queryHelper *baseapp.QueryServiceTestHelper
|
||||
ctx sdk.Context
|
||||
logger log.Logger
|
||||
moduleManager module.Manager
|
||||
queryHelper *baseapp.QueryServiceTestHelper
|
||||
}
|
||||
|
||||
// NewIntegrationApp creates an application for testing purposes. This application is able to route messages to their respective handlers.
|
||||
func NewIntegrationApp(sdkCtx sdk.Context, logger log.Logger, keys map[string]*storetypes.KVStoreKey, appCodec codec.Codec, modules ...module.AppModule) *App {
|
||||
// NewIntegrationApp creates an application for testing purposes. This application
|
||||
// is able to route messages to their respective handlers.
|
||||
func NewIntegrationApp(
|
||||
sdkCtx sdk.Context,
|
||||
logger log.Logger,
|
||||
keys map[string]*storetypes.KVStoreKey,
|
||||
appCodec codec.Codec,
|
||||
modules ...module.AppModule,
|
||||
) *App {
|
||||
db := dbm.NewMemDB()
|
||||
|
||||
interfaceRegistry := codectypes.NewInterfaceRegistry()
|
||||
@ -50,22 +57,22 @@ func NewIntegrationApp(sdkCtx sdk.Context, logger log.Logger, keys map[string]*s
|
||||
bApp := baseapp.NewBaseApp(appName, logger, db, txConfig.TxDecoder(), baseapp.SetChainID(appName))
|
||||
bApp.MountKVStores(keys)
|
||||
|
||||
bApp.SetInitChainer(func(ctx sdk.Context, req cmtabcitypes.RequestInitChain) (cmtabcitypes.ResponseInitChain, error) {
|
||||
bApp.SetInitChainer(func(ctx sdk.Context, _ *cmtabcitypes.RequestInitChain) (*cmtabcitypes.ResponseInitChain, error) {
|
||||
for _, mod := range modules {
|
||||
if m, ok := mod.(module.HasGenesis); ok {
|
||||
m.InitGenesis(ctx, appCodec, m.DefaultGenesis(appCodec))
|
||||
}
|
||||
}
|
||||
|
||||
return cmtabcitypes.ResponseInitChain{}, nil
|
||||
return &cmtabcitypes.ResponseInitChain{}, nil
|
||||
})
|
||||
|
||||
moduleManager := module.NewManager(modules...)
|
||||
bApp.SetBeginBlocker(func(_ sdk.Context, req cmtabcitypes.RequestBeginBlock) (cmtabcitypes.ResponseBeginBlock, error) {
|
||||
return moduleManager.BeginBlock(sdkCtx, req)
|
||||
bApp.SetBeginBlocker(func(_ sdk.Context) (sdk.BeginBlock, error) {
|
||||
return moduleManager.BeginBlock(sdkCtx)
|
||||
})
|
||||
bApp.SetEndBlocker(func(_ sdk.Context, req cmtabcitypes.RequestEndBlock) (cmtabcitypes.ResponseEndBlock, error) {
|
||||
return moduleManager.EndBlock(sdkCtx, req)
|
||||
bApp.SetEndBlocker(func(_ sdk.Context) (sdk.EndBlock, error) {
|
||||
return moduleManager.EndBlock(sdkCtx)
|
||||
})
|
||||
|
||||
router := baseapp.NewMsgServiceRouter()
|
||||
@ -73,7 +80,6 @@ func NewIntegrationApp(sdkCtx sdk.Context, logger log.Logger, keys map[string]*s
|
||||
bApp.SetMsgServiceRouter(router)
|
||||
|
||||
if keys[consensusparamtypes.StoreKey] != nil {
|
||||
|
||||
// set baseApp param store
|
||||
consensusParamsKeeper := consensusparamkeeper.NewKeeper(appCodec, runtime.NewKVStoreService(keys[consensusparamtypes.StoreKey]), authtypes.NewModuleAddress("gov").String(), runtime.EventService{})
|
||||
bApp.SetParamStore(consensusParamsKeeper.ParamsStore)
|
||||
@ -81,13 +87,18 @@ func NewIntegrationApp(sdkCtx sdk.Context, logger log.Logger, keys map[string]*s
|
||||
if err := bApp.LoadLatestVersion(); err != nil {
|
||||
panic(fmt.Errorf("failed to load application version from store: %w", err))
|
||||
}
|
||||
bApp.InitChain(cmtabcitypes.RequestInitChain{ChainId: appName, ConsensusParams: simtestutil.DefaultConsensusParams})
|
||||
|
||||
if _, err := bApp.InitChain(&cmtabcitypes.RequestInitChain{ChainId: appName, ConsensusParams: simtestutil.DefaultConsensusParams}); err != nil {
|
||||
panic(fmt.Errorf("failed to initialize application: %w", err))
|
||||
}
|
||||
} else {
|
||||
if err := bApp.LoadLatestVersion(); err != nil {
|
||||
panic(fmt.Errorf("failed to load application version from store: %w", err))
|
||||
}
|
||||
bApp.InitChain(cmtabcitypes.RequestInitChain{ChainId: appName})
|
||||
|
||||
if _, err := bApp.InitChain(&cmtabcitypes.RequestInitChain{ChainId: appName}); err != nil {
|
||||
panic(fmt.Errorf("failed to initialize application: %w", err))
|
||||
}
|
||||
}
|
||||
|
||||
bApp.Commit()
|
||||
@ -95,39 +106,36 @@ func NewIntegrationApp(sdkCtx sdk.Context, logger log.Logger, keys map[string]*s
|
||||
ctx := sdkCtx.WithBlockHeader(cmtproto.Header{ChainID: appName}).WithIsCheckTx(true)
|
||||
|
||||
return &App{
|
||||
BaseApp: bApp,
|
||||
|
||||
logger: logger,
|
||||
ctx: ctx,
|
||||
queryHelper: baseapp.NewQueryServerTestHelper(ctx, interfaceRegistry),
|
||||
BaseApp: bApp,
|
||||
logger: logger,
|
||||
ctx: ctx,
|
||||
moduleManager: *moduleManager,
|
||||
queryHelper: baseapp.NewQueryServerTestHelper(ctx, interfaceRegistry),
|
||||
}
|
||||
}
|
||||
|
||||
// RunMsg allows to run a message and return the response.
|
||||
// RunMsg provides the ability to run a message and return the response.
|
||||
// In order to run a message, the application must have a handler for it.
|
||||
// These handlers are registered on the application message service router.
|
||||
// The result of the message execution is returned as a Any type.
|
||||
// The result of the message execution is returned as an Any type.
|
||||
// That any type can be unmarshaled to the expected response type.
|
||||
// If the message execution fails, an error is returned.
|
||||
func (app *App) RunMsg(msg sdk.Msg, option ...Option) (*codectypes.Any, error) {
|
||||
// set options
|
||||
cfg := Config{}
|
||||
cfg := &Config{}
|
||||
for _, opt := range option {
|
||||
opt(&cfg)
|
||||
opt(cfg)
|
||||
}
|
||||
|
||||
if cfg.AutomaticCommit {
|
||||
defer app.Commit()
|
||||
}
|
||||
|
||||
if cfg.AutomaticBeginEndBlock {
|
||||
if cfg.AutomaticFinalizeBlock {
|
||||
height := app.LastBlockHeight() + 1
|
||||
app.logger.Info("Running beging block", "height", height)
|
||||
app.BeginBlock(cmtabcitypes.RequestBeginBlock{Header: cmtproto.Header{Height: height, ChainID: appName}})
|
||||
defer func() {
|
||||
app.logger.Info("Running end block", "height", height)
|
||||
app.EndBlock(cmtabcitypes.RequestEndBlock{})
|
||||
}()
|
||||
if _, err := app.FinalizeBlock(&cmtabcitypes.RequestFinalizeBlock{Height: height}); err != nil {
|
||||
return nil, fmt.Errorf("failed to run finalize block: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
app.logger.Info("Running msg", "msg", msg.String())
|
||||
@ -155,8 +163,8 @@ func (app *App) RunMsg(msg sdk.Msg, option ...Option) (*codectypes.Any, error) {
|
||||
return response, nil
|
||||
}
|
||||
|
||||
// Context returns the application context.
|
||||
// It can be unwraped to a sdk.Context, with the sdk.UnwrapSDKContext function.
|
||||
// Context returns the application context. It can be unwrapped to a sdk.Context,
|
||||
// with the sdk.UnwrapSDKContext function.
|
||||
func (app *App) Context() context.Context {
|
||||
return app.ctx
|
||||
}
|
||||
@ -171,9 +179,11 @@ func (app *App) QueryHelper() *baseapp.QueryServiceTestHelper {
|
||||
func CreateMultiStore(keys map[string]*storetypes.KVStoreKey, logger log.Logger) storetypes.CommitMultiStore {
|
||||
db := dbm.NewMemDB()
|
||||
cms := store.NewCommitMultiStore(db, logger, metrics.NewNoOpMetrics())
|
||||
|
||||
for key := range keys {
|
||||
cms.MountStoreWithDB(keys[key], storetypes.StoreTypeIAVL, db)
|
||||
}
|
||||
|
||||
_ = cms.LoadLatestVersion()
|
||||
return cms
|
||||
}
|
||||
|
||||
@ -44,18 +44,6 @@ func (m *MockAppModuleWithAllExtensions) EXPECT() *MockAppModuleWithAllExtension
|
||||
return m.recorder
|
||||
}
|
||||
|
||||
// BeginBlock mocks base method.
|
||||
func (m *MockAppModuleWithAllExtensions) BeginBlock(arg0 types1.Context, arg1 types.RequestBeginBlock) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "BeginBlock", arg0, arg1)
|
||||
}
|
||||
|
||||
// BeginBlock indicates an expected call of BeginBlock.
|
||||
func (mr *MockAppModuleWithAllExtensionsMockRecorder) BeginBlock(arg0, arg1 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BeginBlock", reflect.TypeOf((*MockAppModuleWithAllExtensions)(nil).BeginBlock), arg0, arg1)
|
||||
}
|
||||
|
||||
// ConsensusVersion mocks base method.
|
||||
func (m *MockAppModuleWithAllExtensions) ConsensusVersion() uint64 {
|
||||
m.ctrl.T.Helper()
|
||||
@ -85,17 +73,18 @@ func (mr *MockAppModuleWithAllExtensionsMockRecorder) DefaultGenesis(arg0 interf
|
||||
}
|
||||
|
||||
// EndBlock mocks base method.
|
||||
func (m *MockAppModuleWithAllExtensions) EndBlock(arg0 types1.Context, arg1 types.RequestEndBlock) []types.ValidatorUpdate {
|
||||
func (m *MockAppModuleWithAllExtensions) EndBlock(arg0 context.Context) ([]types.ValidatorUpdate, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "EndBlock", arg0, arg1)
|
||||
ret := m.ctrl.Call(m, "EndBlock", arg0)
|
||||
ret0, _ := ret[0].([]types.ValidatorUpdate)
|
||||
return ret0
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// EndBlock indicates an expected call of EndBlock.
|
||||
func (mr *MockAppModuleWithAllExtensionsMockRecorder) EndBlock(arg0, arg1 interface{}) *gomock.Call {
|
||||
func (mr *MockAppModuleWithAllExtensionsMockRecorder) EndBlock(arg0 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EndBlock", reflect.TypeOf((*MockAppModuleWithAllExtensions)(nil).EndBlock), arg0, arg1)
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EndBlock", reflect.TypeOf((*MockAppModuleWithAllExtensions)(nil).EndBlock), arg0)
|
||||
}
|
||||
|
||||
// ExportGenesis mocks base method.
|
||||
|
||||
@ -653,234 +653,6 @@ func (mr *MockHasConsensusVersionMockRecorder) ConsensusVersion() *gomock.Call {
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConsensusVersion", reflect.TypeOf((*MockHasConsensusVersion)(nil).ConsensusVersion))
|
||||
}
|
||||
|
||||
// MockBeginBlockAppModule is a mock of BeginBlockAppModule interface.
|
||||
type MockBeginBlockAppModule struct {
|
||||
ctrl *gomock.Controller
|
||||
recorder *MockBeginBlockAppModuleMockRecorder
|
||||
}
|
||||
|
||||
// MockBeginBlockAppModuleMockRecorder is the mock recorder for MockBeginBlockAppModule.
|
||||
type MockBeginBlockAppModuleMockRecorder struct {
|
||||
mock *MockBeginBlockAppModule
|
||||
}
|
||||
|
||||
// NewMockBeginBlockAppModule creates a new mock instance.
|
||||
func NewMockBeginBlockAppModule(ctrl *gomock.Controller) *MockBeginBlockAppModule {
|
||||
mock := &MockBeginBlockAppModule{ctrl: ctrl}
|
||||
mock.recorder = &MockBeginBlockAppModuleMockRecorder{mock}
|
||||
return mock
|
||||
}
|
||||
|
||||
// EXPECT returns an object that allows the caller to indicate expected use.
|
||||
func (m *MockBeginBlockAppModule) EXPECT() *MockBeginBlockAppModuleMockRecorder {
|
||||
return m.recorder
|
||||
}
|
||||
|
||||
// BeginBlock mocks base method.
|
||||
func (m *MockBeginBlockAppModule) BeginBlock(arg0 types1.Context, arg1 types.RequestBeginBlock) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "BeginBlock", arg0, arg1)
|
||||
}
|
||||
|
||||
// BeginBlock indicates an expected call of BeginBlock.
|
||||
func (mr *MockBeginBlockAppModuleMockRecorder) BeginBlock(arg0, arg1 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BeginBlock", reflect.TypeOf((*MockBeginBlockAppModule)(nil).BeginBlock), arg0, arg1)
|
||||
}
|
||||
|
||||
// GetQueryCmd mocks base method.
|
||||
func (m *MockBeginBlockAppModule) GetQueryCmd() *cobra.Command {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetQueryCmd")
|
||||
ret0, _ := ret[0].(*cobra.Command)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// GetQueryCmd indicates an expected call of GetQueryCmd.
|
||||
func (mr *MockBeginBlockAppModuleMockRecorder) GetQueryCmd() *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetQueryCmd", reflect.TypeOf((*MockBeginBlockAppModule)(nil).GetQueryCmd))
|
||||
}
|
||||
|
||||
// GetTxCmd mocks base method.
|
||||
func (m *MockBeginBlockAppModule) GetTxCmd() *cobra.Command {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetTxCmd")
|
||||
ret0, _ := ret[0].(*cobra.Command)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// GetTxCmd indicates an expected call of GetTxCmd.
|
||||
func (mr *MockBeginBlockAppModuleMockRecorder) GetTxCmd() *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTxCmd", reflect.TypeOf((*MockBeginBlockAppModule)(nil).GetTxCmd))
|
||||
}
|
||||
|
||||
// Name mocks base method.
|
||||
func (m *MockBeginBlockAppModule) Name() string {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Name")
|
||||
ret0, _ := ret[0].(string)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// Name indicates an expected call of Name.
|
||||
func (mr *MockBeginBlockAppModuleMockRecorder) Name() *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Name", reflect.TypeOf((*MockBeginBlockAppModule)(nil).Name))
|
||||
}
|
||||
|
||||
// RegisterGRPCGatewayRoutes mocks base method.
|
||||
func (m *MockBeginBlockAppModule) RegisterGRPCGatewayRoutes(arg0 client.Context, arg1 *runtime.ServeMux) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "RegisterGRPCGatewayRoutes", arg0, arg1)
|
||||
}
|
||||
|
||||
// RegisterGRPCGatewayRoutes indicates an expected call of RegisterGRPCGatewayRoutes.
|
||||
func (mr *MockBeginBlockAppModuleMockRecorder) RegisterGRPCGatewayRoutes(arg0, arg1 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterGRPCGatewayRoutes", reflect.TypeOf((*MockBeginBlockAppModule)(nil).RegisterGRPCGatewayRoutes), arg0, arg1)
|
||||
}
|
||||
|
||||
// RegisterInterfaces mocks base method.
|
||||
func (m *MockBeginBlockAppModule) RegisterInterfaces(arg0 types0.InterfaceRegistry) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "RegisterInterfaces", arg0)
|
||||
}
|
||||
|
||||
// RegisterInterfaces indicates an expected call of RegisterInterfaces.
|
||||
func (mr *MockBeginBlockAppModuleMockRecorder) RegisterInterfaces(arg0 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterInterfaces", reflect.TypeOf((*MockBeginBlockAppModule)(nil).RegisterInterfaces), arg0)
|
||||
}
|
||||
|
||||
// RegisterLegacyAminoCodec mocks base method.
|
||||
func (m *MockBeginBlockAppModule) RegisterLegacyAminoCodec(arg0 *codec.LegacyAmino) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "RegisterLegacyAminoCodec", arg0)
|
||||
}
|
||||
|
||||
// RegisterLegacyAminoCodec indicates an expected call of RegisterLegacyAminoCodec.
|
||||
func (mr *MockBeginBlockAppModuleMockRecorder) RegisterLegacyAminoCodec(arg0 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterLegacyAminoCodec", reflect.TypeOf((*MockBeginBlockAppModule)(nil).RegisterLegacyAminoCodec), arg0)
|
||||
}
|
||||
|
||||
// MockEndBlockAppModule is a mock of EndBlockAppModule interface.
|
||||
type MockEndBlockAppModule struct {
|
||||
ctrl *gomock.Controller
|
||||
recorder *MockEndBlockAppModuleMockRecorder
|
||||
}
|
||||
|
||||
// MockEndBlockAppModuleMockRecorder is the mock recorder for MockEndBlockAppModule.
|
||||
type MockEndBlockAppModuleMockRecorder struct {
|
||||
mock *MockEndBlockAppModule
|
||||
}
|
||||
|
||||
// NewMockEndBlockAppModule creates a new mock instance.
|
||||
func NewMockEndBlockAppModule(ctrl *gomock.Controller) *MockEndBlockAppModule {
|
||||
mock := &MockEndBlockAppModule{ctrl: ctrl}
|
||||
mock.recorder = &MockEndBlockAppModuleMockRecorder{mock}
|
||||
return mock
|
||||
}
|
||||
|
||||
// EXPECT returns an object that allows the caller to indicate expected use.
|
||||
func (m *MockEndBlockAppModule) EXPECT() *MockEndBlockAppModuleMockRecorder {
|
||||
return m.recorder
|
||||
}
|
||||
|
||||
// EndBlock mocks base method.
|
||||
func (m *MockEndBlockAppModule) EndBlock(arg0 types1.Context, arg1 types.RequestEndBlock) []types.ValidatorUpdate {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "EndBlock", arg0, arg1)
|
||||
ret0, _ := ret[0].([]types.ValidatorUpdate)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// EndBlock indicates an expected call of EndBlock.
|
||||
func (mr *MockEndBlockAppModuleMockRecorder) EndBlock(arg0, arg1 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EndBlock", reflect.TypeOf((*MockEndBlockAppModule)(nil).EndBlock), arg0, arg1)
|
||||
}
|
||||
|
||||
// GetQueryCmd mocks base method.
|
||||
func (m *MockEndBlockAppModule) GetQueryCmd() *cobra.Command {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetQueryCmd")
|
||||
ret0, _ := ret[0].(*cobra.Command)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// GetQueryCmd indicates an expected call of GetQueryCmd.
|
||||
func (mr *MockEndBlockAppModuleMockRecorder) GetQueryCmd() *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetQueryCmd", reflect.TypeOf((*MockEndBlockAppModule)(nil).GetQueryCmd))
|
||||
}
|
||||
|
||||
// GetTxCmd mocks base method.
|
||||
func (m *MockEndBlockAppModule) GetTxCmd() *cobra.Command {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetTxCmd")
|
||||
ret0, _ := ret[0].(*cobra.Command)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// GetTxCmd indicates an expected call of GetTxCmd.
|
||||
func (mr *MockEndBlockAppModuleMockRecorder) GetTxCmd() *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTxCmd", reflect.TypeOf((*MockEndBlockAppModule)(nil).GetTxCmd))
|
||||
}
|
||||
|
||||
// Name mocks base method.
|
||||
func (m *MockEndBlockAppModule) Name() string {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Name")
|
||||
ret0, _ := ret[0].(string)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// Name indicates an expected call of Name.
|
||||
func (mr *MockEndBlockAppModuleMockRecorder) Name() *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Name", reflect.TypeOf((*MockEndBlockAppModule)(nil).Name))
|
||||
}
|
||||
|
||||
// RegisterGRPCGatewayRoutes mocks base method.
|
||||
func (m *MockEndBlockAppModule) RegisterGRPCGatewayRoutes(arg0 client.Context, arg1 *runtime.ServeMux) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "RegisterGRPCGatewayRoutes", arg0, arg1)
|
||||
}
|
||||
|
||||
// RegisterGRPCGatewayRoutes indicates an expected call of RegisterGRPCGatewayRoutes.
|
||||
func (mr *MockEndBlockAppModuleMockRecorder) RegisterGRPCGatewayRoutes(arg0, arg1 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterGRPCGatewayRoutes", reflect.TypeOf((*MockEndBlockAppModule)(nil).RegisterGRPCGatewayRoutes), arg0, arg1)
|
||||
}
|
||||
|
||||
// RegisterInterfaces mocks base method.
|
||||
func (m *MockEndBlockAppModule) RegisterInterfaces(arg0 types0.InterfaceRegistry) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "RegisterInterfaces", arg0)
|
||||
}
|
||||
|
||||
// RegisterInterfaces indicates an expected call of RegisterInterfaces.
|
||||
func (mr *MockEndBlockAppModuleMockRecorder) RegisterInterfaces(arg0 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterInterfaces", reflect.TypeOf((*MockEndBlockAppModule)(nil).RegisterInterfaces), arg0)
|
||||
}
|
||||
|
||||
// RegisterLegacyAminoCodec mocks base method.
|
||||
func (m *MockEndBlockAppModule) RegisterLegacyAminoCodec(arg0 *codec.LegacyAmino) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "RegisterLegacyAminoCodec", arg0)
|
||||
}
|
||||
|
||||
// RegisterLegacyAminoCodec indicates an expected call of RegisterLegacyAminoCodec.
|
||||
func (mr *MockEndBlockAppModuleMockRecorder) RegisterLegacyAminoCodec(arg0 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterLegacyAminoCodec", reflect.TypeOf((*MockEndBlockAppModule)(nil).RegisterLegacyAminoCodec), arg0)
|
||||
}
|
||||
|
||||
// MockHasABCIEndblock is a mock of HasABCIEndblock interface.
|
||||
type MockHasABCIEndblock struct {
|
||||
ctrl *gomock.Controller
|
||||
|
||||
@ -8,6 +8,7 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
cmtcfg "github.com/cometbft/cometbft/config"
|
||||
"github.com/cometbft/cometbft/node"
|
||||
"github.com/cometbft/cometbft/p2p"
|
||||
pvm "github.com/cometbft/cometbft/privval"
|
||||
@ -17,6 +18,7 @@ import (
|
||||
cmttime "github.com/cometbft/cometbft/types/time"
|
||||
"golang.org/x/sync/errgroup"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/server"
|
||||
"github.com/cosmos/cosmos-sdk/server/api"
|
||||
servergrpc "github.com/cosmos/cosmos-sdk/server/grpc"
|
||||
servercmtlog "github.com/cosmos/cosmos-sdk/server/log"
|
||||
@ -50,13 +52,14 @@ func startInProcess(cfg Config, val *Validator) error {
|
||||
return appGenesis.ToGenesisDoc()
|
||||
}
|
||||
|
||||
cmtApp := server.NewCometABCIWrapper(app)
|
||||
tmNode, err := node.NewNode( //resleak:notresource
|
||||
cmtCfg,
|
||||
pvm.LoadOrGenFilePV(cmtCfg.PrivValidatorKeyFile(), cmtCfg.PrivValidatorStateFile()),
|
||||
nodeKey,
|
||||
proxy.NewLocalClientCreator(app),
|
||||
proxy.NewLocalClientCreator(cmtApp),
|
||||
appGenesisProvider,
|
||||
node.DefaultDBProvider,
|
||||
cmtcfg.DefaultDBProvider,
|
||||
node.DefaultMetricsProvider(cmtCfg.Instrumentation),
|
||||
servercmtlog.CometLoggerWrapper{Logger: logger.With("module", val.Moniker)},
|
||||
)
|
||||
|
||||
@ -157,23 +157,24 @@ func SetupWithConfiguration(appConfig depinject.Config, startupConfig StartupCon
|
||||
}
|
||||
|
||||
// init chain will set the validator set and initialize the genesis accounts
|
||||
app.InitChain(
|
||||
abci.RequestInitChain{
|
||||
Validators: []abci.ValidatorUpdate{},
|
||||
ConsensusParams: DefaultConsensusParams,
|
||||
AppStateBytes: stateBytes,
|
||||
},
|
||||
)
|
||||
_, err = app.InitChain(&abci.RequestInitChain{
|
||||
Validators: []abci.ValidatorUpdate{},
|
||||
ConsensusParams: DefaultConsensusParams,
|
||||
AppStateBytes: stateBytes,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to init chain: %w", err)
|
||||
}
|
||||
|
||||
// commit genesis changes
|
||||
if !startupConfig.AtGenesis {
|
||||
app.Commit()
|
||||
app.BeginBlock(abci.RequestBeginBlock{Header: cmtproto.Header{
|
||||
_, err = app.FinalizeBlock(&abci.RequestFinalizeBlock{
|
||||
Height: app.LastBlockHeight() + 1,
|
||||
AppHash: app.LastCommitID().Hash,
|
||||
ValidatorsHash: valSet.Hash(),
|
||||
NextValidatorsHash: valSet.Hash(),
|
||||
}})
|
||||
})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to finalize block: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
return app, nil
|
||||
|
||||
@ -6,6 +6,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"cosmossdk.io/errors"
|
||||
types2 "github.com/cometbft/cometbft/abci/types"
|
||||
"github.com/cometbft/cometbft/proto/tendermint/types"
|
||||
"github.com/stretchr/testify/require"
|
||||
@ -120,20 +121,33 @@ func SignCheckDeliver(
|
||||
require.Nil(t, res)
|
||||
}
|
||||
|
||||
// Simulate a sending a transaction and committing a block
|
||||
app.BeginBlock(types2.RequestBeginBlock{Header: header})
|
||||
gInfo, res, err := app.SimDeliver(txCfg.TxEncoder(), tx)
|
||||
bz, err := txCfg.TxEncoder()(tx)
|
||||
require.NoError(t, err)
|
||||
|
||||
resBlock, err := app.FinalizeBlock(&types2.RequestFinalizeBlock{
|
||||
Height: header.Height,
|
||||
Txs: [][]byte{bz},
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
require.Equal(t, 1, len(resBlock.TxResults))
|
||||
txResult := resBlock.TxResults[0]
|
||||
finalizeSuccess := txResult.Code == 0
|
||||
if expPass {
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, res)
|
||||
require.True(t, finalizeSuccess)
|
||||
} else {
|
||||
require.Error(t, err)
|
||||
require.Nil(t, res)
|
||||
require.False(t, finalizeSuccess)
|
||||
}
|
||||
|
||||
app.EndBlock(types2.RequestEndBlock{})
|
||||
app.Commit()
|
||||
|
||||
return gInfo, res, err
|
||||
gInfo := sdk.GasInfo{GasWanted: uint64(txResult.GasWanted), GasUsed: uint64(txResult.GasUsed)}
|
||||
txRes := sdk.Result{Data: txResult.Data, Log: txResult.Log, Events: txResult.Events}
|
||||
if finalizeSuccess {
|
||||
err = nil
|
||||
} else {
|
||||
err = errors.ABCIError(txResult.Codespace, txResult.Code, txResult.Log)
|
||||
}
|
||||
|
||||
return gInfo, &txRes, err
|
||||
}
|
||||
|
||||
@ -9,7 +9,6 @@ import (
|
||||
"syscall"
|
||||
|
||||
"cosmossdk.io/log"
|
||||
abcitypes "github.com/cometbft/cometbft/abci/types"
|
||||
cmtcfg "github.com/cometbft/cometbft/config"
|
||||
cmted25519 "github.com/cometbft/cometbft/crypto/ed25519"
|
||||
"github.com/cometbft/cometbft/node"
|
||||
@ -17,7 +16,10 @@ import (
|
||||
"github.com/cometbft/cometbft/privval"
|
||||
"github.com/cometbft/cometbft/proxy"
|
||||
cmttypes "github.com/cometbft/cometbft/types"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/server"
|
||||
servercmtlog "github.com/cosmos/cosmos-sdk/server/log"
|
||||
servertypes "github.com/cosmos/cosmos-sdk/server/types"
|
||||
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
|
||||
)
|
||||
|
||||
@ -27,21 +29,15 @@ import (
|
||||
// As CometStart is more broadly used in the codebase,
|
||||
// the number of available methods on CometStarter will grow.
|
||||
type CometStarter struct {
|
||||
logger log.Logger
|
||||
|
||||
app abcitypes.Application
|
||||
|
||||
cfg *cmtcfg.Config
|
||||
valPrivKey cmted25519.PrivKey
|
||||
genesis []byte
|
||||
|
||||
rootDir string
|
||||
|
||||
rpcListen bool
|
||||
|
||||
logger log.Logger
|
||||
app servertypes.ABCI
|
||||
cfg *cmtcfg.Config
|
||||
valPrivKey cmted25519.PrivKey
|
||||
genesis []byte
|
||||
rootDir string
|
||||
rpcListen bool
|
||||
tcpAddrChooser func() string
|
||||
|
||||
startTries int
|
||||
startTries int
|
||||
}
|
||||
|
||||
// NewCometStarter accepts a minimal set of arguments to start comet with an ABCI app.
|
||||
@ -49,7 +45,7 @@ type CometStarter struct {
|
||||
//
|
||||
// NewCometStarter(...).Logger(...).Start()
|
||||
func NewCometStarter(
|
||||
app abcitypes.Application,
|
||||
app servertypes.ABCI,
|
||||
cfg *cmtcfg.Config,
|
||||
valPrivKey cmted25519.PrivKey,
|
||||
genesis []byte,
|
||||
@ -92,16 +88,12 @@ func NewCometStarter(
|
||||
// and bumping it up to 12 makes it almost never fail.
|
||||
const defaultStartTries = 12
|
||||
return &CometStarter{
|
||||
logger: log.NewNopLogger(),
|
||||
|
||||
app: app,
|
||||
|
||||
logger: log.NewNopLogger(),
|
||||
app: app,
|
||||
cfg: cfg,
|
||||
genesis: genesis,
|
||||
valPrivKey: valPrivKey,
|
||||
|
||||
rootDir: rootDir,
|
||||
|
||||
rootDir: rootDir,
|
||||
startTries: defaultStartTries,
|
||||
}
|
||||
}
|
||||
@ -132,8 +124,8 @@ func (s *CometStarter) Start() (n *node.Node, err error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Wrap this defer in an anonymous function so we don't immediately evaluate n,
|
||||
// which would always be nil at thi spoint.
|
||||
// Wrap this defer in an anonymous function so we don't immediately evaluate
|
||||
// n, which would always be nil at this point.
|
||||
defer func() {
|
||||
globalCometMu.Release(n)
|
||||
}()
|
||||
@ -153,6 +145,7 @@ func (s *CometStarter) Start() (n *node.Node, err error) {
|
||||
return appGenesis.ToGenesisDoc()
|
||||
}
|
||||
|
||||
cmtApp := server.NewCometABCIWrapper(s.app)
|
||||
for i := 0; i < s.startTries; i++ {
|
||||
s.cfg.P2P.ListenAddress = s.likelyAvailableAddress()
|
||||
if s.rpcListen {
|
||||
@ -163,9 +156,9 @@ func (s *CometStarter) Start() (n *node.Node, err error) {
|
||||
s.cfg,
|
||||
fpv,
|
||||
nodeKey,
|
||||
proxy.NewLocalClientCreator(s.app),
|
||||
proxy.NewLocalClientCreator(cmtApp),
|
||||
appGenesisProvider,
|
||||
node.DefaultDBProvider,
|
||||
cmtcfg.DefaultDBProvider,
|
||||
node.DefaultMetricsProvider(s.cfg.Instrumentation),
|
||||
servercmtlog.CometLoggerWrapper{Logger: s.logger},
|
||||
)
|
||||
|
||||
@ -44,9 +44,9 @@ func NewNetwork(nVals int, createCometStarter func(int) *CometStarter) (Nodes, e
|
||||
return
|
||||
}
|
||||
|
||||
// Notify that the new node's switch is available,
|
||||
// so this node can be peered with the other nodes.
|
||||
switchCh <- n.PEXReactor().Switch
|
||||
// Notify that the new node's switch is available, so this node can be
|
||||
// peered with the other nodes.
|
||||
switchCh <- n.Switch()
|
||||
|
||||
// And assign the node into its correct index in the ordered slice.
|
||||
nodes[i] = n
|
||||
|
||||
@ -12,15 +12,26 @@ import (
|
||||
// If totalWait has elapsed and the desired height has not been reached,
|
||||
// an error is returned.
|
||||
func WaitForNodeHeight(n *node.Node, desiredHeight int64, totalWait time.Duration) error {
|
||||
const backoff = 100 * time.Millisecond
|
||||
attempts := int64(totalWait / backoff)
|
||||
const backOff = 100 * time.Millisecond
|
||||
attempts := int64(totalWait / backOff)
|
||||
|
||||
// In Comet 0.37, the consensus state was exposed directly on the Node.
|
||||
// As of 0.38, the node no longer exposes consensus state,
|
||||
// but the consensus state is available as a field on the RPC environment.
|
||||
//
|
||||
// Luckily, in 0.38 the RPC environment is no longer a package-level singleton,
|
||||
// so retrieving the RPC environment for a single node should be safe.
|
||||
env, err := n.ConfigureRPC()
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to configure RPC to reach into consensus state: %w", err)
|
||||
}
|
||||
|
||||
curHeight := int64(-1)
|
||||
for i := int64(0); i < attempts; i++ {
|
||||
curHeight = n.ConsensusState().GetLastHeight()
|
||||
curHeight = env.ConsensusState.GetState().LastBlockHeight
|
||||
|
||||
if curHeight < desiredHeight {
|
||||
time.Sleep(backoff)
|
||||
time.Sleep(backOff)
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
@ -514,19 +514,11 @@ func (c *Client) blockTxs(ctx context.Context, height *int64) (crgtypes.BlockTra
|
||||
panic("block results transactions do now match block transactions")
|
||||
}
|
||||
// process begin and end block txs
|
||||
beginBlockTx := &rosettatypes.Transaction{
|
||||
finalizeBlockTx := &rosettatypes.Transaction{
|
||||
TransactionIdentifier: &rosettatypes.TransactionIdentifier{Hash: c.converter.ToRosetta().BeginBlockTxHash(blockInfo.BlockID.Hash)},
|
||||
Operations: AddOperationIndexes(
|
||||
nil,
|
||||
c.converter.ToRosetta().BalanceOps(StatusTxSuccess, blockResults.BeginBlockEvents),
|
||||
),
|
||||
}
|
||||
|
||||
endBlockTx := &rosettatypes.Transaction{
|
||||
TransactionIdentifier: &rosettatypes.TransactionIdentifier{Hash: c.converter.ToRosetta().EndBlockTxHash(blockInfo.BlockID.Hash)},
|
||||
Operations: AddOperationIndexes(
|
||||
nil,
|
||||
c.converter.ToRosetta().BalanceOps(StatusTxSuccess, blockResults.EndBlockEvents),
|
||||
c.converter.ToRosetta().BalanceOps(StatusTxSuccess, blockResults.FinalizeBlockEvents),
|
||||
),
|
||||
}
|
||||
|
||||
@ -541,9 +533,8 @@ func (c *Client) blockTxs(ctx context.Context, height *int64) (crgtypes.BlockTra
|
||||
}
|
||||
|
||||
finalTxs := make([]*rosettatypes.Transaction, 0, 2+len(deliverTx))
|
||||
finalTxs = append(finalTxs, beginBlockTx)
|
||||
finalTxs = append(finalTxs, deliverTx...)
|
||||
finalTxs = append(finalTxs, endBlockTx)
|
||||
finalTxs = append(finalTxs, finalizeBlockTx)
|
||||
|
||||
return crgtypes.BlockTransactionsResponse{
|
||||
BlockResponse: c.converter.ToRosetta().BlockResponse(blockInfo),
|
||||
|
||||
@ -69,7 +69,7 @@ type ToRosettaConverter interface {
|
||||
// SigningComponents returns rosetta's components required to build a signable transaction
|
||||
SigningComponents(tx authsigning.Tx, metadata *ConstructionMetadata, rosPubKeys []*rosettatypes.PublicKey) (txBytes []byte, payloadsToSign []*rosettatypes.SigningPayload, err error)
|
||||
// Tx converts a CometBFT transaction and tx result if provided to a rosetta tx
|
||||
Tx(rawTx cmttypes.Tx, txResult *abci.ResponseDeliverTx) (*rosettatypes.Transaction, error)
|
||||
Tx(rawTx cmttypes.Tx, txResult *abci.ExecTxResult) (*rosettatypes.Transaction, error)
|
||||
// TxIdentifiers converts a CometBFT tx to transaction identifiers
|
||||
TxIdentifiers(txs []cmttypes.Tx) []*rosettatypes.TransactionIdentifier
|
||||
// BalanceOps converts events to balance operations
|
||||
@ -265,7 +265,7 @@ func (c converter) Ops(status string, msg sdk.Msg) ([]*rosettatypes.Operation, e
|
||||
}
|
||||
|
||||
// Tx converts a CometBFT raw transaction and its result (if provided) to a rosetta transaction
|
||||
func (c converter) Tx(rawTx cmttypes.Tx, txResult *abci.ResponseDeliverTx) (*rosettatypes.Transaction, error) {
|
||||
func (c converter) Tx(rawTx cmttypes.Tx, txResult *abci.ExecTxResult) (*rosettatypes.Transaction, error) {
|
||||
// decode tx
|
||||
tx, err := c.txDecode(rawTx)
|
||||
if err != nil {
|
||||
|
||||
@ -6,8 +6,8 @@ require (
|
||||
cosmossdk.io/log v1.1.0
|
||||
cosmossdk.io/math v1.0.1
|
||||
github.com/coinbase/rosetta-sdk-go/types v1.0.0
|
||||
github.com/cometbft/cometbft v0.37.1
|
||||
github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230424095137-b73c17cb9cc8
|
||||
github.com/cometbft/cometbft v0.38.0-alpha.2
|
||||
github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230509085319-024850c8812e
|
||||
github.com/cosmos/rosetta-sdk-go v0.10.0
|
||||
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0
|
||||
github.com/spf13/cobra v1.7.0
|
||||
@ -27,18 +27,19 @@ require (
|
||||
filippo.io/edwards25519 v1.0.0 // indirect
|
||||
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
|
||||
github.com/99designs/keyring v1.2.1 // indirect
|
||||
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect
|
||||
github.com/DataDog/zstd v1.5.2 // indirect
|
||||
github.com/armon/go-metrics v0.4.1 // indirect
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect
|
||||
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
|
||||
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
|
||||
github.com/cespare/xxhash v1.1.0 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.2.0 // indirect
|
||||
github.com/cockroachdb/errors v1.9.1 // indirect
|
||||
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
|
||||
github.com/cockroachdb/pebble v0.0.0-20230412222916-60cfeb46143b // indirect
|
||||
github.com/cockroachdb/redact v1.1.3 // indirect
|
||||
github.com/cometbft/cometbft-db v0.7.0 // indirect
|
||||
github.com/cosmos/btcutil v1.0.5 // indirect
|
||||
github.com/cosmos/cosmos-db v1.0.0-rc.1 // indirect
|
||||
github.com/cosmos/cosmos-proto v1.0.0-beta.3 // indirect
|
||||
@ -51,6 +52,10 @@ require (
|
||||
github.com/danieljoos/wincred v1.1.2 // indirect
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
|
||||
github.com/dgraph-io/badger/v2 v2.2007.4 // indirect
|
||||
github.com/dgraph-io/ristretto v0.1.1 // indirect
|
||||
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
|
||||
github.com/dustin/go-humanize v1.0.1 // indirect
|
||||
github.com/dvsekhvalnov/jose2go v1.5.0 // indirect
|
||||
github.com/fatih/color v1.15.0 // indirect
|
||||
github.com/felixge/httpsnoop v1.0.2 // indirect
|
||||
@ -62,6 +67,7 @@ require (
|
||||
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
|
||||
github.com/gogo/googleapis v1.4.1 // indirect
|
||||
github.com/gogo/protobuf v1.3.2 // indirect
|
||||
github.com/golang/glog v1.1.0 // indirect
|
||||
github.com/golang/protobuf v1.5.3 // indirect
|
||||
github.com/golang/snappy v0.0.4 // indirect
|
||||
github.com/google/btree v1.1.2 // indirect
|
||||
@ -72,8 +78,6 @@ require (
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
|
||||
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
|
||||
github.com/gtank/merlin v0.1.1 // indirect
|
||||
github.com/gtank/ristretto255 v0.1.2 // indirect
|
||||
github.com/hashicorp/go-hclog v1.5.0 // indirect
|
||||
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
|
||||
github.com/hashicorp/go-plugin v1.4.9 // indirect
|
||||
@ -85,6 +89,7 @@ require (
|
||||
github.com/iancoleman/strcase v0.2.0 // indirect
|
||||
github.com/improbable-eng/grpc-web v0.15.0 // indirect
|
||||
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||
github.com/jmhodges/levigo v1.0.0 // indirect
|
||||
github.com/klauspost/compress v1.16.5 // indirect
|
||||
github.com/kr/pretty v0.3.1 // indirect
|
||||
github.com/kr/text v0.2.0 // indirect
|
||||
@ -94,10 +99,10 @@ require (
|
||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||
github.com/mattn/go-isatty v0.0.19 // indirect
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
|
||||
github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect
|
||||
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
|
||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||
github.com/mtibben/percent v0.2.1 // indirect
|
||||
github.com/oasisprotocol/curve25519-voi v0.0.0-20220708102147-0a8a51822cae // indirect
|
||||
github.com/oklog/run v1.1.0 // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.0.7 // indirect
|
||||
github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect
|
||||
@ -118,10 +123,12 @@ require (
|
||||
github.com/spf13/viper v1.15.0 // indirect
|
||||
github.com/subosito/gotenv v1.4.2 // indirect
|
||||
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
|
||||
github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect
|
||||
github.com/tendermint/go-amino v0.16.0 // indirect
|
||||
github.com/tidwall/btree v1.6.0 // indirect
|
||||
github.com/zondax/hid v0.9.1 // indirect
|
||||
github.com/zondax/ledger-go v0.14.1 // indirect
|
||||
go.etcd.io/bbolt v1.3.6 // indirect
|
||||
golang.org/x/crypto v0.9.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc // indirect
|
||||
golang.org/x/net v0.10.0 // indirect
|
||||
@ -142,6 +149,7 @@ require (
|
||||
// TODO: remove after merge of https://github.com/cosmos/cosmos-sdk/pull/15873 and tagging releases
|
||||
replace (
|
||||
cosmossdk.io/collections => ../../collections // TODO: remove me after collections v0.2.0 is released
|
||||
cosmossdk.io/core => ../../core
|
||||
cosmossdk.io/store => ../../store
|
||||
cosmossdk.io/x/tx => ../../x/tx
|
||||
github.com/cosmos/cosmos-sdk => ../..
|
||||
|
||||
@ -37,8 +37,6 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
|
||||
cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
|
||||
cosmossdk.io/api v0.4.1 h1:0ikaYM6GyxTYYcfBiyR8YnLCfhNnhKpEFnaSepCTmqg=
|
||||
cosmossdk.io/api v0.4.1/go.mod h1:jR7k5ok90LxW2lFUXvd8Vpo/dr4PpiyVegxdm7b1ZdE=
|
||||
cosmossdk.io/core v0.7.0 h1:GFss3qt2P9p23Cz24NnqLkslzb8n+B75A24x1JgJJp0=
|
||||
cosmossdk.io/core v0.7.0/go.mod h1:36hP0ZH/8ipsjzfcp0yKU4bqQXUGhS0/m1krWFCtwCc=
|
||||
cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z+zfw=
|
||||
cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU=
|
||||
cosmossdk.io/errors v1.0.0-beta.7.0.20230429155654-3ee8242364e4 h1:rOy7iw7HlwKc5Af5qIHLXdBx/F98o6du/I/WGwOW6eA=
|
||||
@ -57,8 +55,6 @@ github.com/99designs/keyring v1.2.1/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwR
|
||||
github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg=
|
||||
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4=
|
||||
github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno=
|
||||
github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo=
|
||||
github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
|
||||
@ -66,6 +62,8 @@ github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8=
|
||||
github.com/DataDog/zstd v1.5.2/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw=
|
||||
github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY=
|
||||
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=
|
||||
github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE=
|
||||
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
|
||||
github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0=
|
||||
github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
|
||||
github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
|
||||
@ -103,9 +101,9 @@ github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2
|
||||
github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
|
||||
github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U=
|
||||
github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04=
|
||||
github.com/btcsuite/btcd/btcutil v1.1.2 h1:XLMbX8JQEiwMcYft2EGi8zPUkoa0abKIU6/BJSRsjzQ=
|
||||
github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ=
|
||||
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U=
|
||||
github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA=
|
||||
github.com/bufbuild/protocompile v0.5.1 h1:mixz5lJX4Hiz4FpqFREJHIXLfaLBntfaJv1h+/jS+Qg=
|
||||
github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ=
|
||||
github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM=
|
||||
github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw=
|
||||
@ -113,6 +111,7 @@ github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8
|
||||
github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw=
|
||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
|
||||
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
|
||||
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
|
||||
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
@ -149,9 +148,10 @@ github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE
|
||||
github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM=
|
||||
github.com/coinbase/rosetta-sdk-go/types v1.0.0 h1:jpVIwLcPoOeCR6o1tU+Xv7r5bMONNbHU7MuEHboiFuA=
|
||||
github.com/coinbase/rosetta-sdk-go/types v1.0.0/go.mod h1:eq7W2TMRH22GTW0N0beDnN931DW0/WOI1R2sdHNHG4c=
|
||||
github.com/cometbft/cometbft v0.37.1 h1:KLxkQTK2hICXYq21U2hn1W5hOVYUdQgDQ1uB+90xPIg=
|
||||
github.com/cometbft/cometbft v0.37.1/go.mod h1:Y2MMMN//O5K4YKd8ze4r9jmk4Y7h0ajqILXbH5JQFVs=
|
||||
github.com/cometbft/cometbft v0.38.0-alpha.2 h1:iorYtE7u4kBgSe4JtruHsGR1RNSdVlrDwGOYKZ7h3zs=
|
||||
github.com/cometbft/cometbft v0.38.0-alpha.2/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k=
|
||||
github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo=
|
||||
github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0=
|
||||
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
|
||||
github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk=
|
||||
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
|
||||
@ -164,7 +164,6 @@ github.com/cosmos/cosmos-db v1.0.0-rc.1 h1:SjnT8B6WKMW9WEIX32qMhnEEKcI7ZP0+G1Sa9
|
||||
github.com/cosmos/cosmos-db v1.0.0-rc.1/go.mod h1:Dnmk3flSf5lkwCqvvjNpoxjpXzhxnCAFzKHlbaForso=
|
||||
github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o=
|
||||
github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I=
|
||||
github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y=
|
||||
github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY=
|
||||
github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw=
|
||||
github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE=
|
||||
@ -183,7 +182,6 @@ github.com/cosmos/rosetta-sdk-go v0.10.0/go.mod h1:SImAZkb96YbwvoRkzSMQB6noNJXFg
|
||||
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||
github.com/creachadair/taskgroup v0.4.2 h1:jsBLdAJE42asreGss2xZGZ8fJra7WtwnHWeJFxv2Li8=
|
||||
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
|
||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
github.com/cucumber/common/gherkin/go/v22 v22.0.0 h1:4K8NqptbvdOrjL9DEea6HFjSpbdT9+Q5kgLpmmsHYl0=
|
||||
@ -198,16 +196,20 @@ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etly
|
||||
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0=
|
||||
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I=
|
||||
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE=
|
||||
github.com/dgraph-io/badger v1.6.0 h1:DshxFxZWXUcO0xX476VJC07Xsr6ZCBVRHKZ93Oh7Evo=
|
||||
github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4=
|
||||
github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o=
|
||||
github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk=
|
||||
github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E=
|
||||
github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8=
|
||||
github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA=
|
||||
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
|
||||
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw=
|
||||
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y=
|
||||
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw=
|
||||
github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
|
||||
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
|
||||
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
|
||||
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
|
||||
github.com/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQxaLAeM=
|
||||
github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU=
|
||||
github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
|
||||
@ -226,6 +228,9 @@ github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.
|
||||
github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE=
|
||||
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
||||
github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw=
|
||||
github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0=
|
||||
github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A=
|
||||
github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk=
|
||||
github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8=
|
||||
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
|
||||
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
|
||||
@ -295,7 +300,7 @@ github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk=
|
||||
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0=
|
||||
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4=
|
||||
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||
github.com/gofrs/uuid v4.3.0+incompatible h1:CaSVZxm5B+7o45rtab4jC2G37WGYX1zQfuU2i6DSvnc=
|
||||
github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA=
|
||||
github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s=
|
||||
github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s=
|
||||
github.com/gogo/googleapis v1.4.1-0.20201022092350-68b0159b7869/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c=
|
||||
@ -311,6 +316,7 @@ github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY
|
||||
github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||
github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE=
|
||||
github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ=
|
||||
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
@ -343,6 +349,7 @@ github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu
|
||||
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
|
||||
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
|
||||
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4=
|
||||
@ -410,11 +417,6 @@ github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
|
||||
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU=
|
||||
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0=
|
||||
github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s=
|
||||
github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is=
|
||||
github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s=
|
||||
github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uMzcc=
|
||||
github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIvY4OmlYW69o=
|
||||
github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE=
|
||||
github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8=
|
||||
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
@ -478,6 +480,7 @@ github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrO
|
||||
github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c=
|
||||
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
|
||||
github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U=
|
||||
github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ=
|
||||
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
|
||||
github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
|
||||
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
|
||||
@ -505,6 +508,7 @@ github.com/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0
|
||||
github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
|
||||
github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
|
||||
github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
|
||||
github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg=
|
||||
github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI=
|
||||
github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
|
||||
github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
|
||||
@ -562,9 +566,6 @@ github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfr
|
||||
github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8=
|
||||
github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc=
|
||||
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
|
||||
github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM=
|
||||
github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 h1:QRUSJEgZn2Snx0EmT/QLXibWjSUDjKWvXIT19NBVp94=
|
||||
github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM=
|
||||
github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g=
|
||||
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
|
||||
github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||
@ -602,6 +603,8 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA
|
||||
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
|
||||
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
|
||||
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
|
||||
github.com/oasisprotocol/curve25519-voi v0.0.0-20220708102147-0a8a51822cae h1:FatpGJD2jmJfhZiFDElaC0QhZUDQnxUeAwTGkfAHN3I=
|
||||
github.com/oasisprotocol/curve25519-voi v0.0.0-20220708102147-0a8a51822cae/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s=
|
||||
github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs=
|
||||
github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
|
||||
github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA=
|
||||
@ -726,6 +729,9 @@ github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1
|
||||
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
|
||||
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
|
||||
github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY=
|
||||
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
|
||||
github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=
|
||||
github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
|
||||
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
|
||||
github.com/spf13/afero v1.9.3 h1:41FoI0fD7OR7mGcKE/aOiLkGreyf8ifIOQmJANWogMk=
|
||||
github.com/spf13/afero v1.9.3/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y=
|
||||
@ -771,6 +777,7 @@ github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNG
|
||||
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs=
|
||||
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48=
|
||||
github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzHWCjJB1zZfXPIAaDpzXIEJ0eS6B5Ok=
|
||||
github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8=
|
||||
github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E=
|
||||
github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME=
|
||||
github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg=
|
||||
@ -811,6 +818,7 @@ github.com/zondax/ledger-go v0.14.1 h1:Pip65OOl4iJ84WTpA4BKChvOufMhhbxED3BaihoZN
|
||||
github.com/zondax/ledger-go v0.14.1/go.mod h1:fZ3Dqg6qcdXWSOJFKMG8GCTnD7slO/RL2feOQv8K320=
|
||||
go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
|
||||
go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU=
|
||||
go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4=
|
||||
go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg=
|
||||
go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
|
||||
go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
|
||||
@ -841,7 +849,6 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U
|
||||
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
@ -1010,6 +1017,7 @@ golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
@ -1037,6 +1045,7 @@ golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBc
|
||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU=
|
||||
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
|
||||
@ -5,19 +5,7 @@ import (
|
||||
)
|
||||
|
||||
// InitChainer initializes application state at genesis
|
||||
type InitChainer func(ctx Context, req abci.RequestInitChain) (abci.ResponseInitChain, error)
|
||||
|
||||
// BeginBlocker runs code before the transactions in a block
|
||||
//
|
||||
// Note: applications which set create_empty_blocks=false will not have regular block timing and should use
|
||||
// e.g. BFT timestamps rather than block height for any periodic BeginBlock logic
|
||||
type BeginBlocker func(ctx Context, req abci.RequestBeginBlock) (abci.ResponseBeginBlock, error)
|
||||
|
||||
// EndBlocker runs code after the transactions in a block and return updates to the validator set
|
||||
//
|
||||
// Note: applications which set create_empty_blocks=false will not have regular block timing and should use
|
||||
// e.g. BFT timestamps rather than block height for any periodic EndBlock logic
|
||||
type EndBlocker func(ctx Context, req abci.RequestEndBlock) (abci.ResponseEndBlock, error)
|
||||
type InitChainer func(ctx Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error)
|
||||
|
||||
// PrepareCheckStater runs code during commit after the block has been committed, and the `checkState`
|
||||
// has been branched for the new block.
|
||||
@ -27,10 +15,46 @@ type PrepareCheckStater func(ctx Context)
|
||||
type Precommiter func(ctx Context)
|
||||
|
||||
// PeerFilter responds to p2p filtering queries from Tendermint
|
||||
type PeerFilter func(info string) abci.ResponseQuery
|
||||
type PeerFilter func(info string) *abci.ResponseQuery
|
||||
|
||||
// ProcessProposalHandler defines a function type alias for processing a proposer
|
||||
type ProcessProposalHandler func(Context, abci.RequestProcessProposal) abci.ResponseProcessProposal
|
||||
type ProcessProposalHandler func(Context, *abci.RequestProcessProposal) (*abci.ResponseProcessProposal, error)
|
||||
|
||||
// PrepareProposalHandler defines a function type alias for preparing a proposal
|
||||
type PrepareProposalHandler func(Context, abci.RequestPrepareProposal) abci.ResponsePrepareProposal
|
||||
type PrepareProposalHandler func(Context, *abci.RequestPrepareProposal) (*abci.ResponsePrepareProposal, error)
|
||||
|
||||
// ExtendVoteHandler defines a function type alias for extending a pre-commit vote.
|
||||
type ExtendVoteHandler func(Context, *abci.RequestExtendVote) (*abci.ResponseExtendVote, error)
|
||||
|
||||
// VerifyVoteExtensionHandler defines a function type alias for verifying a
|
||||
// pre-commit vote extension.
|
||||
type VerifyVoteExtensionHandler func(Context, *abci.RequestVerifyVoteExtension) (*abci.ResponseVerifyVoteExtension, error)
|
||||
|
||||
// BeginBlocker defines a function type alias for executing application
|
||||
// business logic before transactions are executed.
|
||||
//
|
||||
// Note: The BeginBlock ABCI method no longer exists in the ABCI specification
|
||||
// as of CometBFT v0.38.0. This function type alias is provided for backwards
|
||||
// compatibility with applications that still use the BeginBlock ABCI method
|
||||
// and allows for existing BeginBlock functionality within applications.
|
||||
type BeginBlocker func(Context) (BeginBlock, error)
|
||||
|
||||
// EndBlocker defines a function type alias for executing application
|
||||
// business logic after transactions are executed but before committing.
|
||||
//
|
||||
// Note: The EndBlock ABCI method no longer exists in the ABCI specification
|
||||
// as of CometBFT v0.38.0. This function type alias is provided for backwards
|
||||
// compatibility with applications that still use the EndBlock ABCI method
|
||||
// and allows for existing EndBlock functionality within applications.
|
||||
type EndBlocker func(Context) (EndBlock, error)
|
||||
|
||||
// EndBlock defines a type which contains endblock events and validator set updates
|
||||
type EndBlock struct {
|
||||
ValidatorUpdates []abci.ValidatorUpdate
|
||||
Events []abci.Event
|
||||
}
|
||||
|
||||
// BeginBlock defines a type which contains beginBlock events
|
||||
type BeginBlock struct {
|
||||
Events []abci.Event
|
||||
}
|
||||
|
||||
@ -16,6 +16,20 @@ import (
|
||||
"cosmossdk.io/core/header"
|
||||
)
|
||||
|
||||
// ExecMode defines the execution mode which can be set on a Context.
|
||||
type ExecMode uint8
|
||||
|
||||
// All possible execution modes.
|
||||
const (
|
||||
ExecModeCheck ExecMode = iota
|
||||
ExecModeReCheck
|
||||
ExecModeSimulate
|
||||
ExecModePrepareProposal
|
||||
ExecModeProcessProposal
|
||||
ExecModeVoteExtension
|
||||
ExecModeFinalize
|
||||
)
|
||||
|
||||
/*
|
||||
Context is an immutable object contains all information needed to
|
||||
process a request.
|
||||
@ -40,6 +54,7 @@ type Context struct {
|
||||
blockGasMeter storetypes.GasMeter
|
||||
checkTx bool
|
||||
recheckTx bool // if recheckTx == true, then checkTx must also be true
|
||||
execMode ExecMode
|
||||
minGasPrice DecCoins
|
||||
consParams cmtproto.ConsensusParams
|
||||
eventManager EventManagerI
|
||||
@ -67,6 +82,7 @@ func (c Context) GasMeter() storetypes.GasMeter { return c.gasMe
|
||||
func (c Context) BlockGasMeter() storetypes.GasMeter { return c.blockGasMeter }
|
||||
func (c Context) IsCheckTx() bool { return c.checkTx }
|
||||
func (c Context) IsReCheckTx() bool { return c.recheckTx }
|
||||
func (c Context) ExecMode() ExecMode { return c.execMode }
|
||||
func (c Context) MinGasPrices() DecCoins { return c.minGasPrice }
|
||||
func (c Context) EventManager() EventManagerI { return c.eventManager }
|
||||
func (c Context) Priority() int64 { return c.priority }
|
||||
@ -229,6 +245,7 @@ func (c Context) WithTransientKVGasConfig(gasConfig storetypes.GasConfig) Contex
|
||||
// WithIsCheckTx enables or disables CheckTx value for verifying transactions and returns an updated Context
|
||||
func (c Context) WithIsCheckTx(isCheckTx bool) Context {
|
||||
c.checkTx = isCheckTx
|
||||
c.execMode = ExecModeCheck
|
||||
return c
|
||||
}
|
||||
|
||||
@ -239,6 +256,13 @@ func (c Context) WithIsReCheckTx(isRecheckTx bool) Context {
|
||||
c.checkTx = true
|
||||
}
|
||||
c.recheckTx = isRecheckTx
|
||||
c.execMode = ExecModeReCheck
|
||||
return c
|
||||
}
|
||||
|
||||
// WithExecMode returns a Context with an updated ExecMode.
|
||||
func (c Context) WithExecMode(m ExecMode) Context {
|
||||
c.execMode = m
|
||||
return c
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user