Skip to content

Commit ea50f75

Browse files
authored
fix: revert #952 (#984)
* Do SendCoins() even if the coins is empty * Update CHANGELOG.md
1 parent 4845096 commit ea50f75

File tree

3 files changed

+2
-7
lines changed

3 files changed

+2
-7
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
6464
* (x/collection) [\#961](https://github.com/Finschia/finschia-sdk/pull/961) Do not loop enum in x/collection
6565
* (x/collection,token) [\#957](https://github.com/Finschia/finschia-sdk/pull/957) Refactor queries of x/collection and x/token
6666
* (x/auth) [\#982](https://github.com/Finschia/finschia-sdk/pull/957) Fix not to emit error when no txs in block while querying `GetBlockWithTxs`
67+
* (x/foundation) [\#984](https://github.com/Finschia/finschia-sdk/pull/984) Revert #952
6768

6869
### Removed
6970
* (x/collection,token) [\#966](https://github.com/Finschia/finschia-sdk/pull/966) Remove legacy events on x/collection and x/token

client/grpc/tmservice/service_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ func (s IntegrationTestSuite) TestQueryBlockResultsByHeight() {
152152
s.Require().Equal(0, len(txResult))
153153

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

157157
endBlock := blockResultsRes.GetResEndBlock()
158158
s.Require().Equal(0, len(endBlock.Events))

x/foundation/keeper/internal/treasury.go

-6
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,11 @@ import (
99
func (k Keeper) CollectFoundationTax(ctx sdk.Context) error {
1010
feeCollector := k.authKeeper.GetModuleAccount(ctx, k.feeCollectorName).GetAddress()
1111
feesCollectedInt := k.bankKeeper.GetAllBalances(ctx, feeCollector)
12-
if feesCollectedInt.Empty() {
13-
return nil
14-
}
1512
feesCollected := sdk.NewDecCoinsFromCoins(feesCollectedInt...)
1613

1714
// calculate the tax
1815
taxRatio := k.GetFoundationTax(ctx)
1916
tax, _ := feesCollected.MulDecTruncate(taxRatio).TruncateDecimal()
20-
if tax.Empty() {
21-
return nil
22-
}
2317

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

0 commit comments

Comments
 (0)