Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "fix: revert Finschia#952 (Finschia#984)"
Browse files Browse the repository at this point in the history
This reverts commit ea50f75.
0Tech committed Aug 9, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 2d437b0 commit 170140a
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion client/grpc/tmservice/service_test.go
Original file line number Diff line number Diff line change
@@ -152,7 +152,7 @@ func (s IntegrationTestSuite) TestQueryBlockResultsByHeight() {
s.Require().Equal(0, len(txResult))

beginBlock := blockResultsRes.GetResBeginBlock()
s.Require().Equal(11, len(beginBlock.Events)) // coinbase event (6) + transfer mintModule to feeCollectorName(5)
s.Require().Equal(7, len(beginBlock.Events)) // coinbase event (6) + transfer mintModule to feeCollectorName(5) - foundation abci (4)

endBlock := blockResultsRes.GetResEndBlock()
s.Require().Equal(0, len(endBlock.Events))
6 changes: 6 additions & 0 deletions x/foundation/keeper/internal/treasury.go
Original file line number Diff line number Diff line change
@@ -9,11 +9,17 @@ import (
func (k Keeper) CollectFoundationTax(ctx sdk.Context) error {
feeCollector := k.authKeeper.GetModuleAccount(ctx, k.feeCollectorName).GetAddress()
feesCollectedInt := k.bankKeeper.GetAllBalances(ctx, feeCollector)
if feesCollectedInt.Empty() {
return nil
}
feesCollected := sdk.NewDecCoinsFromCoins(feesCollectedInt...)

// calculate the tax
taxRatio := k.GetFoundationTax(ctx)
tax, _ := feesCollected.MulDecTruncate(taxRatio).TruncateDecimal()
if tax.Empty() {
return nil
}

// collect the tax
if err := k.FundTreasury(ctx, feeCollector, tax); err != nil {

0 comments on commit 170140a

Please sign in to comment.