-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
revert: Remove SIGN_MODE_AMINO_AUX #10322
Merged
Merged
Changes from 15 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
6ec5722
Add IsTipper
amaury1093 6eb5a10
Use addr in signer data
amaury1093 72a56cb
Always populate addr in signer data
amaury1093 c0bd505
fi error messages
amaury1093 551f5f4
make proto gen
amaury1093 49987e7
Merge branch 'master' into am/0fee0gas
amaury1093 76b8dff
fix build
amaury1093 3f04021
Remove getSequence
amaury1093 894a7ce
Use addressCodec
amaury1093 6c66bfb
NewTxConfig with addrCdc
amaury1093 debee8d
REmove simapp.NewBech32
amaury1093 e3a7c35
Move bech32 stuff to x/auth/address
amaury1093 dfd1d82
Add changelog
amaury1093 7092ee8
Move address.Codec to x/auth
amaury1093 bac6349
Fix test
amaury1093 5bdbbf3
revert API breaking changes
amaury1093 4992111
cleanup
amaury1093 6d8734a
Less file diff
amaury1093 1541e4b
Merge branch 'master' into am/0fee0gas
amaury1093 a86e778
Merge branch 'master' into am/0fee0gas
amaury1093 defddc5
Merge branch 'master' into am/0fee0gas
amaury1093 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package address | ||
|
||
import ( | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/cosmos/cosmos-sdk/types/bech32" | ||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" | ||
) | ||
|
||
// Bech32Codec is a address.Codec based on bech32 encoding. | ||
type Bech32Codec struct { | ||
Bech32Prefix string | ||
} | ||
|
||
var _ Codec = &Bech32Codec{} | ||
amaury1093 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
// NewBech32Codec creates a new address.Codec based on bech32 encoding. | ||
func NewBech32Codec(prefix string) Codec { | ||
return Bech32Codec{prefix} | ||
} | ||
|
||
// StringToBytes encodes text to bytes. | ||
func (bc Bech32Codec) StringToBytes(text string) ([]byte, error) { | ||
hrp, bz, err := bech32.DecodeAndConvert(text) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
if hrp != bc.Bech32Prefix { | ||
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "hrp does not match bech32Prefix") | ||
} | ||
|
||
if err := sdk.VerifyAddressFormat(bz); err != nil { | ||
return nil, err | ||
} | ||
|
||
return bz, nil | ||
} | ||
|
||
// BytesToString decodes bytes to text. | ||
func (bc Bech32Codec) BytesToString(bz []byte) (string, error) { | ||
text, err := bech32.ConvertAndEncode(bc.Bech32Prefix, bz) | ||
if err != nil { | ||
return "", err | ||
} | ||
|
||
return text, nil | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this was removed before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The signerData.Address field was actually never present before, and newly added in this PR