Skip to content
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

fix: remove some todos #8354

Merged
merged 2 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions x/smart-account/ante/pubkey.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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)),
))
}
}
Expand Down
3 changes: 2 additions & 1 deletion x/smart-account/post/post.go
Original file line number Diff line number Diff line change
Expand Up @@ -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?
PaddyMc marked this conversation as resolved.
Show resolved Hide resolved
// 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,
Expand Down
3 changes: 3 additions & 0 deletions x/smart-account/types/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ const (
AttributeKeyAuthenticatorId = "authenticator_id"

AtrributeKeyIsSmartAccountActive = "is_smart_account_active"

AttributeKeyAccountSequenceAuthenticator = "authenticator_acc_seq"
AttributeKeySignatureAuthenticator = "authenticator_signature"
)

var (
Expand Down
1 change: 0 additions & 1 deletion x/smart-account/types/msgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down