@@ -69,22 +69,24 @@ type AccountAbstractionKeeper interface {
69
69
//
70
70
// CONTRACT: Tx must implement SigVerifiableTx interface
71
71
type SigVerificationDecorator struct {
72
- ak AccountKeeper
73
- aaKeeper AccountAbstractionKeeper
74
- signModeHandler * txsigning.HandlerMap
75
- sigGasConsumer SignatureVerificationGasConsumer
72
+ ak AccountKeeper
73
+ aaKeeper AccountAbstractionKeeper
74
+ signModeHandler * txsigning.HandlerMap
75
+ sigGasConsumer SignatureVerificationGasConsumer
76
+ extraVerifyIsOnCurve func (pubKey cryptotypes.PubKey ) (bool , error )
76
77
}
77
78
78
79
func NewSigVerificationDecorator (ak AccountKeeper , signModeHandler * txsigning.HandlerMap , sigGasConsumer SignatureVerificationGasConsumer , aaKeeper AccountAbstractionKeeper ) SigVerificationDecorator {
79
- return NewSigVerificationDecoratorWithVerifyOnCurve (ak , signModeHandler , sigGasConsumer , aaKeeper )
80
+ return NewSigVerificationDecoratorWithVerifyOnCurve (ak , signModeHandler , sigGasConsumer , aaKeeper , nil )
80
81
}
81
82
82
- func NewSigVerificationDecoratorWithVerifyOnCurve (ak AccountKeeper , signModeHandler * txsigning.HandlerMap , sigGasConsumer SignatureVerificationGasConsumer , aaKeeper AccountAbstractionKeeper ) SigVerificationDecorator {
83
+ func NewSigVerificationDecoratorWithVerifyOnCurve (ak AccountKeeper , signModeHandler * txsigning.HandlerMap , sigGasConsumer SignatureVerificationGasConsumer , aaKeeper AccountAbstractionKeeper , verifyFn func ( pubKey cryptotypes. PubKey ) ( bool , error ) ) SigVerificationDecorator {
83
84
return SigVerificationDecorator {
84
- aaKeeper : aaKeeper ,
85
- ak : ak ,
86
- signModeHandler : signModeHandler ,
87
- sigGasConsumer : sigGasConsumer ,
85
+ aaKeeper : aaKeeper ,
86
+ ak : ak ,
87
+ signModeHandler : signModeHandler ,
88
+ sigGasConsumer : sigGasConsumer ,
89
+ extraVerifyIsOnCurve : verifyFn ,
88
90
}
89
91
}
90
92
@@ -110,6 +112,12 @@ func OnlyLegacyAminoSigners(sigData signing.SignatureData) bool {
110
112
}
111
113
112
114
func (svd SigVerificationDecorator ) VerifyIsOnCurve (pubKey cryptotypes.PubKey ) error {
115
+ if svd .extraVerifyIsOnCurve != nil {
116
+ handled , err := svd .extraVerifyIsOnCurve (pubKey )
117
+ if handled {
118
+ return err
119
+ }
120
+ }
113
121
// when simulating pubKey.Key will always be nil
114
122
if pubKey .Bytes () == nil {
115
123
return nil
0 commit comments