forked from cosmos/cosmos-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fee_pool.go
34 lines (27 loc) · 771 Bytes
/
fee_pool.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package types
import (
"fmt"
sdk "github.com/cosmos/cosmos-sdk/types"
)
// global fee pool for distribution
type FeePool struct {
CommunityPool sdk.DecCoins `json:"community_pool"` // pool for community funds yet to be spent
}
// zero fee pool
func InitialFeePool() FeePool {
return FeePool{
CommunityPool: sdk.DecCoins{},
}
}
// ValidateGenesis validates the fee pool for a genesis state
func (f FeePool) ValidateGenesis() error {
if f.CommunityPool.HasNegative() {
return fmt.Errorf("negative CommunityPool in distribution fee pool, is %v",
f.CommunityPool)
}
return nil
}
// outstanding (un-withdrawn) rewards for everyone
// excludes the community pool
// inexpensive to track, allows simple sanity checks
type OutstandingRewards = sdk.DecCoins