From dde6fcd7bbf47b6cab03f5dd4bc5ccf302ad46e4 Mon Sep 17 00:00:00 2001 From: Matt Kocubinski Date: Mon, 24 Apr 2023 12:38:51 -0500 Subject: [PATCH] refactor(x/auth): doc and remove deprecated fn from #15822 (#15932) --- x/auth/tx/config.go | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/x/auth/tx/config.go b/x/auth/tx/config.go index 6d89cd41ecd8..861289d1453e 100644 --- a/x/auth/tx/config.go +++ b/x/auth/tx/config.go @@ -29,13 +29,12 @@ type config struct { // first enabled sign mode will become the default sign mode. // // NOTE: Use NewTxConfigWithHandler to provide a custom signing handler in case the sign mode -// is not supported by default (eg: SignMode_SIGN_MODE_EIP_191). Use NewTxConfigWithTextual +// is not supported by default (eg: SignMode_SIGN_MODE_EIP_191). Use NewTxConfigWithOptions // to enable SIGN_MODE_TEXTUAL (for testing purposes for now). // // 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: // https://github.com/evmos/evmos/blob/719363fbb92ff3ea9649694bd088e4c6fe9c195f/encoding/config.go#L37 -// TODO: collapse enabledSignModes and customSignModes func NewTxConfig(protoCodec codec.ProtoCodecMarshaler, enabledSignModes []signingtypes.SignMode, customSignModes ...txsigning.SignModeHandler, ) client.TxConfig { @@ -65,7 +64,7 @@ func NewTxConfig(protoCodec codec.ProtoCodecMarshaler, enabledSignModes []signin Encoder: &aminoJSONEncoder, } case signingtypes.SignMode_SIGN_MODE_TEXTUAL: - panic("cannot use NewTxConfig with SIGN_MODE_TEXTUAL enabled; please use NewTxConfigWithTextual") + panic("cannot use NewTxConfig with SIGN_MODE_TEXTUAL enabled; please use NewTxConfigWithOptions") } } @@ -78,17 +77,6 @@ func NewTxConfigWithOptions(protoCodec codec.ProtoCodecMarshaler, signModeOption return NewTxConfigWithHandler(protoCodec, makeSignModeHandler(signModeOptions, customSignModes...)) } -// NewTxConfigWithTextual is like NewTxConfig with the ability to add -// a SIGN_MODE_TEXTUAL renderer. It is currently still EXPERIMENTAL, for should -// be used for TESTING purposes only, until Textual is fully released. -// -// Deprecated: use NewTxConfigWithOptions instead. -func NewTxConfigWithTextual(protoCodec codec.ProtoCodecMarshaler, _ []signingtypes.SignMode, - signModeOptions SignModeOptions, customSignModes ...txsigning.SignModeHandler, -) client.TxConfig { - return NewTxConfigWithOptions(protoCodec, signModeOptions, customSignModes...) -} - // NewTxConfigWithHandler returns a new protobuf TxConfig using the provided ProtoCodec and signing handler. func NewTxConfigWithHandler(protoCodec codec.ProtoCodecMarshaler, handler *txsigning.HandlerMap) client.TxConfig { return &config{