fix(x/auth): check if simulation in verifyIsOnCurve (#19099)
Co-authored-by: Marko <marbar3778@yahoo.com> Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
This commit is contained in:
parent
3c4a91efd0
commit
38d56db428
@ -48,3 +48,8 @@ Ref: https://keepachangelog.com/en/1.0.0/
|
||||
|
||||
* [#18817](https://github.com/cosmos/cosmos-sdk/pull/18817) SigVerification, GasConsumption, IncreaseSequence ante decorators have all been joined into one SigVerification decorator. Gas consumption during TX validation flow has reduced.
|
||||
* [#19093](https://github.com/cosmos/cosmos-sdk/pull/19093) SetPubKeyDecorator was merged into SigVerification, gas consumption is almost halved for a simple tx.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* [#19099](https://github.com/cosmos/cosmos-sdk/pull/19099) `verifyIsOnCurve` now checks if we are simulating to avoid malformed public key error.
|
||||
|
||||
|
||||
@ -95,6 +95,11 @@ func OnlyLegacyAminoSigners(sigData signing.SignatureData) bool {
|
||||
}
|
||||
|
||||
func verifyIsOnCurve(pubKey cryptotypes.PubKey) (err error) {
|
||||
// when simulating pubKey.Key will always be nil
|
||||
if pubKey.Bytes() == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
switch typedPubKey := pubKey.(type) {
|
||||
case *secp256k1.PubKey:
|
||||
pubKeyObject, err := secp256k1dcrd.ParsePubKey(typedPubKey.Bytes())
|
||||
|
||||
Loading…
Reference in New Issue
Block a user