chore(x/auth): deprecate legacy aminojson sign mode (#16110)

This commit is contained in:
Matt Kocubinski 2023-05-11 11:48:57 -05:00 committed by GitHub
parent 3185542a7a
commit e998532a11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -45,6 +45,7 @@ type StdSignDoc struct {
}
// StdSignBytes returns the bytes to sign for a transaction.
// Deprecated: Please use x/tx/signing/aminojson instead.
func StdSignBytes(chainID string, accnum, sequence, timeout uint64, fee StdFee, msgs []sdk.Msg, memo string, tip *tx.Tip) []byte {
msgsBytes := make([]json.RawMessage, 0, len(msgs))
for _, msg := range msgs {

View File

@ -22,18 +22,22 @@ type signModeLegacyAminoJSONHandler struct{}
// NewSignModeLegacyAminoJSONHandler returns a new signModeLegacyAminoJSONHandler.
// Note: The public constructor is only used for testing.
// Deprecated: Please use x/tx/signing/aminojson instead.
func NewSignModeLegacyAminoJSONHandler() signing.SignModeHandler {
return signModeLegacyAminoJSONHandler{}
}
// Deprecated: Please use x/tx/signing/aminojson instead.
func (s signModeLegacyAminoJSONHandler) DefaultMode() signingtypes.SignMode {
return signingtypes.SignMode_SIGN_MODE_LEGACY_AMINO_JSON
}
// Deprecated: Please use x/tx/signing/aminojson instead.
func (s signModeLegacyAminoJSONHandler) Modes() []signingtypes.SignMode {
return []signingtypes.SignMode{signingtypes.SignMode_SIGN_MODE_LEGACY_AMINO_JSON}
}
// Deprecated: Please use x/tx/signing/aminojson instead.
func (s signModeLegacyAminoJSONHandler) GetSignBytes(mode signingtypes.SignMode, data signing.SignerData, tx sdk.Tx) ([]byte, error) {
if mode != signingtypes.SignMode_SIGN_MODE_LEGACY_AMINO_JSON {
return nil, fmt.Errorf("expected %s, got %s", signingtypes.SignMode_SIGN_MODE_LEGACY_AMINO_JSON, mode)