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: enable sign mode textual by default #15970

Merged
merged 15 commits into from
Jun 1, 2023
Prev Previous commit
Next Next commit
progress
  • Loading branch information
facundomedica committed May 3, 2023
commit 4c95a162d91489cc4e484239e9f0af9460769a95
3 changes: 1 addition & 2 deletions x/auth/tx/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ var DefaultSignModes = []signingtypes.SignMode{
// first enabled sign mode will become the default sign mode.
//
// NOTE: Use NewTxConfigWithOptions to provide a custom signing handler in case the sign mode
// is not supported by default (eg: SignMode_SIGN_MODE_EIP_191), or to enable SIGN_MODE_TEXTUAL
// (for testing purposes for now).
// is not supported by default (eg: SignMode_SIGN_MODE_EIP_191), or to enable SIGN_MODE_TEXTUAL.
//
// We prefer to use depinject to provide client.TxConfig, but we permit this constructor usage. Within the SDK,
// this constructor is primarily used in tests, but also sees usage in app chains like:
Expand Down
5 changes: 4 additions & 1 deletion x/auth/tx/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"cosmossdk.io/depinject"
txsigning "cosmossdk.io/x/tx/signing"
"cosmossdk.io/x/tx/signing/textual"

authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec"

"github.com/cosmos/cosmos-sdk/baseapp"
Expand Down Expand Up @@ -43,6 +44,7 @@ type ModuleInputs struct {
ProtoFileResolver txsigning.ProtoFileResolver
// BankKeeper is the expected bank keeper to be passed to AnteHandlers
BankKeeper authtypes.BankKeeper `optional:"true"`
MetadataBankKeeper BankKeeper `optional:"true"`
AccountKeeper ante.AccountKeeper `optional:"true"`
FeeGrantKeeper ante.FeegrantKeeper `optional:"true"`
CustomSignModeHandlers func() []txsigning.SignModeHandler `optional:"true"`
Expand Down Expand Up @@ -75,7 +77,8 @@ func ProvideModule(in ModuleInputs) ModuleOutputs {
AddressCodec: authcodec.NewBech32Codec(sdkConfig.GetBech32AccountAddrPrefix()),
ValidatorAddressCodec: authcodec.NewBech32Codec(sdkConfig.GetBech32ValidatorAddrPrefix()),
},
CustomSignModes: customSignModeHandlers,
CustomSignModes: customSignModeHandlers,
TextualCoinMetadataQueryFn: NewBankKeeperCoinMetadataQueryFn(in.MetadataBankKeeper),
facundomedica marked this conversation as resolved.
Show resolved Hide resolved
}
txConfig := tx.NewTxConfigWithOptions(in.ProtoCodecMarshaler, txConfigOptions)

Expand Down