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

chore: upgrade to v0.45.7 #11

Merged
merged 21 commits into from
Aug 25, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
6dc53e0
Update tag.yml
alexanderbez Jun 9, 2022
63d768c
fix: update index of crisis invariant check logs (backport #12208) (#…
mergify[bot] Jun 10, 2022
aeab66a
fix: Refactor GetLastCompletedUpgrade [v0.45.x] (#12264)
alexanderbez Jun 15, 2022
bf7348e
fix: defaultGenTxGas to 10 times (#12314)
hea9549 Jun 21, 2022
cece44d
fix: edit validator bug from cli (#12317)
likhita-809 Jun 21, 2022
dced7ec
chore: update release notes (#12377)
julienrbrt Jun 28, 2022
f2d9444
feat: add query.GenericFilteredPaginated (backport #12253) (#12371)
mergify[bot] Jun 28, 2022
7e727e8
fix: update x/mint parameter validation (backport #12384) (#12396)
mergify[bot] Jun 30, 2022
a99988f
chore: optimize get last completed upgrade (#12268)
robert-zaremba Jul 3, 2022
5e40a14
fix: Simulation is not deterministic due to GenTx (backport #12374) (…
adu-web3 Jul 4, 2022
10961d0
fix: use go install instead of go get in makefile (#12435)
julienrbrt Jul 4, 2022
0e166fa
chore: fumpt sdk v45 series #12442
faddat Jul 5, 2022
155d9ec
feat: Move AppModule.BeginBlock and AppModule.EndBlock to extension i…
mergify[bot] Jul 19, 2022
4eec00f
feat: add message index event attribute to authz message execution (b…
mergify[bot] Jul 22, 2022
1fcc404
chore(store): upgrade iavl to v0.19.0 (backport #12626) (#12697)
mergify[bot] Jul 23, 2022
eb032e3
feat: Add `GetParamSetIfExists` to prevent panic on breaking param ch…
fedekunze Jul 26, 2022
3ae6bb4
feat: Add convenience method for constructing key to access account's…
mergify[bot] Aug 2, 2022
e23386b
chore: bump tm in 0.45.x (#12784)
tac0turtle Aug 4, 2022
35ae2c4
chore: 0.45.7 changelog prep (#12821)
tac0turtle Aug 4, 2022
ec6e5e2
chore: upgrade to `v0.45.7`
johnletey Aug 24, 2022
a6f4dba
chore: migrate from registry to delegation keeper
johnletey Aug 24, 2022
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
chore: migrate from registry to delegation keeper
  • Loading branch information
johnletey committed Aug 24, 2022
commit a6f4dba569be7c01baeaca901cf6f519c58d6078
6 changes: 3 additions & 3 deletions x/gov/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type Keeper struct {
sk types.StakingKeeper

// The reference to the ProtocolDelegationSet and ProtocolValidatorSet to get information about protocol validators and delegators
rk types.RegistryKeeper
dk types.DelegationKeeper

// GovHooks
hooks types.GovHooks
Expand All @@ -48,7 +48,7 @@ type Keeper struct {
// CONTRACT: the parameter Subspace must have the param key table already initialized
func NewKeeper(
cdc codec.BinaryCodec, key sdk.StoreKey, paramSpace types.ParamSubspace,
authKeeper types.AccountKeeper, bankKeeper types.BankKeeper, sk types.StakingKeeper, rk types.RegistryKeeper, rtr types.Router,
authKeeper types.AccountKeeper, bankKeeper types.BankKeeper, sk types.StakingKeeper, dk types.DelegationKeeper, rtr types.Router,
) Keeper {
// ensure governance module account is set
if addr := authKeeper.GetModuleAddress(types.ModuleName); addr == nil {
Expand All @@ -66,7 +66,7 @@ func NewKeeper(
authKeeper: authKeeper,
bankKeeper: bankKeeper,
sk: sk,
rk: rk,
dk: dk,
cdc: cdc,
router: rtr,
}
Expand Down
20 changes: 9 additions & 11 deletions x/gov/keeper/tally.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,15 @@ func (keeper Keeper) Tally(ctx sdk.Context, proposal types.Proposal) (passes boo
})

//
if keeper.rk != nil {
keeper.rk.IterateProtocolBonding(ctx, voter, func(poolId uint64, amount sdk.Int) (stop bool) {
for _, option := range vote.Options {
subPower := amount.ToDec().Mul(option.Weight)
results[option.Option] = results[option.Option].Add(subPower)
}
if keeper.dk != nil {
amount := keeper.dk.GetBondingOfAddress(ctx, voter)

totalVotingPower = totalVotingPower.Add(amount.ToDec())
for _, option := range vote.Options {
subPower := amount.ToDec().Mul(option.Weight)
results[option.Option] = results[option.Option].Add(subPower)
}

return false
})
totalVotingPower = totalVotingPower.Add(amount.ToDec())
}

keeper.deleteVote(ctx, vote.ProposalId, voter)
Expand All @@ -104,8 +102,8 @@ func (keeper Keeper) Tally(ctx sdk.Context, proposal types.Proposal) (passes boo
tallyResults = types.NewTallyResultFromMap(results)

totalProtocolBonded := sdk.ZeroInt()
if keeper.rk != nil {
totalProtocolBonded = keeper.rk.TotalProtocolBonding(ctx)
if keeper.dk != nil {
totalProtocolBonded = keeper.dk.TotalProtocolBonding(ctx)
}
totalBonded := keeper.sk.TotalBondedTokens(ctx).Add(totalProtocolBonded)

Expand Down
6 changes: 3 additions & 3 deletions x/gov/types/expected_keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ type StakingKeeper interface {
)
}

// RegistryKeeper expected registry keeper (Protocol Validator and Delegator sets) (noalias)
type RegistryKeeper interface {
IterateProtocolBonding(ctx sdk.Context, address sdk.AccAddress, fn func(poolId uint64, amount sdk.Int) (stop bool))
// DelegationKeeper expected delegation keeper (Protocol Validator and Delegator sets) (noalias)
type DelegationKeeper interface {
GetBondingOfAddress(ctx sdk.Context, address sdk.AccAddress) sdk.Int
TotalProtocolBonding(ctx sdk.Context) sdk.Int
}

Expand Down