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

refactor!: use x/tx/signing in client.TxConfig #15822

Merged
merged 66 commits into from
Apr 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
db53c1d
Hard break client.TxConfig
kocubinski Apr 12, 2023
0019cb9
incorporate changes from #15713
kocubinski Apr 12, 2023
f44fee6
Hard fixing
kocubinski Apr 12, 2023
49c18df
Merge branch 'main' into kocubinski/tx-config-break
kocubinski Apr 12, 2023
14539c4
go mod tidy
kocubinski Apr 12, 2023
5f2b4de
fix breakage in codec from latest main
kocubinski Apr 12, 2023
02c2340
Merge branch 'main' of github.com:cosmos/cosmos-sdk into kocubinski/t…
kocubinski Apr 13, 2023
147cbdf
remove replace for x/tx
kocubinski Apr 13, 2023
55e1d36
revert codec/ compat for x/tx 0.6.0
kocubinski Apr 13, 2023
55acfe3
x/tx v0.5.1
kocubinski Apr 13, 2023
bedd4b9
add err handling
kocubinski Apr 13, 2023
21927ef
checkpoint, proto gen
kocubinski Apr 13, 2023
623bacf
adjust lots of tests
kocubinski Apr 13, 2023
43ea1b4
fixed ante tests
kocubinski Apr 13, 2023
e32f007
Merge branch 'main' of github.com:cosmos/cosmos-sdk into kocubinski/t…
kocubinski Apr 13, 2023
bff8090
merged fix
kocubinski Apr 13, 2023
0a25910
revert (temporarily) x/tx to 0.5.1
kocubinski Apr 13, 2023
3f0a4f2
rm files
kocubinski Apr 13, 2023
d24dbc2
fix tx_test
kocubinski Apr 13, 2023
2e62758
revert x/tx
kocubinski Apr 13, 2023
2c9bd78
comment
kocubinski Apr 14, 2023
863c869
Merge branch 'main' of github.com:cosmos/cosmos-sdk into kocubinski/t…
kocubinski Apr 14, 2023
e0cecb1
maybe some fixes
kocubinski Apr 14, 2023
d0317b3
fix more test/build failures
kocubinski Apr 14, 2023
8365099
use x/tx 0.5.3
kocubinski Apr 14, 2023
ec82685
Merge branch 'main' into kocubinski/tx-config-break
kocubinski Apr 14, 2023
dc0d717
update rosetta go.mod
kocubinski Apr 14, 2023
c4c4cdd
Merge branch 'kocubinski/tx-config-break' of github.com:cosmos/cosmos…
kocubinski Apr 14, 2023
6e691fc
liniting
kocubinski Apr 14, 2023
0010ceb
linting fixes
kocubinski Apr 14, 2023
0b9eb03
lint fix
kocubinski Apr 14, 2023
4843d63
Merge branch 'main' of github.com:cosmos/cosmos-sdk into kocubinski/t…
kocubinski Apr 17, 2023
caf6987
clean up config
kocubinski Apr 17, 2023
a246afc
go mod tidy
kocubinski Apr 17, 2023
c6f2033
tidy rosetta
kocubinski Apr 17, 2023
978f4f4
rwmutex
kocubinski Apr 17, 2023
a8069dc
lint fix
kocubinski Apr 17, 2023
3851398
proper lazy init with sync.once
kocubinski Apr 17, 2023
6c363f5
clean up todos
kocubinski Apr 18, 2023
c66aefd
Merge branch 'main' of github.com:cosmos/cosmos-sdk into kocubinski/t…
kocubinski Apr 18, 2023
8fc3108
clean up, comments
kocubinski Apr 18, 2023
7364f41
attempt remove redundant arg
kocubinski Apr 18, 2023
a0acb58
move lazy registry
kocubinski Apr 18, 2023
f04a10c
store init error
kocubinski Apr 18, 2023
59ab3ce
test fixes
kocubinski Apr 18, 2023
ae3fe65
Merge branch 'main' of github.com:cosmos/cosmos-sdk into kocubinski/t…
kocubinski Apr 18, 2023
79c0f89
Merge branch 'main' of github.com:cosmos/cosmos-sdk into kocubinski/t…
kocubinski Apr 18, 2023
d4bb593
handle default sign mode todos
kocubinski Apr 18, 2023
96a693d
x/tx 0.5.5
kocubinski Apr 18, 2023
0796a6c
go mod tidy
kocubinski Apr 18, 2023
ad658b5
rm more todos
kocubinski Apr 18, 2023
c270393
lint fix
kocubinski Apr 18, 2023
4ad00c5
clean up handler creation API
kocubinski Apr 18, 2023
8e516b2
fix more test bugs
kocubinski Apr 18, 2023
f138251
finish simd/root command
kocubinski Apr 18, 2023
8973802
Merge branch 'main' of github.com:cosmos/cosmos-sdk into kocubinski/t…
kocubinski Apr 18, 2023
76c6363
a little clean up
kocubinski Apr 19, 2023
dd3cd93
Merge branch 'main' of github.com:cosmos/cosmos-sdk into kocubinski/t…
kocubinski Apr 19, 2023
05d52af
Add CHANGELOG entries for API breaks
kocubinski Apr 19, 2023
f3211b8
Add UPGRADING entries
kocubinski Apr 19, 2023
147dc83
Merge branch 'main' into kocubinski/tx-config-break
kocubinski Apr 19, 2023
d1af44c
PR fixes
kocubinski Apr 19, 2023
e8398d2
Merge branch 'main' of github.com:cosmos/cosmos-sdk into kocubinski/t…
kocubinski Apr 19, 2023
cd4f11f
lint fix
kocubinski Apr 19, 2023
2bb6750
Refactor NewTxConfig
kocubinski Apr 20, 2023
3bcaa98
lazy loading won't work in InterfaceRegistry ctr won't work yet.
kocubinski Apr 20, 2023
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ coverage.txt
sim_log_file
x/genutil/config
x/genutil/data
*.fail

