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

update fork #1

Merged
merged 537 commits into from
Nov 15, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
537 commits
Select commit Hold shift + click to select a range
c14fa12
Back to 50 initially bonded
cwgoes Oct 23, 2018
5ba3768
Add query deposits cmds
Oct 23, 2018
b27e743
Update test
Oct 23, 2018
33c8238
Merge branch 'develop' into cwgoes/check-supply-in-simulation
cwgoes Oct 23, 2018
45c9d82
Merge PR #2557: typo fix
rigelrozanski Oct 23, 2018
f587b46
Update PENDING.md
cwgoes Oct 23, 2018
6bf7e02
Back to on-operation=false, update PENDING.md
cwgoes Oct 23, 2018
604de85
Remove unnecessary change, clarify amt in sim_test.go
cwgoes Oct 23, 2018
edd56be
Cleanup, additional item in PENDING.md
cwgoes Oct 23, 2018
5476b1b
Merge PR #2543: Split GET delegator endpoint
cwgoes Oct 23, 2018
990852a
Update PENDING.md
alexanderbez Oct 23, 2018
450873d
Update client/keys/utils.go
alexanderbez Oct 23, 2018
8040a56
update depositer addr
Oct 23, 2018
306fb8f
Address @rigelrozanski comments
cwgoes Oct 23, 2018
cd9373d
Make linter happy
cwgoes Oct 23, 2018
ef8aab8
Update PENDING.md
cwgoes Oct 23, 2018
6ace08b
Remove shorthand
Oct 23, 2018
cd49e97
Make "multi" const
Oct 23, 2018
3d270ba
Store last total power as sdk.Int, not sdk.Dec
cwgoes Oct 23, 2018
701a00c
Merge PR #2570: Cmds for query deposits
cwgoes Oct 23, 2018
a231bd8
Merge PR #2555: Don't acquire lock on read-only keybase
cwgoes Oct 23, 2018
60d188d
Merge PR #2501: Simulate transactions for fee distribution, simulate …
cwgoes Oct 23, 2018
d666658
Merge PR #2553: Renamed msg.Name() and msg.Type() to msg.Type() and m…
sunnya97 Oct 23, 2018
6664cd5
Fix stupid mistake
Oct 23, 2018
68f869a
s/number/weight/
Oct 24, 2018
f756b40
LastValidatorPower is also an Int
jaekwon Oct 24, 2018
9ee9e28
Merge PR #2462: Add swagger-ui for gov, stake and slashing
Oct 24, 2018
c577831
Merge PR #2554: Make `gaiacli keys show` multisig-ready
cwgoes Oct 24, 2018
a9d9eb5
Merge branch 'master' into release/v0.25.0
cwgoes Oct 24, 2018
2342621
'make format'
cwgoes Oct 24, 2018
d33cc7c
Move PENDING to CHANGELOG
cwgoes Oct 24, 2018
075ddce
Linkify changelog
cwgoes Oct 24, 2018
23f62f7
Fix db write perm
Oct 24, 2018
507438b
Additional cleanup
Oct 24, 2018
ebca085
Merge pull request #2593 from cosmos/bez/fix-keys-new-perm
alessio Oct 25, 2018
2a279e9
Remove logs from prior debugging
cwgoes Oct 25, 2018
3ccc06a
Merge pull request #2590 from cosmos/release/v0.25.0
cwgoes Oct 25, 2018
0f1fb17
Merge PR #2599 from cosmos/jae/dist_refactor
jaekwon Oct 26, 2018
d71f38b
Merge PR #2597: Add distribution accum invariants
rigelrozanski Oct 26, 2018
0b51060
PENDING.md => CHANGELOG.md
cwgoes Oct 26, 2018
331b8ee
Manually linkify
cwgoes Oct 26, 2018
08fa597
Manually fix some links
cwgoes Oct 26, 2018
cce48dc
Docs fixes in progress while running through the release process
cwgoes Oct 26, 2018
8288490
More docs fixes
cwgoes Oct 26, 2018
860245e
'--voter' is no longer required
cwgoes Oct 26, 2018
9c28c69
Rectify validator setup documentation
cwgoes Oct 26, 2018
855e0ac
Merge PR #2596: Cmds for validator unbondings and redelegations
fedekunze Oct 28, 2018
e4b5e2c
Make simulation use a transition matrix for block size
ValarDragon Oct 29, 2018
100f888
address bez's comments
ValarDragon Oct 29, 2018
ba7ed9d
fix flags in docs, closes #2530
zramsay Oct 29, 2018
142cf74
Merge pull request #2626 from cosmos/zach/fixes
rigelrozanski Oct 29, 2018
c93b116
Merge PR #2616: Block redelegations to the same validator
cwgoes Oct 29, 2018
0d8325b
Merge PR #2623: Speedup simulator by switching to goleveldb
ValarDragon Oct 29, 2018
4cde804
Merge branch 'develop' into dev/sim_blocksize
ValarDragon Oct 30, 2018
7c5c14f
Merge pull request #2603 from cosmos/release/v0.25.0
jaekwon Oct 31, 2018
1538ab8
Merge branch 'develop' into release/v0.25.0
jaekwon Oct 31, 2018
7c0a067
Merge pull request #2604 from cosmos/release/v0.25.0
jaekwon Oct 31, 2018
206e510
fix block offsets in printing simulation block number
ValarDragon Oct 31, 2018
db1f45a
Merge pull request #2641 from cosmos/dev/fix_sim_prints
rigelrozanski Oct 31, 2018
6316e12
Merge PR #2644: Simulation: Print last block when there is an error
ValarDragon Oct 31, 2018
89047d8
Merge PR #2642: Add todo diagrams
rigelrozanski Oct 31, 2018
bc583ab
Various sign command improvements
Oct 22, 2018
933592d
Check sanity of signatures and report errors when run with --print-sigs
Oct 22, 2018
4bf17e8
Improve errors reporting
Oct 22, 2018
62974e6
Improve online docs
Oct 22, 2018
a4c4e28
Refresh PENDING.md
Oct 31, 2018
69a7c06
Find better name for --print-signature-only
Oct 22, 2018
e65c02d
Fix integration tests
Oct 23, 2018
31c0626
Validate --name
Oct 23, 2018
a514295
Fix integration tests
Oct 23, 2018
53f1233
s/--print-sigs/--validate-signatures/
Oct 23, 2018
f752525
s/--sig-only/--signature-only/
Oct 23, 2018
bb734c4
Docs updated
Oct 25, 2018
17f799a
Update PENDING.md
Oct 31, 2018
9e39790
Rename append, it's go builtin
Oct 29, 2018
44d2347
Set success = false when it fails
Oct 29, 2018
84aef0d
Apply suggestions from bez
Oct 29, 2018
6c8791f
Nest switches
Oct 29, 2018
06989be
Fix rebase
Oct 31, 2018
dbbf064
Document what --validate-signatures does
Oct 31, 2018
5e2efd9
perform minor doc and function cleanup
Oct 31, 2018
835315d
move typedef
ValarDragon Oct 31, 2018
8ae4761
Merge PR #2558: Various sign command improvements
cwgoes Oct 31, 2018
fcf5b77
Merge PR #2622: Make simulation use a transition matrix for block size
cwgoes Oct 31, 2018
9cf53f2
Merge PR #2614: Configurable Bech32 prefix for SDK users
svaishnavy Oct 31, 2018
1686ba0
Merge PR #2643: AppendTag function usage error. append elements do no…
elvin-du Nov 1, 2018
3cffe29
simulation: Make validator choice use validator set
ValarDragon Nov 1, 2018
52083e1
Update changelog
ValarDragon Nov 1, 2018
ddba4fc
Merge PR #2657: Fix config.js
zramsay Nov 1, 2018
c5238b0
Merge PR #2589: Update Vesting Spec
alexanderbez Nov 1, 2018
3657ff4
Merge PR #2656: Revert read-only leveldb database
alessio Nov 1, 2018
f4d3e65
Merge PR #2660: simulation: Make validator choice use validator set
cwgoes Nov 1, 2018
91dcd0f
Include DNS alt name in certificate
Nov 2, 2018
48192ea
Gaialite signal handling is broken, repair it
Nov 2, 2018
8e328c8
Merge PR #2665: simulation: Remove header from Invariant
ValarDragon Nov 2, 2018
b6443e9
Merge PR #2653: Add benchmark for get and set account
yutianwu Nov 2, 2018
a0a6bad
Fix test
Nov 2, 2018
36bb440
Refactor TrapSignal
Nov 2, 2018
e598af9
Fix lint
Nov 2, 2018
22ef944
Merge pull request #2666 from cosmos/alessio/2664-fix-dns-alt-name
rigelrozanski Nov 2, 2018
0d5ebd2
Merge PR #2667: Gaialite signal handling fix
rigelrozanski Nov 2, 2018
de099b4
Merge pull request #2668 from cosmos/master
jaekwon Nov 2, 2018
15c2093
enforcing @jaekwon mergemaster
jaekwon Nov 3, 2018
d378db3
added querier redelegation
sunnya97 Oct 23, 2018
9c6ef3e
added validatorDelegations querier endpoint
sunnya97 Oct 23, 2018
2d42973
LCD and CLI
sunnya97 Oct 23, 2018
f8b030a
cli fixes
sunnya97 Oct 23, 2018
eeff820
removed redelegation stuff
sunnya97 Oct 23, 2018
327f7e1
address other comments
sunnya97 Oct 23, 2018
0fc536a
rebased
sunnya97 Oct 23, 2018
4c3ac3f
addressed comments
sunnya97 Nov 4, 2018
f0024e1
Make the simulator create the new comission rate sensibly
ValarDragon Nov 4, 2018
50926ff
Update to TM v0.26.0 - Part I (#2679)
alexanderbez Nov 5, 2018
5b74e1d
Bez/tm0.26 update pt 2 redux (#2684)
jaekwon Nov 5, 2018
f4338d6
Fix merge conflict bug; Update PENDING
jaekwon Nov 5, 2018
c20fcbf
New genesis workflow (#2602)
alessio Nov 5, 2018
256ec0f
Simulation improvements (logging fix, random genesis parameters) (#2617)
cwgoes Nov 5, 2018
336415b
Fix simulation bugs; Incorprates #2676 from Sunny (#2677)
jaekwon Nov 5, 2018
cb3cb27
Merge branch 'develop' into dev/sim_msg_edit_val
cwgoes Nov 5, 2018
37abad4
'make format'
cwgoes Nov 5, 2018
dfddac3
Merge branch 'develop' into sunny/get_all_delegations_validator_querier
cwgoes Nov 5, 2018
10e8e03
Revert "enforcing @jaekwon mergemaster"
jaekwon Nov 5, 2018
080a781
Update x/stake/client/rest/query.go
fedekunze Nov 6, 2018
cc652a3
addressed fede's comment
sunnya97 Nov 6, 2018
1d3a04a
Switch gov proposal-queues to use iterators (#2638)
sunnya97 Nov 7, 2018
2779f4d
Add general merkle absence proof (also for empty substores) (#2685)
jaekwon Nov 7, 2018
2a3d1f1
Fix coins.IsLT() impl (#2686)
jaekwon Nov 7, 2018
4f46a4c
Update testnet to use canonical genesis time (#2692)
alexanderbez Nov 7, 2018
c7b3efd
Do not allow nil values to be set in CacheKVStore (#2708)
jaekwon Nov 7, 2018
02327e1
Makefile OS compatibility update
greg-szabo Nov 7, 2018
8f690b5
Merge PR #2714: Add commission data to MsgCreateValidator signature b…
alexanderbez Nov 7, 2018
ee8bcbd
PENDING => CHANGELOG
cwgoes Nov 7, 2018
ccb329b
Linkify changelog
cwgoes Nov 7, 2018
812784c
Cleanup bank keeper
Nov 7, 2018
74b2a90
whitespacing
rigelrozanski Nov 7, 2018
6a7c4d1
rand utile
rigelrozanski Nov 7, 2018
78c3430
moving stuff around a bit, trying to get rid of types
rigelrozanski Nov 7, 2018
ea7a5ea
reorganize more
rigelrozanski Nov 7, 2018
980dd78
rename ambig naming of queueOperations
rigelrozanski Nov 7, 2018
b5a205e
minimizing indentation
rigelrozanski Nov 7, 2018
b8c6075
Merge remote-tracking branch 'origin/release/v0.26.0' into rigel/sim-…
rigelrozanski Nov 7, 2018
4970754
fix some duplicate to get passing
rigelrozanski Nov 7, 2018
845dd68
Address style comments
Nov 7, 2018
817f515
Merge branch 'develop' into dev/sim_msg_edit_val
ValarDragon Nov 7, 2018
d4fb6d4
Reorganize CLI command structure. Fixes #2575
jackzampolin Nov 7, 2018
c20e383
Fix missing flags issue
jackzampolin Nov 7, 2018
cade5f5
Address linting issues
jackzampolin Nov 7, 2018
0ab5d76
Fix gobash CLI testing
jackzampolin Nov 8, 2018
1aae086
Fix typo
jackzampolin Nov 8, 2018
74549fa
Cross-compiling get_tools Makefile added
greg-szabo Nov 8, 2018
1ee6c32
operations functions
rigelrozanski Nov 8, 2018
ff32704
assertAllInvarients changes, Operation reorg
rigelrozanski Nov 8, 2018
fee0763
mock tendermint
rigelrozanski Nov 8, 2018
eb16a01
util cleanup
rigelrozanski Nov 8, 2018
5f289e5
event stats object, more general cleanup
rigelrozanski Nov 8, 2018
a9ef83b
compiling
rigelrozanski Nov 8, 2018
bbf574c
pending
rigelrozanski Nov 8, 2018
9bbd3e3
Removed comment from Makefile as per bez's request
greg-szabo Nov 8, 2018
bfc7944
val comments
rigelrozanski Nov 8, 2018
8f4c7df
Address PR comments
jackzampolin Nov 8, 2018
0ff12bb
Update cmd/gaia/cmd/gaiacli/main.go
fedekunze Nov 8, 2018
6c261ee
PENDING
jackzampolin Nov 8, 2018
94f4531
Fix state export/import, add to CI (#2690)
cwgoes Nov 9, 2018
02da397
Merge 0.26.0 back to develop (#2718)
cwgoes Nov 9, 2018
d8b6d1d
Update CHANGELOG/PENDING for straggling PR #2690
jaekwon Nov 9, 2018
8550968
Merge pull request #2739 from cosmos/develop
jaekwon Nov 9, 2018
a4af659
Merge pull request #2740 from cosmos/master
jaekwon Nov 9, 2018
4f6f8e0
Add small utility to add account to genesis.json after gaiad init
Nov 6, 2018
194691f
Update CHANGELOG.md
Nov 9, 2018
8a7c490
s/WriteGenesisFile/ExportGenesisFile/
Nov 9, 2018
4d1246d
Merge branch 'develop' into sunny/get_all_delegations_validator_querier
cwgoes Nov 9, 2018
8a58fdf
Merge branch 'develop' into rigel/sim-cleanup
cwgoes Nov 9, 2018
7031bc8
Update PENDING.md
cwgoes Nov 9, 2018
201abfe
Add --chain-id to testnet command
Nov 9, 2018
d761eb7
Address remaining comments from #2690
cwgoes Nov 9, 2018
fc56dd0
Update PENDING.md
Nov 9, 2018
b1ba6a4
add back in PeriodicInvariant
rigelrozanski Nov 9, 2018
f9c7281
Linter fix
cwgoes Nov 9, 2018
2aa14d9
Merge PR #2749: Add --chain-id to testnet command
cwgoes Nov 9, 2018
1049a26
Merge PR #2720: x/mock/simulation cleanup and re-org
cwgoes Nov 9, 2018
241f636
Merge branch 'develop' into cwgoes/fix-gov-sim-more-import-export
cwgoes Nov 9, 2018
056e75c
Merge pull request #2704 from cosmos/alessio/utility-to-add-accts-to-…
jackzampolin Nov 9, 2018
61fd142
Fix TimeoutCommit (#2743)
hendrikhofstadt Nov 10, 2018
e66a39c
Gaia-9000: Update to TM 0.26.1-rc2 (#2753)
jackzampolin Nov 10, 2018
bb54a0d
Gaia-9000: Update to TM 0.26.1-rc3 -- pex SeedMode fix
jaekwon Nov 10, 2018
3bc245e
fix typo
WALL-E Nov 11, 2018
338b49b
Slight distribution spec cleanup
Nov 11, 2018
795a76d
More cleanup
Nov 11, 2018
183c7b2
use defer
jaekwon Nov 12, 2018
811b863
Use correct Bech32 prefix for show-address command (#2746)
alexanderbez Nov 12, 2018
156370e
Generate random moniker when missing
Nov 12, 2018
29bec83
Update moniker prefix
Nov 12, 2018
08a1667
Require moniker instead of generating a random one
Nov 12, 2018
fdad4aa
update to tendermint v0.26.1
ebuchman Nov 12, 2018
8c14b1d
Fix test coverage
Nov 12, 2018
81ae35c
Merge branch 'develop' into cwgoes/fix-gov-sim-more-import-export
cwgoes Nov 12, 2018
2b32268
Correctly set return code
cwgoes Nov 12, 2018
2d38a96
Fix date to be cross platform
jackzampolin Nov 12, 2018
7a9687a
Merge pull request #2782 from cosmos/jack/date-fix
jackzampolin Nov 12, 2018
7082649
Merge PR #2752: Don't hardcode bondable denom
alessio Nov 12, 2018
b7daf23
R4R: Fix unbonding command flow (#2727)
jackzampolin Nov 12, 2018
0228d8f
Merge branch 'develop' into dev/sim_msg_edit_val
cwgoes Nov 12, 2018
82af3be
Merge branch 'develop' into greg/MakefileFix2672
jackzampolin Nov 12, 2018
9c01348
Merge branch 'develop' into greg/MakefileFix2672
cwgoes Nov 12, 2018
689d3ba
Merge branch 'greg/MakefileFix2672' of github.com:cosmos/cosmos-sdk i…
cwgoes Nov 12, 2018
bbf8e54
Merge PR #2719: Cleanup bank keeper
cwgoes Nov 12, 2018
ac8f2da
Merge branch 'develop' into jack/query-tx-reorg
jackzampolin Nov 12, 2018
0345f38
Merge pull request #2682 from cosmos/dev/sim_msg_edit_val
jackzampolin Nov 12, 2018
fd7175d
Merge pull request #2709 from cosmos/greg/MakefileFix2672
jackzampolin Nov 12, 2018
3bbb1e1
Merge pull request #2774 from cosmos/bucky/tm-v0.26.1
jackzampolin Nov 12, 2018
4df780b
Merge branch 'develop' into bez/require-moniker-init
jackzampolin Nov 12, 2018
b9b6f26
Merge pull request #2761 from WALL-E/patch-1
jackzampolin Nov 12, 2018
9641233
Fix required flag
Nov 12, 2018
97c0251
Fix redelegation command
jackzampolin Nov 12, 2018
8be97ee
Add pending entry
jackzampolin Nov 12, 2018
4177f30
Merge PR #2786: Fix redelegation command follow up to #2727
cwgoes Nov 12, 2018
182f111
update swagger.yaml
Nov 12, 2018
b255a7d
Merge branch 'develop' into sunny/get_all_delegations_validator_querier
jackzampolin Nov 12, 2018
7dfeb7d
use newQuery...Params
Nov 12, 2018
a6af76e
Merge branch 'sunny/get_all_delegations_validator_querier' of https:/…
Nov 12, 2018
e76a18d
Link to issue
cwgoes Nov 13, 2018
a4e5d8e
Merge PR #2773: Require moniker on `gaiad init`
cwgoes Nov 13, 2018
d2a5353
Merge branch 'develop' into cwgoes/fix-gov-sim-more-import-export
cwgoes Nov 13, 2018
0e56ed9
Fix DiffKVStore
cwgoes Nov 13, 2018
46b331d
Address PR review
Nov 13, 2018
10713e3
Working on stake import/export
cwgoes Nov 13, 2018
3686a3f
Only apply validator set updates on initial genesis
cwgoes Nov 13, 2018
267728f
Clarify comment
cwgoes Nov 13, 2018
17c119d
Fix failing test
jackzampolin Nov 13, 2018
12ad39e
R4R: Reorganize CLI command structure. (#2728)
jackzampolin Nov 13, 2018
695395a
Merge branch 'develop' into sunny/get_all_delegations_validator_querier
jackzampolin Nov 13, 2018
4ebe99b
add back in CLI command after rebase
jackzampolin Nov 13, 2018
f38f57d
Fix CLI tests
jackzampolin Nov 13, 2018
23e8415
R4R: Querier - Get all delegations to validator (#2565)
jackzampolin Nov 13, 2018
8c805d4
update to amino 0.14.1
zramsay Nov 13, 2018
689d8d0
pending
zramsay Nov 13, 2018
d184121
Merge PR #276: Update to amino 0.14.1
cwgoes Nov 13, 2018
d1614eb
R4R: Query Gov Params (#2576)
sunnya97 Nov 13, 2018
6e9c3f8
Merge PR #2744: Fix Makefile targets dependencies
alessio Nov 14, 2018
9118cd7
Update docs/spec/distribution/overview.md
rigelrozanski Nov 14, 2018
4b5be08
Update docs/spec/distribution/overview.md
rigelrozanski Nov 14, 2018
b1a1f19
Update docs/spec/distribution/overview.md
rigelrozanski Nov 14, 2018
2bff5c2
Merge PR #2748: Fix governance simulation, more import/export work
cwgoes Nov 14, 2018
bba7a30
Update overview.md
alexanderbez Nov 14, 2018
6feab55
Merge PR #2765: Slight cleanup of distribution specification
rigelrozanski Nov 14, 2018
addcfbf
Documentation Structure Change and Cleanup (#2808)
gamarin2 Nov 14, 2018
7f07e93
Bring back banner (#2814)
gamarin2 Nov 14, 2018
45b0e3a
Build docs in CircleCI (#2810)
Nov 14, 2018
0453992
Update contributing.md with new merge policy (#2789)
jackzampolin Nov 14, 2018
555b61e
deleted obsolete file (#2817)
zramsay Nov 14, 2018
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
Store last total power as sdk.Int, not sdk.Dec
  • Loading branch information
cwgoes committed Oct 23, 2018
commit 3d270babc04459303bed952a8e4847dd87a18d19
4 changes: 2 additions & 2 deletions x/distribution/keeper/delegation.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (k Keeper) WithdrawDelegationReward(ctx sdk.Context, delegatorAddr sdk.AccA

// TODO: Reconcile with duplicate code in getDelegatorRewardsAll.
height := ctx.BlockHeight()
lastTotalPower := k.stakeKeeper.GetLastTotalPower(ctx)
lastTotalPower := sdk.NewDecFromInt(k.stakeKeeper.GetLastTotalPower(ctx))
lastValPower := k.stakeKeeper.GetLastValidatorPower(ctx, valAddr)
feePool := k.GetFeePool(ctx)
delInfo := k.GetDelegationDistInfo(ctx, delegatorAddr, valAddr)
Expand Down Expand Up @@ -126,7 +126,7 @@ func (k Keeper) WithdrawDelegationRewardsAll(ctx sdk.Context, delegatorAddr sdk.
func (k Keeper) getDelegatorRewardsAll(ctx sdk.Context, delAddr sdk.AccAddress, height int64) types.DecCoins {

withdraw := types.DecCoins{}
lastTotalPower := k.stakeKeeper.GetLastTotalPower(ctx)
lastTotalPower := sdk.NewDecFromInt(k.stakeKeeper.GetLastTotalPower(ctx))

// iterate over all the delegations
// TODO: Reconcile with duplicate code in WithdrawDelegationReward.
Expand Down
2 changes: 1 addition & 1 deletion x/distribution/keeper/delegation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TestWithdrawDelegationRewardBasic(t *testing.T) {

// withdraw delegation
ctx = ctx.WithBlockHeight(1)
sk.SetLastTotalPower(ctx, sdk.NewDec(10))
sk.SetLastTotalPower(ctx, sdk.NewInt(10))
sk.SetLastValidatorPower(ctx, valOpAddr1, sdk.NewDec(10))
keeper.WithdrawDelegationReward(ctx, delAddr1, valOpAddr1)
amt = accMapper.GetAccount(ctx, delAddr1).GetCoins().AmountOf(denom)
Expand Down
2 changes: 1 addition & 1 deletion x/distribution/keeper/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (k Keeper) WithdrawValidatorRewardsAll(ctx sdk.Context, operatorAddr sdk.Va
withdraw := k.getDelegatorRewardsAll(ctx, accAddr, height)

// withdrawal validator commission rewards
lastTotalPower := k.stakeKeeper.GetLastTotalPower(ctx)
lastTotalPower := sdk.NewDecFromInt(k.stakeKeeper.GetLastTotalPower(ctx))
valInfo := k.GetValidatorDistInfo(ctx, operatorAddr)
feePool := k.GetFeePool(ctx)
valInfo, feePool, commission := valInfo.WithdrawCommission(feePool, height, lastTotalPower,
Expand Down
2 changes: 1 addition & 1 deletion x/distribution/types/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type StakeKeeper interface {
Validator(ctx sdk.Context, valAddr sdk.ValAddress) sdk.Validator
ValidatorByConsAddr(ctx sdk.Context, consAddr sdk.ConsAddress) sdk.Validator
TotalPower(ctx sdk.Context) sdk.Dec
GetLastTotalPower(ctx sdk.Context) sdk.Dec
GetLastTotalPower(ctx sdk.Context) sdk.Int
GetLastValidatorPower(ctx sdk.Context, valAddr sdk.ValAddress) sdk.Dec
}

Expand Down
9 changes: 3 additions & 6 deletions x/stake/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,21 +74,18 @@ func (k Keeper) SetPool(ctx sdk.Context, pool types.Pool) {
//_______________________________________________________________________

// Load the last total validator power.
func (k Keeper) GetLastTotalPower(ctx sdk.Context) (power sdk.Dec) {
func (k Keeper) GetLastTotalPower(ctx sdk.Context) (power sdk.Int) {
store := ctx.KVStore(k.storeKey)
b := store.Get(LastTotalPowerKey)
if b == nil {
return sdk.ZeroDec()
return sdk.ZeroInt()
}
k.cdc.MustUnmarshalBinary(b, &power)
return
}

// Set the last total validator power.
func (k Keeper) SetLastTotalPower(ctx sdk.Context, power sdk.Dec) {
if !power.IsInteger() {
panic("input power must be whole integer")
}
func (k Keeper) SetLastTotalPower(ctx sdk.Context, power sdk.Int) {
store := ctx.KVStore(k.storeKey)
b := k.cdc.MustMarshalBinary(power)
store.Set(LastTotalPowerKey, b)
Expand Down
6 changes: 3 additions & 3 deletions x/stake/keeper/val_state_change.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx sdk.Context) (updates []ab

store := ctx.KVStore(k.storeKey)
maxValidators := k.GetParams(ctx).MaxValidators
totalPower := int64(0)
totalPower := sdk.ZeroInt()

// Retrieve the last validator set.
// The persistent set is updated later in this function.
Expand Down Expand Up @@ -87,7 +87,7 @@ func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx sdk.Context) (updates []ab

// keep count
count++
totalPower += newPower
totalPower = totalPower.Add(sdk.NewInt(newPower))
}

// sort the no-longer-bonded validators
Expand Down Expand Up @@ -116,7 +116,7 @@ func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx sdk.Context) (updates []ab

// set total power on lookup index if there are any updates
if len(updates) > 0 {
k.SetLastTotalPower(ctx, sdk.NewDec(totalPower))
k.SetLastTotalPower(ctx, totalPower)
}

return updates
Expand Down