Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe committed May 3, 2024
1 parent e260335 commit 96a5eef
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions x/e2ee/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ func (k Keeper) RegisterEncryptionKey(
ctx context.Context,
req *types.MsgRegisterEncryptionKey,
) (*types.MsgRegisterEncryptionKeyResponse, error) {
if err := req.ValidateBasic(); err != nil {
return nil, err
}
bz, err := k.addressCodec.StringToBytes(req.Address)
if err != nil {
return nil, err
Expand All @@ -49,10 +46,14 @@ func (k Keeper) InitGenesis(
state *types.GenesisState,
) error {
for _, key := range state.Keys {
if _, err := k.RegisterEncryptionKey(ctx, &types.MsgRegisterEncryptionKey{
m := types.MsgRegisterEncryptionKey{

Check failure on line 49 in x/e2ee/keeper/keeper.go

View workflow job for this annotation

GitHub Actions / Run golangci-lint

S1016: should convert key (type github.com/crypto-org-chain/cronos/v2/x/e2ee/types.EncryptionKeyEntry) to github.com/crypto-org-chain/cronos/v2/x/e2ee/types.MsgRegisterEncryptionKey instead of using struct literal (gosimple)

Check warning on line 49 in x/e2ee/keeper/keeper.go

View check run for this annotation

Codecov / codecov/patch

x/e2ee/keeper/keeper.go#L49

Added line #L49 was not covered by tests
Address: key.Address,
Key: key.Key,
}); err != nil {
}
if err := m.ValidateBasic(); err != nil {
return err

Check warning on line 54 in x/e2ee/keeper/keeper.go

View check run for this annotation

Codecov / codecov/patch

x/e2ee/keeper/keeper.go#L53-L54

Added lines #L53 - L54 were not covered by tests
}
if _, err := k.RegisterEncryptionKey(ctx, &m); err != nil {

Check warning on line 56 in x/e2ee/keeper/keeper.go

View check run for this annotation

Codecov / codecov/patch

x/e2ee/keeper/keeper.go#L56

Added line #L56 was not covered by tests
return err
}
}
Expand Down

0 comments on commit 96a5eef

Please sign in to comment.