Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add app v2 scaffolding and app config #6216

Draft
wants to merge 17 commits into
base: feat/depinject
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export GO111MODULE = on

# process build tags

build_tags = netgo
build_tags = netgo app_v2
ifeq ($(LEDGER_ENABLED),true)
ifeq ($(OS),Windows_NT)
GCCEXE = $(shell where gcc.exe 2> NUL)
Expand Down Expand Up @@ -333,8 +333,8 @@ lint-fix:

#? format: Run gofumpt and mispell
format:
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./docs/client/statik/statik.go" -not -path "./tests/mocks/*" -not -name '*.pb.go' -not -name '*.pb.gw.go' | xargs gofumpt -w
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./docs/client/statik/statik.go" -not -path "./tests/mocks/*" -not -name '*.pb.go' -not -name '*.pb.gw.go' | xargs misspell -w
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./docs/client/statik/statik.go" -not -path "./tests/mocks/*" -not -name '*.pb.go' -not -name '*.pb.gw.go' -not -name '*.pulsar.go' | xargs gofumpt -w
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./docs/client/statik/statik.go" -not -path "./tests/mocks/*" -not -name '*.pb.go' -not -name '*.pb.gw.go' -not -name '*.pulsar.go' | xargs misspell -w
.PHONY: format

#? docs-lint: Lint markdown documentation files
Expand Down
2 changes: 1 addition & 1 deletion api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ require (
github.com/cosmos/gogoproto v1.4.11
github.com/cosmos/ics23/go/api v0.0.0
google.golang.org/genproto/googleapis/api v0.0.0-20231012201019-e917dd12ba7a
google.golang.org/grpc v1.59.0
google.golang.org/protobuf v1.33.0
)

Expand All @@ -25,4 +24,5 @@ require (
golang.org/x/text v0.14.0 // indirect
google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405 // indirect
google.golang.org/grpc v1.59.0 // indirect
)
4 changes: 4 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ go 1.21

module github.com/cosmos/ibc-go/v8

// Replace to local pin of capability to pick up depinject
replace github.com/cosmos/ibc-go/modules/capability => ./modules/capability

require (
cosmossdk.io/api v0.7.3
cosmossdk.io/client/v2 v2.0.0-beta.1
Expand Down Expand Up @@ -87,6 +90,7 @@ require (
github.com/fatih/color v1.15.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/getsentry/sentry-go v0.27.0 // indirect
github.com/go-kit/kit v0.12.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
Expand Down
15 changes: 8 additions & 7 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,6 @@ github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8Jp
github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY=
github.com/cosmos/iavl v1.0.1 h1:D+mYbcRO2wptYzOM1Hxl9cpmmHU1ZEt9T2Wv5nZTeUw=
github.com/cosmos/iavl v1.0.1/go.mod h1:8xIUkgVvwvVrBu81scdPty+/Dx9GqwHnAvXz4cwF7RY=
github.com/cosmos/ibc-go/modules/capability v1.0.0 h1:r/l++byFtn7jHYa09zlAdSeevo8ci1mVZNO9+V0xsLE=
github.com/cosmos/ibc-go/modules/capability v1.0.0/go.mod h1:D81ZxzjZAe0ZO5ambnvn1qedsFQ8lOwtqicG6liLBco=
github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM=
github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0=
github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM=
Expand Down Expand Up @@ -445,6 +443,8 @@ 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.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0=
github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk=
github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps=
github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
Expand Down Expand Up @@ -484,18 +484,19 @@ github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+
github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho=
github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA=
github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI=
github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ=
github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU=
github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js=
github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU=
github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0=
github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo=
github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8=
github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw=
github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo=
github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM=
github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk=
github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
github.com/gobwas/ws v1.1.0 h1:7RFti/xnNkMJnrK7D1yQ/iCIB5OrrY/54/H930kIbHA=
github.com/gobwas/ws v1.1.0/go.mod h1:nzvNcVha5eUziGrbxFCo6qFIojQHjJV5cLYIbezhfL0=
github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=
github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
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=
Expand Down
3 changes: 2 additions & 1 deletion modules/capability/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import (
"fmt"
"time"

"cosmossdk.io/core/appmodule"
gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime"

"cosmossdk.io/core/appmodule"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/codec"
cdctypes "github.com/cosmos/cosmos-sdk/codec/types"
Expand Down
13 changes: 13 additions & 0 deletions modules/core/05-port/types/module.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package types

import (
"cosmossdk.io/depinject"

Check failure on line 4 in modules/core/05-port/types/module.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gci`-ed with --skip-generated -s standard -s default -s blank -s dot -s prefix(cosmossdk.io) -s prefix(github.com/cosmos/cosmos-sdk) -s prefix(github.com/cometbft/cometbft) -s prefix(github.com/cosmos/ibc-go) --custom-order (gci)

Check failure on line 4 in modules/core/05-port/types/module.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gci`-ed with --skip-generated -s standard -s default -s blank -s dot -s prefix(cosmossdk.io) -s prefix(github.com/cosmos/cosmos-sdk) -s prefix(github.com/cometbft/cometbft) -s prefix(github.com/cosmos/ibc-go) --custom-order (gci)
sdk "github.com/cosmos/cosmos-sdk/types"

capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types"
Expand All @@ -9,6 +10,18 @@
"github.com/cosmos/ibc-go/v8/modules/core/exported"
)

var _ depinject.ManyPerContainerType = (*IBCModuleRoute)(nil)

// IBCModule defines a wrapper struct for depinject. This allows cosmos-sdk modules to output multiple IBCModules associated with a
// specific name used for a routing key. An example of this is 27-interchain-accounts which defines two IBCModules under a single cosmos-sdk module.
type IBCModuleRoute struct {
Name string
IBCModule IBCModule
}

// IsManyPerContainerType implements the depinject.ManyPerContainerType interface.
func (IBCModuleRoute) IsManyPerContainerType() {}

// IBCModule defines an interface that implements all the callbacks
// that modules must define as specified in ICS-26
type IBCModule interface {
Expand Down
46 changes: 38 additions & 8 deletions modules/core/depinject.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ import (
modulev1 "github.com/cosmos/ibc-go/api/ibc/core/module/v1"
capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper"
clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types"
"github.com/cosmos/ibc-go/v8/modules/core/exported"
ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper"
ibctm "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint"
)

var _ depinject.OnePerModuleType = AppModule{}
Expand All @@ -25,6 +28,7 @@ func init() {
appmodule.Register(
&modulev1.Module{},
appmodule.Provide(ProvideModule),
appmodule.Invoke(InvokeAddAppRoutes, InvokeAddClientRoutes),
)
}

Expand All @@ -36,9 +40,9 @@ type ModuleInputs struct {
Cdc codec.Codec
Key *storetypes.KVStoreKey

ConsensusHost clienttypes.ConsensusHost
Copy link
Member Author

@damiannolan damiannolan Apr 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately I haven't figured out a way to inject this interface type into the DI container yet. This is not a module output from another module and is instead created in app.go (v1). The concrete implementation type is ibc tendermint in almost all cases for cometbft chains. The constructor takes the staking keeper as an argument.

app v1 snippet:

consensusHost := ibctm.NewConsensusHost(app.StakingKeeper)
app.IBCKeeper = ibckeeper.NewKeeper(consensusHost, args...)

For now (while this PR is work-in-progress), we take the staking keeper as a module input and default to ibctm.NewConsensusHost

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ConsensusHost will be deleted by the time this is picked back up

UpgradeKeeper clienttypes.UpgradeKeeper
ScopedKeeper capabilitykeeper.ScopedKeeper
CapabilityKeeper *capabilitykeeper.Keeper
StakingKeeper clienttypes.StakingKeeper
UpgradeKeeper clienttypes.UpgradeKeeper

// LegacySubspace is used solely for migration of x/params managed parameters
LegacySubspace paramtypes.Subspace `optional:"true"`
Expand All @@ -48,27 +52,53 @@ type ModuleInputs struct {
type ModuleOutputs struct {
depinject.Out

IbcKeeper *ibckeeper.Keeper
Module appmodule.AppModule
Module appmodule.AppModule

IBCKeeper *ibckeeper.Keeper
ScopedKeeper capabilitykeeper.ScopedKeeper
}

// ProvideModule defines a depinject provider function to supply the module dependencies and return its outputs.
func ProvideModule(in ModuleInputs) ModuleOutputs {
// default to governance authority if not provided
authority := authtypes.NewModuleAddress(govtypes.ModuleName)
if in.Config.Authority != "" {
authority = authtypes.NewModuleAddressOrBech32Address(in.Config.Authority)
}

scopedKeeper := in.CapabilityKeeper.ScopeToModule(exported.ModuleName)

keeper := ibckeeper.NewKeeper(
in.Cdc,
in.Key,
in.LegacySubspace,
in.ConsensusHost,
ibctm.NewConsensusHost(in.StakingKeeper), // NOTE: need to find a way to inject a ConsensusHost into DI container created outside context of app module.
in.UpgradeKeeper,
in.ScopedKeeper,
scopedKeeper,
authority.String(),
)
m := NewAppModule(keeper)

return ModuleOutputs{IbcKeeper: keeper, Module: m}
return ModuleOutputs{Module: m, IBCKeeper: keeper, ScopedKeeper: scopedKeeper}
}

// InvokeAddAppRoutes defines a depinject Invoker for registering ibc application modules on the core ibc application router.
func InvokeAddAppRoutes(keeper *ibckeeper.Keeper, appRoutes []porttypes.IBCModuleRoute) {
Copy link
Member Author

@damiannolan damiannolan Apr 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In contrast to https://github.com/cosmos/ibc-go/pull/6216/files#r1581785698, there is a bit of a gotcha when it comes to IBC apps. We cannot simply rely on the module name as the router key as some sdk modules may container more than one IBCModule. For example, ica contains icacontroller and icahost.

Here I added a wrapper type to 05-port called IBCModuleRoute. This associates an IBCModule with a name key. This type implements a different depinject interface to that mentioned in https://github.com/cosmos/ibc-go/pull/6216/files#r1581785698 called ManyPerModuleType. We can return one or more IBCModuleRoute in a list from our ibc app module outputs, and as I understand the DI container is smart enough to collect these and pass to the invoker after providing each app module.

ibcRouter := porttypes.NewRouter()

for _, route := range appRoutes {
ibcRouter.AddRoute(route.Name, route.IBCModule)
}

ibcRouter.Seal()
}

// InvokeAddClientRoutes defines a depinject Invoker for registering ibc light client modules on the core ibc client router.
// TODO: Maybe this should align with app router. i.e. create router here, add routes, and set on ibc keeper.
// For app_v1 this would be the same approach, just create clientRouter in app.go instead of implicit creation inside of ibc.NewKeeper()
func InvokeAddClientRoutes(keeper *ibckeeper.Keeper, clientRoutes map[string]exported.LightClientModule) {
Copy link
Member Author

@damiannolan damiannolan Apr 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lightclient modules implement IsOnePerModuleType() and return the LightClientModule in module outputs. Afaik when the DI container has finished providing all modules, then invokers are run. The DI container can collect the LightClientModules returned in module outputs into a map, because it is OnePerModuleType the key is the module name - e.g. 07-tendermint

This is my understanding. TBC when I get this all wired up together with tests!

edit:

Lightclient modules implement IsOnePerModuleType() and return the LightClientModule in module outputs.

This doesn't seem to work with interface types(?). What does work is adding a wrapper struct for LightClientModule interface and returning that in module outputs. Implemented in 5a72470 similarly to GovHooksWrapper (ref)

router := keeper.ClientKeeper.GetRouter()
for modName, route := range clientRoutes {
router.AddRoute(modName, route)
}
}
8 changes: 7 additions & 1 deletion modules/light-clients/06-solomachine/depinject.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,17 @@ import (
modulev1 "github.com/cosmos/ibc-go/api/ibc/lightclients/solomachine/module/v1"
)

var _ depinject.OnePerModuleType = AppModule{}
var (
_ depinject.OnePerModuleType = AppModule{}
_ depinject.OnePerModuleType = LightClientModule{}
)

// IsOnePerModuleType implements the depinject.OnePerModuleType interface.
func (AppModule) IsOnePerModuleType() {}

// IsOnePerModuleType implements the depinject.OnePerModuleType interface.
func (LightClientModule) IsOnePerModuleType() {}

func init() {
appmodule.Register(
&modulev1.Module{},
Expand Down
8 changes: 7 additions & 1 deletion modules/light-clients/07-tendermint/depinject.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,17 @@ import (
modulev1 "github.com/cosmos/ibc-go/api/ibc/lightclients/tendermint/module/v1"
)

var _ depinject.OnePerModuleType = AppModule{}
var (
_ depinject.OnePerModuleType = AppModule{}
_ depinject.OnePerModuleType = LightClientModule{}
)

// IsOnePerModuleType implements the depinject.OnePerModuleType interface.
func (AppModule) IsOnePerModuleType() {}

// IsOnePerModuleType implements the depinject.OnePerModuleType interface.
func (LightClientModule) IsOnePerModuleType() {}

func init() {
appmodule.Register(
&modulev1.Module{},
Expand Down
84 changes: 84 additions & 0 deletions testing/simapp/abci.go
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copied from sdk simapp. I don't think this is really needed, its just a mock vote extension handler. We can remove it if needs be

Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
package simapp

import (
"bytes"
"crypto/rand"
"encoding/json"
"fmt"

"github.com/cosmos/cosmos-sdk/baseapp"
sdk "github.com/cosmos/cosmos-sdk/types"

abci "github.com/cometbft/cometbft/abci/types"
)

type (
// VoteExtensionHandler defines a dummy vote extension handler for SimApp.
//
// NOTE: This implementation is solely used for testing purposes. DO NOT use
// in a production application!
VoteExtensionHandler struct{}

// VoteExtension defines the structure used to create a dummy vote extension.
VoteExtension struct {
Hash []byte
Height int64
Data []byte
}
)

func NewVoteExtensionHandler() *VoteExtensionHandler {
return &VoteExtensionHandler{}
}

func (h *VoteExtensionHandler) SetHandlers(bApp *baseapp.BaseApp) {
bApp.SetExtendVoteHandler(h.ExtendVote())
bApp.SetVerifyVoteExtensionHandler(h.VerifyVoteExtension())
}

func (*VoteExtensionHandler) ExtendVote() sdk.ExtendVoteHandler {
return func(_ sdk.Context, req *abci.RequestExtendVote) (*abci.ResponseExtendVote, error) {
buf := make([]byte, 1024)

_, err := rand.Read(buf)
if err != nil {
return nil, fmt.Errorf("failed to generate random vote extension data: %w", err)
}

ve := VoteExtension{
Hash: req.Hash,
Height: req.Height,
Data: buf,
}

bz, err := json.Marshal(ve)
if err != nil {
return nil, fmt.Errorf("failed to encode vote extension: %w", err)
}

return &abci.ResponseExtendVote{VoteExtension: bz}, nil
}
}

func (*VoteExtensionHandler) VerifyVoteExtension() sdk.VerifyVoteExtensionHandler {
return func(ctx sdk.Context, req *abci.RequestVerifyVoteExtension) (*abci.ResponseVerifyVoteExtension, error) {
var ve VoteExtension

if err := json.Unmarshal(req.VoteExtension, &ve); err != nil {
return &abci.ResponseVerifyVoteExtension{Status: abci.ResponseVerifyVoteExtension_REJECT}, nil
}

switch {
case req.Height != ve.Height:
return &abci.ResponseVerifyVoteExtension{Status: abci.ResponseVerifyVoteExtension_REJECT}, nil

case !bytes.Equal(req.Hash, ve.Hash):
return &abci.ResponseVerifyVoteExtension{Status: abci.ResponseVerifyVoteExtension_REJECT}, nil

case len(ve.Data) != 1024:
return &abci.ResponseVerifyVoteExtension{Status: abci.ResponseVerifyVoteExtension_REJECT}, nil
}

return &abci.ResponseVerifyVoteExtension{Status: abci.ResponseVerifyVoteExtension_ACCEPT}, nil
}
}
2 changes: 2 additions & 0 deletions testing/simapp/app.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !app_v2

package simapp

import (
Expand Down
Loading
Loading