Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query genesis transactions #4788

Merged
merged 18 commits into from
Aug 1, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update APIs
  • Loading branch information
alexanderbez committed Jul 31, 2019
commit ed4be97f6a4afeb030b68b10300213af67f0835d
5 changes: 3 additions & 2 deletions x/supply/internal/keeper/bank.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ func (k Keeper) MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) sdk

// update total supply
supply := k.GetSupply(ctx)
supply.Inflate(amt)
supply = supply.Inflate(amt)

k.SetSupply(ctx, supply)

logger := k.Logger(ctx)
Expand Down Expand Up @@ -135,7 +136,7 @@ func (k Keeper) BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) sdk

// update total supply
supply := k.GetSupply(ctx)
supply.Deflate(amt)
supply = supply.Deflate(amt)
k.SetSupply(ctx, supply)

logger := k.Logger(ctx)
Expand Down
4 changes: 2 additions & 2 deletions x/supply/internal/keeper/bank_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func TestBurnCoins(t *testing.T) {
keeper.SetModuleAccount(ctx, burnerAcc)

initialSupply := keeper.GetSupply(ctx)
initialSupply.Inflate(initCoins)
initialSupply = initialSupply.Inflate(initCoins)
keeper.SetSupply(ctx, initialSupply)

require.Error(t, keeper.BurnCoins(ctx, "", initCoins), "no module account")
Expand All @@ -130,7 +130,7 @@ func TestBurnCoins(t *testing.T) {

// test same functionality on module account with multiple permissions
initialSupply = keeper.GetSupply(ctx)
initialSupply.Inflate(initCoins)
initialSupply = initialSupply.Inflate(initCoins)
keeper.SetSupply(ctx, initialSupply)

require.NoError(t, multiPermAcc.SetCoins(initCoins))
Expand Down