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

Proto Tx with Any #7276

Merged
merged 125 commits into from
Sep 21, 2020
Merged
Show file tree
Hide file tree
Changes from 114 commits
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
3a7dbd2
WIP on protobuf keys
aaronc Aug 19, 2020
67ea545
Use Type() and Bytes() in sr25519 pub key Equals
blushi Aug 21, 2020
8f3be04
Add tests
blushi Aug 21, 2020
7c2d693
Add few more tests
blushi Aug 21, 2020
7c53579
Update other pub/priv key types Equals
blushi Aug 21, 2020
92c73ec
Fix PrivKey's Sign method
blushi Aug 21, 2020
d81291e
Rename variables in tests
blushi Aug 24, 2020
03a086d
Fix infinite recursive calls
blushi Aug 24, 2020
ad81bd4
Use tm ed25519 keys
blushi Aug 27, 2020
9587c2b
Add Sign and VerifySignature tests
blushi Aug 27, 2020
a6c6610
Merge branch 'master' into marie/protobuf-pubkeys
blushi Aug 31, 2020
41261d1
Remove ed25519 and sr25519 references
blushi Aug 31, 2020
4c1358b
proto linting
blushi Aug 31, 2020
d6a2751
Add proto crypto file
blushi Aug 31, 2020
eb020c2
Implement some of the new multisig proto type methods
blushi Aug 31, 2020
a4f6dd6
Add tests for MultisigThresholdPubKey
blushi Sep 2, 2020
e1a20ce
Add tests for pubkey pb/amino conversion functions
blushi Sep 2, 2020
c17e7e4
Merge branch 'master' into marie/protobuf-pubkeys
blushi Sep 2, 2020
bc5af8b
Move crypto types.go and register new proto pubkeys
blushi Sep 4, 2020
f4a1fd5
Add missing pointer ref
blushi Sep 4, 2020
ca063bf
Merge branch 'master' into marie/protobuf-pubkeys
blushi Sep 4, 2020
b9ab6c9
Address review comments
blushi Sep 7, 2020
6fc4073
panic in MultisigThresholdPubKey VerifySignature
blushi Sep 7, 2020
6609369
Merge branch 'marie/protobuf-pubkeys' of github.com:cosmos/cosmos-sdk…
blushi Sep 7, 2020
64d44cb
Merge branch 'master' into marie/protobuf-pubkeys
blushi Sep 7, 2020
3103c29
Merge branch 'master' into marie/protobuf-pubkeys
blushi Sep 7, 2020
d9eee8d
Use internal crypto.PubKey in multisig
blushi Sep 9, 2020
a221994
Merge branch 'master' into marie/protobuf-pubkeys
blushi Sep 9, 2020
339f460
Add tests for MultisigThresholdPubKey VerifyMultisignature
blushi Sep 9, 2020
9ee65fa
Merge branch 'master' into marie/protobuf-pubkeys
blushi Sep 9, 2020
190bee2
Merge branch 'master' into marie/protobuf-pubkeys
blushi Sep 10, 2020
af94272
Only keep LegacyAminoMultisigThresholdPubKey and move to proto keys t…
blushi Sep 10, 2020
b4393b4
Remove conversion functions and introduce internal PubKey type
blushi Sep 10, 2020
b67f9d4
Override Amino marshaling for proto pubkeys
amaury1093 Sep 10, 2020
08cd25a
Merge master
amaury1093 Sep 8, 2020
9a4dc25
Make proto-gen
amaury1093 Sep 10, 2020
fb8e7a9
Start removal of old PubKeyMultisigThreshold references
blushi Sep 10, 2020
4e4ce4e
Fix tests
amaury1093 Sep 10, 2020
d3c76f5
Fix solomachine
amaury1093 Sep 11, 2020
01175d3
Fix ante handler tests
amaury1093 Sep 4, 2020
3c4ddbb
Pull latest go-amino
amaury1093 Sep 11, 2020
cee8f30
Remove ed25519
amaury1093 Sep 11, 2020
ba95f50
Remove old secp256k1 PubKey and PrivKey
blushi Sep 11, 2020
330a0be
Uncomment test case
blushi Sep 11, 2020
e88c126
Fix linting issues
blushi Sep 11, 2020
54fb9a3
More linting
blushi Sep 11, 2020
07228ba
Merge branch 'master' into marie/protobuf-pubkeys
blushi Sep 11, 2020
2b63374
Merge branch 'marie/protobuf-pubkeys' into marie/7109-multisig
blushi Sep 11, 2020
34ed4a0
Revert tests keys values
blushi Sep 12, 2020
a39dd4c
Merge branch 'master' of ssh://github.com/cosmos/cosmos-sdk into mari…
amaury1093 Sep 14, 2020
34e3f89
Add Amino overrides to proto keys
amaury1093 Sep 14, 2020
ddd1a72
Add pubkey test
amaury1093 Sep 14, 2020
935c51b
Fix tests
amaury1093 Sep 14, 2020
f31d625
Use threshold isntead of K
amaury1093 Sep 14, 2020
f8af7fc
Merge branch 'master' into marie/protobuf-pubkeys
amaury1093 Sep 14, 2020
e410121
Merge branch 'master' into marie/protobuf-pubkeys
amaury1093 Sep 14, 2020
4114ce9
Standardize Type
amaury1093 Sep 14, 2020
af415fc
Revert standardize types commit
amaury1093 Sep 14, 2020
0934a00
Merge branch 'master' into marie/protobuf-pubkeys
alexanderbez Sep 14, 2020
0006cb7
Merge branch 'marie/protobuf-pubkeys' of ssh://github.com/cosmos/cosm…
amaury1093 Sep 14, 2020
d9294ee
Merge branch 'master' into marie/protobuf-pubkeys
amaury1093 Sep 14, 2020
7177df5
Fix build
amaury1093 Sep 14, 2020
794bc35
Fix lint
amaury1093 Sep 14, 2020
8001673
Fix lint
amaury1093 Sep 14, 2020
ee712f1
Add comment
amaury1093 Sep 14, 2020
912561f
Merge branch 'marie/protobuf-pubkeys' of ssh://github.com/cosmos/cosm…
amaury1093 Sep 14, 2020
9623425
Merge branch 'marie/protobuf-pubkeys' of ssh://github.com/cosmos/cosm…
amaury1093 Sep 14, 2020
56ecf47
Register crypto.PubKey
amaury1093 Sep 14, 2020
d3e4d1e
Add empty key in BuildSimTx
amaury1093 Sep 14, 2020
c5d5c81
Simplify proto names
amaury1093 Sep 15, 2020
37be659
Merge branch 'marie/protobuf-pubkeys' of ssh://github.com/cosmos/cosm…
amaury1093 Sep 15, 2020
afddbc9
Unpack interfaces for signing desc
amaury1093 Sep 15, 2020
f70ab56
Fix IBC tests?
amaury1093 Sep 15, 2020
9d0ac0a
Format proto
amaury1093 Sep 15, 2020
d3b2896
Use secp256k1 in ibc
amaury1093 Sep 15, 2020
e8b30d7
Merge branch 'marie/protobuf-pubkeys' of ssh://github.com/cosmos/cosm…
amaury1093 Sep 15, 2020
96c27ec
Fixed merge issues
amaury1093 Sep 15, 2020
9e0a4bb
Uncomment tests
amaury1093 Sep 15, 2020
f2dafe7
Update x/ibc/testing/solomachine.go
colin-axner Sep 15, 2020
ccc3afe
Merge branch 'am-7147-aminojson' of ssh://github.com/cosmos/cosmos-sd…
amaury1093 Sep 15, 2020
e5778a0
UnpackInterfaces for solomachine types
amaury1093 Sep 15, 2020
0a47ff3
Remove old multisig
amaury1093 Sep 15, 2020
bb0b56d
Add amino marshal for multisig
amaury1093 Sep 15, 2020
9f9921e
Fix lint
amaury1093 Sep 15, 2020
f5d3701
Correctly register amino
amaury1093 Sep 16, 2020
18eeb67
One test left!
amaury1093 Sep 16, 2020
bf72fbd
Remove old struct
amaury1093 Sep 16, 2020
9c07e68
Fix test
amaury1093 Sep 16, 2020
66f78cd
Fix test
amaury1093 Sep 16, 2020
9f8aab7
Unpack into tmcrypto
amaury1093 Sep 16, 2020
5a0490f
Merge branch 'master' of ssh://github.com/cosmos/cosmos-sdk into mari…
amaury1093 Sep 16, 2020
c7c289e
Merge branch 'marie/7109-multisig' of ssh://github.com/cosmos/cosmos-…
amaury1093 Sep 16, 2020
7a596dc
Remove old threshold pubkey tests
blushi Sep 16, 2020
04b86d9
Fix register amino
amaury1093 Sep 16, 2020
3211baa
Fix lint
amaury1093 Sep 16, 2020
2103eca
Use sdk crypto PubKey in multisig UnpackInterfaces
blushi Sep 16, 2020
bf3ffbe
Merge branch 'master' into marie/7109-multisig
blushi Sep 16, 2020
421f948
Potential fix?
amaury1093 Sep 17, 2020
fa3840a
Merge branch 'marie/7109-multisig' of ssh://github.com/cosmos/cosmos-…
amaury1093 Sep 17, 2020
c63f3e7
Register LegacyAminoPubKey
amaury1093 Sep 17, 2020
9e5f57c
Merge branch 'master' into marie/7109-multisig
amaury1093 Sep 17, 2020
d195542
Register our own PubKey
amaury1093 Sep 17, 2020
b35c35e
Register tmcrypto PubKey
amaury1093 Sep 17, 2020
b19450f
Register both PubKeys
amaury1093 Sep 17, 2020
7175814
Register interfaces in test
amaury1093 Sep 17, 2020
bf2347d
Refactor fiels
amaury1093 Sep 17, 2020
09e1fbc
Add comments
amaury1093 Sep 17, 2020
ec1c22d
Merge branch 'master' into marie/7109-multisig
alexanderbez Sep 17, 2020
8f1fda1
Use anil's suggestion
amaury1093 Sep 17, 2020
27ae607
Add norace back
amaury1093 Sep 17, 2020
aa0867e
Merge branch 'marie/7109-multisig' into am-7147-aminojson
amaury1093 Sep 17, 2020
529eef4
Merge branch 'master' of ssh://github.com/cosmos/cosmos-sdk into am-7…
amaury1093 Sep 18, 2020
6f7555a
Merge branch 'master' into am-7147-aminojson
amaury1093 Sep 18, 2020
c1d283e
Merge branch 'master' into am-7147-aminojson
alexanderbez Sep 18, 2020
3d90dd6
Check nil
amaury1093 Sep 18, 2020
0b770a3
Merge branch 'master' into am-7147-aminojson
amaury1093 Sep 18, 2020
6f6f3f2
Address comments
amaury1093 Sep 21, 2020
3c14018
Merge branch 'master' of ssh://github.com/cosmos/cosmos-sdk into am-7…
amaury1093 Sep 21, 2020
451e490
FIx lint
amaury1093 Sep 21, 2020
00f6a67
Add tests for solomachine unpack interfaces
amaury1093 Sep 21, 2020
cb16dbc
Fix query tx by hash
amaury1093 Sep 21, 2020
edba7cb
Better name in amino register
amaury1093 Sep 21, 2020
6fb1b8e
Display StdTx instead of proto Tx
amaury1093 Sep 21, 2020
8d30461
Remove useless check
amaury1093 Sep 21, 2020
99fc10b
Merge branch 'master' into am-7147-aminojson
amaury1093 Sep 21, 2020
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
4 changes: 1 addition & 3 deletions baseapp/grpcrouter.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"github.com/cosmos/cosmos-sdk/client/grpc/reflection"
"github.com/cosmos/cosmos-sdk/client/grpc/simulate"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
sdk "github.com/cosmos/cosmos-sdk/types"
)

