Skip to content

Commit

Permalink
fix: set light node sale amount in GRAIN
Browse files Browse the repository at this point in the history
  • Loading branch information
maharifu committed Sep 2, 2024
1 parent 7410481 commit 63b2386
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion x/paloma/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,9 @@ func (k Keeper) CreateSaleLightNodeClientLicense(
clientAddr string,
amount math.Int,
) error {
coin := sdk.NewCoin(k.bondDenom, amount)
// The amount will be set in GRAIN, but we want it here in uGRAIN, so we
// need to multiply by 1_000_000
coin := sdk.NewCoin(k.bondDenom, amount.Mul(math.NewInt(1_000_000)))

feegranter, err := k.LightNodeClientFeegranter(ctx)
if err != nil {
Expand Down
5 changes: 4 additions & 1 deletion x/paloma/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,10 @@ func TestCreateSaleLightNodeClientLicense(t *testing.T) {
amount := math.NewInt(100)
license := &types.LightNodeClientLicense{
ClientAddress: clientAddr,
Amount: sdk.Coin{Amount: amount, Denom: testBondDenom},
Amount: sdk.Coin{
Amount: amount.Mul(math.NewInt(1_000_000)),
Denom: testBondDenom,
},
VestingMonths: 24,
}

Expand Down

0 comments on commit 63b2386

Please sign in to comment.