Skip to content

Commit

Permalink
fix: set light node sale amount in GRAIN (#1280)
Browse files Browse the repository at this point in the history
# Related Github tickets

- #2105

# Background

Fix the units on the node sale amounts.

# Testing completed

- [ ] test coverage exists or has been added/updated
- [ ] tested in a private testnet

# Breaking changes

- [ ] I have checked my code for breaking changes
- [ ] If there are breaking changes, there is a supporting migration.
  • Loading branch information
maharifu authored Sep 2, 2024
1 parent 7410481 commit 441cc06
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 441cc06

Please sign in to comment.