Skip to content

Commit

Permalink
refactor(x/auth): doc and remove deprecated fn from #15822
Browse files Browse the repository at this point in the history
  • Loading branch information
kocubinski committed Apr 24, 2023
1 parent 866cfa4 commit 2c38358
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions x/auth/tx/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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")
}
}

Expand All @@ -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{
Expand Down

0 comments on commit 2c38358

Please sign in to comment.