Skip to content

Commit

Permalink
G-01
Browse files Browse the repository at this point in the history
  • Loading branch information
Reecepbcups committed Dec 16, 2024
1 parent 173b6e9 commit b4403a3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 1 addition & 6 deletions x/tokenfactory/keeper/admins.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,7 @@ func (k Keeper) setAuthorityMetadata(ctx context.Context, denom string, metadata
return nil
}

func (k Keeper) setAdmin(ctx context.Context, denom string, admin string) error {
metadata, err := k.GetAuthorityMetadata(sdk.UnwrapSDKContext(ctx), denom)
if err != nil {
return err
}

func (k Keeper) setAdmin(ctx context.Context, metadata types.DenomAuthorityMetadata, denom string, admin string) error {
metadata.Admin = admin

return k.setAuthorityMetadata(ctx, denom, metadata)
Expand Down
2 changes: 1 addition & 1 deletion x/tokenfactory/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func (server msgServer) ChangeAdmin(goCtx context.Context, msg *types.MsgChangeA
return nil, types.ErrUnauthorized
}

err = server.Keeper.setAdmin(ctx, msg.Denom, msg.NewAdmin)
err = server.Keeper.setAdmin(ctx, authorityMetadata, msg.Denom, msg.NewAdmin)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit b4403a3

Please sign in to comment.