Expand Down Expand Up @@ -116,10 +115,9 @@ func (qrt *GRPCQueryRouter) SetInterfaceRegistry(interfaceRegistry codectypes.In
func (qrt *GRPCQueryRouter) RegisterSimulateService(
simulateFn simulate.BaseAppSimulateFn,
interfaceRegistry codectypes.InterfaceRegistry,
pubkeyCodec cryptotypes.PublicKeyCodec,
) {
simulate.RegisterSimulateServiceServer(
qrt,
simulate.NewSimulateServer(simulateFn, interfaceRegistry, pubkeyCodec),
simulate.NewSimulateServer(simulateFn, interfaceRegistry),
)
}
7 changes: 2 additions & 5 deletions client/grpc/simulate/simulate.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"google.golang.org/grpc/status"

codectypes "github.com/cosmos/cosmos-sdk/codec/types"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
sdk "github.com/cosmos/cosmos-sdk/types"
authtx "github.com/cosmos/cosmos-sdk/x/auth/tx"
)
Expand All @@ -18,15 +17,13 @@ type BaseAppSimulateFn func(txBytes []byte, txtypes sdk.Tx) (sdk.GasInfo, *sdk.R
type simulateServer struct {
simulate BaseAppSimulateFn
interfaceRegistry codectypes.InterfaceRegistry
pubkeyCodec cryptotypes.PublicKeyCodec
}

// NewSimulateServer creates a new SimulateServer.
func NewSimulateServer(simulate BaseAppSimulateFn, interfaceRegistry codectypes.InterfaceRegistry, pubkeyCodec cryptotypes.PublicKeyCodec) SimulateServiceServer {
func NewSimulateServer(simulate BaseAppSimulateFn, interfaceRegistry codectypes.InterfaceRegistry) SimulateServiceServer {
return simulateServer{
simulate: simulate,
interfaceRegistry: interfaceRegistry,
pubkeyCodec: pubkeyCodec,
}
}

Expand All @@ -42,7 +39,7 @@ func (s simulateServer) Simulate(ctx context.Context, req *SimulateRequest) (*Si
if err != nil {
return nil, err
}
txBuilder := authtx.WrapTx(req.Tx, s.pubkeyCodec)
txBuilder := authtx.WrapTx(req.Tx)
txBytes, err := req.Tx.Marshal()
if err != nil {
return nil, err
Expand Down
4 changes: 1 addition & 3 deletions client/grpc/simulate/simulate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"github.com/cosmos/cosmos-sdk/client/tx"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/simapp"
"github.com/cosmos/cosmos-sdk/std"
"github.com/cosmos/cosmos-sdk/testutil/testdata"
sdk "github.com/cosmos/cosmos-sdk/types"
txtypes "github.com/cosmos/cosmos-sdk/types/tx"
Expand Down Expand Up @@ -41,11 +40,10 @@ func (s *IntegrationTestSuite) SetupSuite() {

// Set up TxConfig.
encodingConfig := simapp.MakeEncodingConfig()
pubKeyCodec := std.DefaultPublicKeyCodec{}
clientCtx := client.Context{}.WithTxConfig(encodingConfig.TxConfig)

// Create new simulation server.
srv := simulate.NewSimulateServer(app.BaseApp.Simulate, encodingConfig.InterfaceRegistry, pubKeyCodec)
srv := simulate.NewSimulateServer(app.BaseApp.Simulate, encodingConfig.InterfaceRegistry)

queryHelper := baseapp.NewQueryServerTestHelper(sdkCtx, app.InterfaceRegistry())
simulate.RegisterSimulateServiceServer(queryHelper, srv)
Expand Down
3 changes: 1 addition & 2 deletions client/tx/legacy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/simapp"
"github.com/cosmos/cosmos-sdk/simapp/params"
"github.com/cosmos/cosmos-sdk/std"
"github.com/cosmos/cosmos-sdk/testutil/testdata"
"github.com/cosmos/cosmos-sdk/types"
signing2 "github.com/cosmos/cosmos-sdk/types/tx/signing"
Expand Down Expand Up @@ -60,7 +59,7 @@ type TestSuite struct {
func (s *TestSuite) SetupSuite() {
encCfg := simapp.MakeEncodingConfig()
s.encCfg = encCfg
s.protoCfg = tx.NewTxConfig(codec.NewProtoCodec(encCfg.InterfaceRegistry), std.DefaultPublicKeyCodec{}, tx.DefaultSignModes)
s.protoCfg = tx.NewTxConfig(codec.NewProtoCodec(encCfg.InterfaceRegistry), tx.DefaultSignModes)
s.aminoCfg = types3.StdTxConfig{Cdc: encCfg.Amino}
}

Expand Down
2 changes: 2 additions & 0 deletions client/tx/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
sim "github.com/cosmos/cosmos-sdk/client/grpc/simulate"
"github.com/cosmos/cosmos-sdk/client/input"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/types/rest"
Expand Down Expand Up @@ -257,6 +258,7 @@ func BuildSimTx(txf Factory, msgs ...sdk.Msg) ([]byte, error) {
// Create an empty signature literal as the ante handler will populate with a
// sentinel pubkey.
sig := signing.SignatureV2{
PubKey: &secp256k1.PubKey{},
Data: &signing.SingleSignatureData{
SignMode: txf.signMode,
},
Expand Down
24 changes: 24 additions & 0 deletions crypto/codec/proto.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package codec
robert-zaremba marked this conversation as resolved.
Show resolved Hide resolved

import (
tmcrypto "github.com/tendermint/tendermint/crypto"

codectypes "github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/crypto/keys/multisig"
"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
)

// RegisterInterfaces registers the sdk.Tx interface.
func RegisterInterfaces(registry codectypes.InterfaceRegistry) {
// TODO We now register both Tendermint's PubKey and our own PubKey. In the
// long-term, we should move away from Tendermint's PubKey, and delete
// these lines
registry.RegisterInterface("tendermint.crypto.Pubkey", (*tmcrypto.PubKey)(nil))
registry.RegisterImplementations((*tmcrypto.PubKey)(nil), &secp256k1.PubKey{})
registry.RegisterImplementations((*tmcrypto.PubKey)(nil), &multisig.LegacyAminoPubKey{})

registry.RegisterInterface("cosmos.crypto.Pubkey", (*cryptotypes.PubKey)(nil))
registry.RegisterImplementations((*cryptotypes.PubKey)(nil), &secp256k1.PubKey{})
registry.RegisterImplementations((*cryptotypes.PubKey)(nil), &multisig.LegacyAminoPubKey{})
}
15 changes: 0 additions & 15 deletions crypto/types/codec.go

This file was deleted.

4 changes: 2 additions & 2 deletions docs/architecture/adr-020-protobuf-transaction-encoding.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

## Status

Proposed
Accepted

## Context

Expand Down Expand Up @@ -103,7 +103,7 @@ message AuthInfo {
message SignerInfo {
// The public key is optional for accounts that already exist in state. If unset, the
// verifier can use the required signer address for this position and lookup the public key.
PublicKey public_key = 1;
google.protobuf.Any public_key = 1;
// ModeInfo describes the signing mode of the signer and is a nested
// structure to support nested multisig pubkey's
ModeInfo mode_info = 2;
Expand Down
77 changes: 39 additions & 38 deletions proto/cosmos/tx/signing/v1beta1/signing.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ syntax = "proto3";
package cosmos.tx.signing.v1beta1;

import "cosmos/base/crypto/v1beta1/crypto.proto";
import "google/protobuf/any.proto";

option go_package = "github.com/cosmos/cosmos-sdk/types/tx/signing";

Expand Down Expand Up @@ -33,43 +34,43 @@ message SignatureDescriptors {
// signature including the public key of the signer, signing modes and the signature
// itself. It is primarily used for coordinating signatures between clients.
message SignatureDescriptor {
// public_key is the public key of the signer
cosmos.base.crypto.v1beta1.PublicKey public_key = 1;

Data data = 2;

// sequence is the sequence of the account, which describes the
// number of committed transactions signed by a given address. It is used to prevent
// replay attacks.
uint64 sequence = 3;

// Data represents signature data
message Data {
// sum is the oneof that specifies whether this represents single or multi-signature data
oneof sum {
// single represents a single signer
Single single = 1;

// multi represents a multisig signer
Multi multi = 2;
}

// Single is the signature data for a single signer
message Single {
// mode is the signing mode of the single signer
SignMode mode = 1;

// signature is the raw signature bytes
bytes signature = 2;
}

// Multi is the signature data for a multisig public key
message Multi {
// bitarray specifies which keys within the multisig are signing
cosmos.base.crypto.v1beta1.CompactBitArray bitarray = 1;

// signatures is the signatures of the multi-signature
repeated Data signatures = 2;
// public_key is the public key of the signer
google.protobuf.Any public_key = 1;

Data data = 2;

// sequence is the sequence of the account, which describes the
// number of committed transactions signed by a given address. It is used to prevent
// replay attacks.
uint64 sequence = 3;

// Data represents signature data
message Data {
// sum is the oneof that specifies whether this represents single or multi-signature data
oneof sum {
// single represents a single signer
Single single = 1;

// multi represents a multisig signer
Multi multi = 2;
}

// Single is the signature data for a single signer
message Single {
// mode is the signing mode of the single signer
SignMode mode = 1;

// signature is the raw signature bytes
bytes signature = 2;
}

// Multi is the signature data for a multisig public key
message Multi {
// bitarray specifies which keys within the multisig are signing
cosmos.base.crypto.v1beta1.CompactBitArray bitarray = 1;

// signatures is the signatures of the multi-signature
repeated Data signatures = 2;
}
}
}
}
2 changes: 1 addition & 1 deletion proto/cosmos/tx/v1beta1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ message SignerInfo {
// public_key is the public key of the signer. It is optional for accounts
// that already exist in state. If unset, the verifier can use the required \
// signer address for this position and lookup the public key.
cosmos.base.crypto.v1beta1.PublicKey public_key = 1;
google.protobuf.Any public_key = 1;

// mode_info describes the signing mode of the signer and is a nested
// structure to support nested multisig pubkey's
Expand Down
6 changes: 3 additions & 3 deletions proto/ibc/lightclients/solomachine/v1/solomachine.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ message ClientState {
message ConsensusState {
option (gogoproto.goproto_getters) = false;
// public key of the solo machine
cosmos.base.crypto.v1beta1.PublicKey public_key = 1 [(gogoproto.moretags) = "yaml:\"public_key\""];
google.protobuf.Any public_key = 1 [(gogoproto.moretags) = "yaml:\"public_key\""];
// diversifier allows the same public key to be re-used across different solo machine clients
// (potentially on different chains) without being considered misbehaviour.
string diversifier = 2;
Expand All @@ -42,7 +42,7 @@ message Header {
uint64 sequence = 1;
uint64 timestamp = 2;
bytes signature = 3;
cosmos.base.crypto.v1beta1.PublicKey new_public_key = 4 [(gogoproto.moretags) = "yaml:\"new_public_key\""];
google.protobuf.Any new_public_key = 4 [(gogoproto.moretags) = "yaml:\"new_public_key\""];
string new_diversifier = 5 [(gogoproto.moretags) = "yaml:\"new_diversifier\""];
}

Expand Down Expand Up @@ -89,7 +89,7 @@ message HeaderData {
option (gogoproto.goproto_getters) = false;

// header public key
cosmos.base.crypto.v1beta1.PublicKey new_pub_key = 1 [(gogoproto.moretags) = "yaml:\"new_pub_key\""];
google.protobuf.Any new_pub_key = 1 [(gogoproto.moretags) = "yaml:\"new_pub_key\""];
// header diversifier
string new_diversifier = 2 [(gogoproto.moretags) = "yaml:\"new_diversifier\""];
}
Expand Down
3 changes: 1 addition & 2 deletions simapp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/server/api"
simappparams "github.com/cosmos/cosmos-sdk/simapp/params"
"github.com/cosmos/cosmos-sdk/std"
"github.com/cosmos/cosmos-sdk/testutil/testdata"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
Expand Down Expand Up @@ -195,7 +194,7 @@ func NewSimApp(
bApp.SetCommitMultiStoreTracer(traceStore)
bApp.SetAppVersion(version.Version)
bApp.GRPCQueryRouter().SetInterfaceRegistry(interfaceRegistry)
bApp.GRPCQueryRouter().RegisterSimulateService(bApp.Simulate, interfaceRegistry, std.DefaultPublicKeyCodec{})
bApp.GRPCQueryRouter().RegisterSimulateService(bApp.Simulate, interfaceRegistry)

keys := sdk.NewKVStoreKeys(
authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey,
Expand Down
3 changes: 1 addition & 2 deletions simapp/params/proto.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package params
import (
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/std"
"github.com/cosmos/cosmos-sdk/x/auth/tx"
)

Expand All @@ -14,7 +13,7 @@ func MakeEncodingConfig() EncodingConfig {
amino := codec.NewLegacyAmino()
interfaceRegistry := types.NewInterfaceRegistry()
marshaler := codec.NewProtoCodec(interfaceRegistry)
txCfg := tx.NewTxConfig(marshaler, std.DefaultPublicKeyCodec{}, tx.DefaultSignModes)
txCfg := tx.NewTxConfig(marshaler, tx.DefaultSignModes)

return EncodingConfig{
InterfaceRegistry: interfaceRegistry,
Expand Down
4 changes: 3 additions & 1 deletion std/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@ import (
vesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"
)

// RegisterLegacyAminoCodec registers types with the Amino codec.
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
vesting.RegisterLegacyAminoCodec(cdc)
sdk.RegisterLegacyAminoCodec(cdc)
cryptocodec.RegisterCrypto(cdc)
}

// RegisterInterfaces registers Interfaces from sdk/types and vesting
// RegisterInterfaces registers Interfaces from sdk/types, vesting, crypto, tx.
func RegisterInterfaces(interfaceRegistry types.InterfaceRegistry) {
sdk.RegisterInterfaces(interfaceRegistry)
txtypes.RegisterInterfaces(interfaceRegistry)
cryptocodec.RegisterInterfaces(interfaceRegistry)
vesting.RegisterInterfaces(interfaceRegistry)
}
Loading