Co-authored-by: Tyler <48813565+technicallyty@users.noreply.github.com> Co-authored-by: Julien Robert <julien@rbrt.fr>
This commit is contained in:
parent
92af502815
commit
117006b281
@ -12,7 +12,7 @@ require (
|
||||
cosmossdk.io/log v1.5.0
|
||||
cosmossdk.io/math v1.4.0
|
||||
cosmossdk.io/runtime/v2 v2.0.0-20241219154748-69025c556666 // main
|
||||
cosmossdk.io/server/v2 v2.0.0-beta.1 // main
|
||||
cosmossdk.io/server/v2 v2.0.0-beta.1.0.20250106081242-884a7a51c3c3 // main
|
||||
cosmossdk.io/server/v2/cometbft v1.0.0-beta.1
|
||||
cosmossdk.io/store/v2 v2.0.0-beta.1 // main
|
||||
cosmossdk.io/tools/benchmark v0.2.0-rc.1
|
||||
@ -45,7 +45,7 @@ require (
|
||||
github.com/spf13/pflag v1.0.5
|
||||
github.com/spf13/viper v1.19.0
|
||||
github.com/stretchr/testify v1.10.0
|
||||
google.golang.org/protobuf v1.36.0
|
||||
google.golang.org/protobuf v1.36.1
|
||||
)
|
||||
|
||||
require (
|
||||
|
||||
@ -218,8 +218,8 @@ cosmossdk.io/runtime/v2 v2.0.0-20241219154748-69025c556666 h1:zFMi1URvs3NiJdSf2z
|
||||
cosmossdk.io/runtime/v2 v2.0.0-20241219154748-69025c556666/go.mod h1:C0MTcmQlZFPQvYoXzYiWP+h9lFOgezzafEFiQBa6xYo=
|
||||
cosmossdk.io/schema v1.0.0 h1:/diH4XJjpV1JQwuIozwr+A4uFuuwanFdnw2kKeiXwwQ=
|
||||
cosmossdk.io/schema v1.0.0/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ=
|
||||
cosmossdk.io/server/v2 v2.0.0-beta.1 h1:mMfWf7wVEv6oVZcgxEZ52x8h/bOuGRjdSrUAEqNQmf4=
|
||||
cosmossdk.io/server/v2 v2.0.0-beta.1/go.mod h1:lfkdTKM2tMlt6KhNi5f9zT+Ww5HcRpnINWjeKXCHjmc=
|
||||
cosmossdk.io/server/v2 v2.0.0-beta.1.0.20250106081242-884a7a51c3c3 h1:r7zBzz+Xs0rAGx/ia/5tNgM2Y4xa+SkU+Rli1mIsTRI=
|
||||
cosmossdk.io/server/v2 v2.0.0-beta.1.0.20250106081242-884a7a51c3c3/go.mod h1:vqgLhoQRRFyRUrLrDj7S18ojvgP8f0X+S1t6CME6GcQ=
|
||||
cosmossdk.io/server/v2/appmanager v1.0.0-beta.1 h1:EISWki+z9SDAt3OJnUl2y5Ow4qjOb+epYjLb1C7CN/E=
|
||||
cosmossdk.io/server/v2/appmanager v1.0.0-beta.1/go.mod h1:RVYxIaEdIT10nWSRqbwKDLFWfvCVx+cwAorCyPAQg9A=
|
||||
cosmossdk.io/server/v2/cometbft v1.0.0-beta.1 h1:kzTMGqIwcpcynbnU0Wyoe0HObyUUBZbkD/sHBUrbZl8=
|
||||
@ -1484,8 +1484,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ
|
||||
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
||||
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
||||
google.golang.org/protobuf v1.36.0 h1:mjIs9gYtt56AzC4ZaffQuh88TZurBGhIJMBZGSxNerQ=
|
||||
google.golang.org/protobuf v1.36.0/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
|
||||
google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk=
|
||||
google.golang.org/protobuf v1.36.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
|
||||
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
|
||||
@ -30,7 +30,6 @@ import (
|
||||
"github.com/cosmos/cosmos-sdk/client/rpc"
|
||||
sdktelemetry "github.com/cosmos/cosmos-sdk/telemetry"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/types/module"
|
||||
txtypes "github.com/cosmos/cosmos-sdk/types/tx"
|
||||
"github.com/cosmos/cosmos-sdk/version"
|
||||
authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli"
|
||||
@ -157,6 +156,7 @@ func InitRootCmd[T transaction.Tx](
|
||||
logger,
|
||||
deps.GlobalConfig,
|
||||
simApp.InterfaceRegistry(),
|
||||
simApp.App.AppManager,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -278,10 +278,4 @@ func registerGRPCGatewayRoutes[T transaction.Tx](
|
||||
cmtservice.RegisterGRPCGatewayRoutes(deps.ClientContext, server.GRPCGatewayRouter)
|
||||
_ = nodeservice.RegisterServiceHandlerClient(context.Background(), server.GRPCGatewayRouter, nodeservice.NewServiceClient(deps.ClientContext))
|
||||
_ = txtypes.RegisterServiceHandlerClient(context.Background(), server.GRPCGatewayRouter, txtypes.NewServiceClient(deps.ClientContext))
|
||||
|
||||
for _, mod := range deps.ModuleManager.Modules() {
|
||||
if gmod, ok := mod.(module.HasGRPCGateway); ok {
|
||||
gmod.RegisterGRPCGatewayRoutes(deps.ClientContext, server.GRPCGatewayRouter)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -179,20 +179,26 @@ func TestDistrValidatorGRPCQueries(t *testing.T) {
|
||||
|
||||
// test validator slashes grpc endpoint
|
||||
slashURL := baseurl + `/cosmos/distribution/v1beta1/validators/%s/slashes`
|
||||
invalidHeightOutput := `{"code":3, "message":"strconv.ParseUint: parsing \"-3\": invalid syntax", "details":[]}`
|
||||
invalidStartingHeightOutput := `{"code":3, "message":"1 error(s) decoding:\n\n* cannot parse 'starting_height' as uint: strconv.ParseUint: parsing \"-3\": invalid syntax", "details":[]}`
|
||||
invalidEndingHeightOutput := `{"code":3, "message":"1 error(s) decoding:\n\n* cannot parse 'ending_height' as uint: strconv.ParseUint: parsing \"-3\": invalid syntax", "details":[]}`
|
||||
|
||||
if !systest.IsV2() {
|
||||
invalidStartingHeightOutput = `{"code":3, "message":"strconv.ParseUint: parsing \"-3\": invalid syntax", "details":[]}`
|
||||
invalidEndingHeightOutput = invalidStartingHeightOutput
|
||||
}
|
||||
|
||||
slashTestCases := []systest.RestTestCase{
|
||||
{
|
||||
Name: "invalid start height",
|
||||
Url: fmt.Sprintf(slashURL+`?starting_height=%s&ending_height=%s`, valOperAddr, "-3", "3"),
|
||||
ExpCode: http.StatusBadRequest,
|
||||
ExpOut: invalidHeightOutput,
|
||||
ExpOut: invalidStartingHeightOutput,
|
||||
},
|
||||
{
|
||||
Name: "invalid end height",
|
||||
Url: fmt.Sprintf(slashURL+`?starting_height=%s&ending_height=%s`, valOperAddr, "1", "-3"),
|
||||
ExpCode: http.StatusBadRequest,
|
||||
ExpOut: invalidHeightOutput,
|
||||
ExpOut: invalidEndingHeightOutput,
|
||||
},
|
||||
{
|
||||
Name: "valid request get slashes",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user