diff --git a/x/smart-account/ante/pubkey.go b/x/smart-account/ante/pubkey.go index d2631c2d191..5c322e819cc 100644 --- a/x/smart-account/ante/pubkey.go +++ b/x/smart-account/ante/pubkey.go @@ -11,6 +11,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/tx/signing" authante "github.com/cosmos/cosmos-sdk/x/auth/ante" authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" + smartaccounttypes "github.com/osmosis-labs/osmosis/v25/x/smart-account/types" ) // EmitPubKeyDecoratorEvents emits the events that the SetPubKeyDecorator would emit. This is needed for backwards @@ -49,8 +50,8 @@ func (spkd EmitPubKeyDecoratorEvents) AnteHandle(ctx sdk.Context, tx sdk.Tx, sim var events sdk.Events for i, sig := range sigs { events = append(events, sdk.NewEvent(sdk.EventTypeTx, - // TODO: add authenticator specific events here sdk.NewAttribute(sdk.AttributeKeyAccountSequence, fmt.Sprintf("%s/%d", signers[i], sig.Sequence)), + sdk.NewAttribute(smartaccounttypes.AttributeKeyAccountSequenceAuthenticator, fmt.Sprintf("%s/%d", signers[i], sig.Sequence)), )) sigBzs, err := signatureDataToBz(sig.Data) @@ -59,8 +60,8 @@ func (spkd EmitPubKeyDecoratorEvents) AnteHandle(ctx sdk.Context, tx sdk.Tx, sim } for _, sigBz := range sigBzs { events = append(events, sdk.NewEvent(sdk.EventTypeTx, - // TODO: add authenticator specific events here sdk.NewAttribute(sdk.AttributeKeySignature, base64.StdEncoding.EncodeToString(sigBz)), + sdk.NewAttribute(smartaccounttypes.AttributeKeySignatureAuthenticator, base64.StdEncoding.EncodeToString(sigBz)), )) } } diff --git a/x/smart-account/post/post.go b/x/smart-account/post/post.go index d8353f0d536..e55ec957223 100644 --- a/x/smart-account/post/post.go +++ b/x/smart-account/post/post.go @@ -97,7 +97,8 @@ func (ad AuthenticatorPostDecorator) PostHandle( } // We skip replay protection here as it was already checked on authenticate. - // TODO: We probably want to avoid calling this function again. Can we keep this in cache? maybe in transient store? + // TODO: Cache the authenticationRequest in the AnteHandler and reuse here. + // https://github.com/osmosis-labs/osmosis/issues/8371 authenticationRequest, err := authenticator.GenerateAuthenticationRequest( ctx, ad.cdc, diff --git a/x/smart-account/types/keys.go b/x/smart-account/types/keys.go index 6ca018810d2..2190231aec4 100644 --- a/x/smart-account/types/keys.go +++ b/x/smart-account/types/keys.go @@ -24,6 +24,9 @@ const ( AttributeKeyAuthenticatorId = "authenticator_id" AtrributeKeyIsSmartAccountActive = "is_smart_account_active" + + AttributeKeyAccountSequenceAuthenticator = "authenticator_acc_seq" + AttributeKeySignatureAuthenticator = "authenticator_signature" ) var ( diff --git a/x/smart-account/types/msgs.go b/x/smart-account/types/msgs.go index 6ed74edc29a..62cea695926 100644 --- a/x/smart-account/types/msgs.go +++ b/x/smart-account/types/msgs.go @@ -37,7 +37,6 @@ func (msg *MsgAddAuthenticator) GetSigners() []sdk.AccAddress { var _ sdk.Msg = &MsgRemoveAuthenticator{} func (msg *MsgRemoveAuthenticator) ValidateBasic() error { - // TODO: call validate here return validateSender(msg.Sender) }