Skip to content

Commit

Permalink
🐛 Fix fee per byte feegrant for likenft messages
Browse files Browse the repository at this point in the history
  • Loading branch information
nnkken authored and williamchong committed May 15, 2023
1 parent 24f0ac2 commit 1a2f157
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions x/likenft/keeper/msg_server_blind_box_content.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (k msgServer) CreateBlindBoxContent(goCtx context.Context, msg *types.MsgCr
if err != nil {
return nil, sdkerrors.ErrInvalidAddress.Wrapf(err.Error())
}
err = k.DeductFeePerByte(ctx, userAddress, content.Size(), nil)
err = k.DeductFeePerByte(ctx, userAddress, content.Size(), msg)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -116,7 +116,7 @@ func (k msgServer) UpdateBlindBoxContent(goCtx context.Context, msg *types.MsgUp
if err != nil {
return nil, sdkerrors.ErrInvalidAddress.Wrapf(err.Error())
}
err = k.DeductFeePerByte(ctx, userAddress, lengthDiff, nil)
err = k.DeductFeePerByte(ctx, userAddress, lengthDiff, msg)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion x/likenft/keeper/msg_server_mint_nft.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func (k msgServer) mintRegularNFT(ctx sdk.Context, classId string, classData *ty
Data: nftDataInAny,
}
// Deduct minting fee
err = k.DeductFeePerByte(ctx, userAddress, nft.Size(), nil)
err = k.DeductFeePerByte(ctx, userAddress, nft.Size(), msg)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion x/likenft/keeper/msg_server_new_class.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (k msgServer) NewClass(goCtx context.Context, msg *types.MsgNewClass) (*typ
Data: classDataInAny,
}
// Deduct fee
err = k.DeductFeePerByte(ctx, parent.Owner, class.Size(), nil)
err = k.DeductFeePerByte(ctx, parent.Owner, class.Size(), msg)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion x/likenft/keeper/msg_server_update_class.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (k msgServer) UpdateClass(goCtx context.Context, msg *types.MsgUpdateClass)
// Deduct minting fee if new content is longer
lengthDiff := newClass.Size() - oldClass.Size()
if lengthDiff > 0 {
err = k.DeductFeePerByte(ctx, parent.Owner, lengthDiff, nil)
err = k.DeductFeePerByte(ctx, parent.Owner, lengthDiff, msg)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 1a2f157

Please sign in to comment.