# Vagrant
.vagrant/
Expand All @@ -60,4 +61,4 @@ debug_container.log
*.out
*.synctex.gz
/x/genutil/config/priv_validator_key.json
/x/genutil/data/priv_validator_state.json
/x/genutil/data/priv_validator_state.json
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ Ref: https://keepachangelog.com/en/1.0.0/
* `AminoCodec` is marked as deprecated.
* (x/crisis) [#15852](https://github.com/cosmos/cosmos-sdk/pull/15852) Crisis keeper now takes a instance of the address codec to be able to decode user addresses
* (x/slashing) [#15875](https://github.com/cosmos/cosmos-sdk/pull/15875) `x/slashing.NewAppModule` now requires an `InterfaceRegistry` parameter.
* (client) [#15822](https://github.com/cosmos/cosmos-sdk/pull/15822) The return type of the interface method `TxConfig.SignModeHandler` has been changed to `x/tx/signing.HandlerMap`.
* (x/auth) [#15822](https://github.com/cosmos/cosmos-sdk/pull/15822) The type of struct field `ante.HandlerOptions.SignModeHandler` has been changed to `x/tx/signing.HandlerMap`.
* The signature of `NewSigVerificationDecorator` has been changed to accept a `x/tx/signing.HandlerMap`.
* The signature of `VerifySignature` has been changed to accept a `x/tx/signing.HandlerMap` and other structs from `x/tx` as arguments.
* The signature of `NewTxConfigWithTextual` has been deprecated and its signature changed to accept a `SignModeOptions`.

### Client Breaking Changes

Expand Down
6 changes: 6 additions & 0 deletions UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ References to `types/store.go` which contained aliases for store types have been
The `store` module is extracted to have a separate go.mod file which allows it be a standalone module.
All the store imports are now renamed to use `cosmossdk.io/store` instead of `github.com/cosmos/cosmos-sdk/store` across the SDK.

#### Client

The return type of the interface method `TxConfig.SignModeHandler()` has been changed from `x/auth/signing.SignModeHandler` to `x/tx/signing.HandlerMap`. This change is transparent to most users as the `TxConfig` interface is typically implemented by private `x/auth/tx.config` struct (as returned by `auth.NewTxConfig`) which has been updated to return the new type. If users have implemented their own `TxConfig` interface, they will need to update their implementation to return the new type.

### Modules

#### `**all**`
Expand All @@ -105,6 +109,8 @@ It is now recommended to validate message directly in the message server. When t

Methods in the `AccountKeeper` now use `context.Context` instead of `sdk.Context`. Any module that has an interface for it will need to update and re-generate mocks if needed.

For ante handler construction via `ante.NewAnteHandler`, the field `ante.HandlerOptions.SignModeHandler` has been updated to `x/tx/signing/HandlerMap` from `x/auth/signing/SignModeHandler`. Callers typically fetch this value from `client.TxConfig.SignModeHandler()` (which is also changed) so this change should be transparent to most users.

#### `x/capability`

Capability was moved to [IBC-GO](https://github.com/cosmos/ibc-go). IBC V8 will contain the necessary changes to incorporate the new module location
Expand Down
17 changes: 11 additions & 6 deletions baseapp/block_gas_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import (
"math"
"testing"

"cosmossdk.io/depinject"
"cosmossdk.io/log"
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"
dbm "github.com/cosmos/cosmos-db"
"github.com/stretchr/testify/require"

"cosmossdk.io/depinject"
"cosmossdk.io/log"
sdkmath "cosmossdk.io/math"
store "cosmossdk.io/store/types"

baseapptestutil "github.com/cosmos/cosmos-sdk/baseapp/testutil"
Expand Down Expand Up @@ -191,22 +191,26 @@ func TestBaseApp_BlockGas(t *testing.T) {
}

func createTestTx(txConfig client.TxConfig, txBuilder client.TxBuilder, privs []cryptotypes.PrivKey, accNums, accSeqs []uint64, chainID string) (xauthsigning.Tx, []byte, error) {
defaultSignMode, err := xauthsigning.APISignModeToInternal(txConfig.SignModeHandler().DefaultMode())
if err != nil {
return nil, nil, err
}
// First round: we gather all the signer infos. We use the "set empty
// signature" hack to do that.
var sigsV2 []signing.SignatureV2
for i, priv := range privs {
sigV2 := signing.SignatureV2{
PubKey: priv.PubKey(),
Data: &signing.SingleSignatureData{
SignMode: txConfig.SignModeHandler().DefaultMode(),
SignMode: defaultSignMode,
Signature: nil,
},
Sequence: accSeqs[i],
}

sigsV2 = append(sigsV2, sigV2)
}
err := txBuilder.SetSignatures(sigsV2...)
err = txBuilder.SetSignatures(sigsV2...)
if err != nil {
return nil, nil, err
}
Expand All @@ -219,9 +223,10 @@ func createTestTx(txConfig client.TxConfig, txBuilder client.TxBuilder, privs []
ChainID: chainID,
AccountNumber: accNums[i],
Sequence: accSeqs[i],
PubKey: priv.PubKey(),
}
sigV2, err := tx.SignWithPrivKey(
context.TODO(), txConfig.SignModeHandler().DefaultMode(), signerData,
context.TODO(), defaultSignMode, signerData,
txBuilder, priv, txConfig, accSeqs[i])
if err != nil {
return nil, nil, err
Expand Down
9 changes: 7 additions & 2 deletions baseapp/msg_service_router_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package baseapp_test

import (
"context"
"testing"

abci "github.com/cometbft/cometbft/abci/types"
Expand Down Expand Up @@ -94,6 +95,9 @@ func TestMsgService(t *testing.T) {
// set the TxDecoder in the BaseApp for minimal tx simulations
app.SetTxDecoder(txConfig.TxDecoder())

defaultSignMode, err := authsigning.APISignModeToInternal(txConfig.SignModeHandler().DefaultMode())
require.NoError(t, err)

testdata.RegisterInterfaces(interfaceRegistry)
testdata.RegisterMsgServer(
app.MsgServiceRouter(),
Expand All @@ -114,7 +118,7 @@ func TestMsgService(t *testing.T) {
sigV2 := signing.SignatureV2{
PubKey: priv.PubKey(),
Data: &signing.SingleSignatureData{
SignMode: txConfig.SignModeHandler().DefaultMode(),
SignMode: defaultSignMode,
Signature: nil,
},
Sequence: 0,
Expand All @@ -128,9 +132,10 @@ func TestMsgService(t *testing.T) {
ChainID: "test",
AccountNumber: 0,
Sequence: 0,
PubKey: priv.PubKey(),
}
sigV2, err = tx.SignWithPrivKey(
nil, txConfig.SignModeHandler().DefaultMode(), signerData, //nolint:staticcheck // SA1019: txConfig.SignModeHandler().DefaultMode() is deprecated: use txConfig.SignModeHandler().DefaultMode() instead.
context.TODO(), defaultSignMode, signerData,
txBuilder, priv, txConfig, 0)
require.NoError(t, err)
err = txBuilder.SetSignatures(sigV2)
Expand Down
51 changes: 27 additions & 24 deletions baseapp/testutil/messages.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions baseapp/testutil/messages.proto
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
syntax = "proto3";

import "cosmos/msg/v1/msg.proto";
import "gogoproto/gogo.proto";
import "google/protobuf/any.proto";

Expand All @@ -18,6 +19,8 @@ message MsgCounter2 {
message MsgCreateCounterResponse {}

message MsgKeyValue {
option (cosmos.msg.v1.signer) = "signer";

bytes key = 1;
bytes value = 2;
string signer = 3;
Expand Down
14 changes: 10 additions & 4 deletions client/tx/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ func SignWithPrivKey(
var sigV2 signing.SignatureV2

// Generate the bytes to be signed.
signBytes, err := authsigning.GetSignBytesWithContext(txConfig.SignModeHandler(), ctx, signMode, signerData, txBuilder.GetTx())
signBytes, err := authsigning.GetSignBytesAdapter(
ctx, txConfig.TxEncoder(), txConfig.SignModeHandler(), signMode, signerData, txBuilder.GetTx())
if err != nil {
return sigV2, err
}
Expand Down Expand Up @@ -248,10 +249,14 @@ func Sign(ctx context.Context, txf Factory, name string, txBuilder client.TxBuil
return errors.New("keybase must be set prior to signing a transaction")
}

var err error
signMode := txf.signMode
if signMode == signing.SignMode_SIGN_MODE_UNSPECIFIED {
// use the SignModeHandler's default mode if unspecified
signMode = txf.txConfig.SignModeHandler().DefaultMode()
signMode, err = authsigning.APISignModeToInternal(txf.txConfig.SignModeHandler().DefaultMode())
if err != nil {
return err
}
}

k, err := txf.keybase.Key(name)
Expand Down Expand Up @@ -313,8 +318,9 @@ func Sign(ctx context.Context, txf Factory, name string, txBuilder client.TxBuil
return err
}

// Generate the bytes to be signed.
bytesToSign, err := authsigning.GetSignBytesWithContext(txf.txConfig.SignModeHandler(), ctx, signMode, signerData, txBuilder.GetTx())
bytesToSign, err := authsigning.GetSignBytesAdapter(
ctx, txf.txConfig.TxEncoder(), txf.txConfig.SignModeHandler(),
signMode, signerData, txBuilder.GetTx())
if err != nil {
return err
}
Expand Down
11 changes: 8 additions & 3 deletions client/tx/tx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ import (
"strings"
"testing"

sdkmath "cosmossdk.io/math"
"github.com/stretchr/testify/require"
"google.golang.org/grpc"

sdkmath "cosmossdk.io/math"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/tx"
"github.com/cosmos/cosmos-sdk/codec"
Expand Down Expand Up @@ -78,10 +79,12 @@ func TestCalculateGas(t *testing.T) {
for _, tc := range testCases {
stc := tc
txCfg, _ := newTestTxConfig()
defaultSignMode, err := signing.APISignModeToInternal(txCfg.SignModeHandler().DefaultMode())
require.NoError(t, err)

txf := tx.Factory{}.
WithChainID("test-chain").
WithTxConfig(txCfg).WithSignMode(txCfg.SignModeHandler().DefaultMode())
WithTxConfig(txCfg).WithSignMode(defaultSignMode)

t.Run(stc.name, func(t *testing.T) {
mockClientCtx := mockContext{
Expand All @@ -104,6 +107,8 @@ func TestCalculateGas(t *testing.T) {

func TestBuildSimTx(t *testing.T) {
txCfg, cdc := newTestTxConfig()
defaultSignMode, err := signing.APISignModeToInternal(txCfg.SignModeHandler().DefaultMode())
require.NoError(t, err)

kb, err := keyring.New(t.Name(), "test", t.TempDir(), nil, cdc)
require.NoError(t, err)
Expand All @@ -119,7 +124,7 @@ func TestBuildSimTx(t *testing.T) {
WithFees("50stake").
WithMemo("memo").
WithChainID("test-chain").
WithSignMode(txCfg.SignModeHandler().DefaultMode()).
WithSignMode(defaultSignMode).
WithKeybase(kb)

msg := banktypes.NewMsgSend(sdk.AccAddress("from"), sdk.AccAddress("to"), nil)
Expand Down
3 changes: 2 additions & 1 deletion client/tx_config.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package client

import (
txsigning "cosmossdk.io/x/tx/signing"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/tx"
signingtypes "github.com/cosmos/cosmos-sdk/types/tx/signing"
Expand All @@ -27,7 +28,7 @@ type (

NewTxBuilder() TxBuilder
WrapTxBuilder(sdk.Tx) (TxBuilder, error)
SignModeHandler() signing.SignModeHandler
SignModeHandler() *txsigning.HandlerMap
}

// TxBuilder defines an interface which an application-defined concrete transaction
Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
cosmossdk.io/log v1.0.0
cosmossdk.io/math v1.0.0
cosmossdk.io/store v0.1.0-alpha.1.0.20230328185921-37ba88872dbc
cosmossdk.io/x/tx v0.5.1-0.20230407182919-057d2e09bd63
cosmossdk.io/x/tx v0.5.5
github.com/99designs/keyring v1.2.1
github.com/armon/go-metrics v0.4.1
github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816
Expand Down Expand Up @@ -114,6 +114,7 @@ require (
github.com/hashicorp/go-plugin v1.4.9 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hashicorp/yamux v0.1.1 // indirect
github.com/iancoleman/strcase v0.2.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
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ cosmossdk.io/math v1.0.0 h1:ro9w7eKx23om2tZz/VM2Pf+z2WAbGX1yDQQOJ6iGeJw=
cosmossdk.io/math v1.0.0/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k=
cosmossdk.io/store v0.1.0-alpha.1.0.20230328185921-37ba88872dbc h1:9piuA+NYmhe+SyMPtMoboLw/djgDbrI3dD5TG020Tnk=
cosmossdk.io/store v0.1.0-alpha.1.0.20230328185921-37ba88872dbc/go.mod h1:UFF5rmjN7WYVfxo6ArdY/l1+yyWMURBWOmSJypGqFHQ=
cosmossdk.io/x/tx v0.5.1-0.20230407182919-057d2e09bd63 h1:zHqj2VwZ/MStFmR7SUe/7gErOFhL9v2rkjmWPB/st34=
cosmossdk.io/x/tx v0.5.1-0.20230407182919-057d2e09bd63/go.mod h1:Oh3Kh+IPOfMEILNxVd2e8SLqRrIjYHpdGBfDg4ghU/k=
cosmossdk.io/x/tx v0.5.5 h1:9XG3KOrqObt7Rw7KhT7fiqRd6EepUfmA9ERa8CHj1WM=
cosmossdk.io/x/tx v0.5.5/go.mod h1:Oh3Kh+IPOfMEILNxVd2e8SLqRrIjYHpdGBfDg4ghU/k=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek=
filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns=
Expand Down Expand Up @@ -494,6 +494,8 @@ github.com/huandu/skiplist v1.2.0 h1:gox56QD77HzSC0w+Ws3MH3iie755GBJU1OER3h5VsYw
github.com/huandu/skiplist v1.2.0/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w=
github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg=
github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE=
github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0=
github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA=
Expand Down
8 changes: 5 additions & 3 deletions server/grpc/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import (
"fmt"
"net"

"cosmossdk.io/log"
"google.golang.org/grpc"

"cosmossdk.io/log"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/server/config"
Expand Down Expand Up @@ -44,8 +45,9 @@ func NewGRPCServer(clientCtx client.Context, app types.Application, cfg config.G
// time.
err := reflection.Register(grpcSrv, reflection.Config{
SigningModes: func() map[string]int32 {
modes := make(map[string]int32, len(clientCtx.TxConfig.SignModeHandler().Modes()))
for _, m := range clientCtx.TxConfig.SignModeHandler().Modes() {
supportedModes := clientCtx.TxConfig.SignModeHandler().SupportedModes()
modes := make(map[string]int32, len(supportedModes))
for _, m := range supportedModes {
modes[m.String()] = (int32)(m)
}

Expand Down
Loading