Skip to content

Commit

Permalink
Add signing options.
Browse files Browse the repository at this point in the history
  • Loading branch information
Taztingo committed Mar 21, 2024
1 parent fd7c82d commit 5884af3
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions app/params/proto.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,34 @@
package params

import (
"cosmossdk.io/x/tx/signing"
"github.com/cosmos/cosmos-sdk/codec"
amino "github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/codec/address"
"github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/auth/tx"
"github.com/cosmos/gogoproto/proto"
)

// MakeTestEncodingConfig creates an EncodingConfig for a non-amino based test configuration.
// This function should be used only internally (in the SDK).
// App user shouldn't create new codecs - use the app.AppCodec instead.
// [DEPRECATED]
func MakeTestEncodingConfig() EncodingConfig {
cdc := codec.NewLegacyAmino()
interfaceRegistry := types.NewInterfaceRegistry()
cdc := amino.NewLegacyAmino()
signingOptions := signing.Options{
AddressCodec: address.Bech32Codec{
Bech32Prefix: sdk.GetConfig().GetBech32AccountAddrPrefix(),
},
ValidatorAddressCodec: address.Bech32Codec{
Bech32Prefix: sdk.GetConfig().GetBech32ValidatorAddrPrefix(),
},
}
interfaceRegistry, _ := types.NewInterfaceRegistryWithOptions(types.InterfaceRegistryOptions{
ProtoFiles: proto.HybridResolver,
SigningOptions: signingOptions,
})
marshaler := codec.NewProtoCodec(interfaceRegistry)

return EncodingConfig{
Expand Down

0 comments on commit 5884af3

Please sign in to comment.