Skip to content

Commit

Permalink
merge upstream v.45.x
Browse files Browse the repository at this point in the history
  • Loading branch information
jiujiteiro committed May 10, 2022
1 parent f2cf6e1 commit 9240cf6
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 3 deletions.
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,36 @@ Ref: https://keepachangelog.com/en/1.0.0/

## [Unreleased]

### Bug Fixes

* [#11796](https://github.com/cosmos/cosmos-sdk/pull/11796) Handle EOF error case in `readLineFromBuf`, which allows successful reading of passphrases from STDIN.
* [\#11772](https://github.com/cosmos/cosmos-sdk/pull/11772) Limit types.Dec length to avoid overflow.
* [\#10947](https://github.com/cosmos/cosmos-sdk/pull/10947) Add `AllowancesByGranter` query to the feegrant module
* [\#9639](https://github.com/cosmos/cosmos-sdk/pull/9639) Check store keys length before accessing them by making sure that `key` is of length `m+1` (for `key[n:m]`)

## Improvements

* [\#11886](https://github.com/cosmos/cosmos-sdk/pull/11886) Improve error messages

## [v0.45.4](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.4) - 2022-04-25

### Bug Fixes

* [\#11624](https://github.com/cosmos/cosmos-sdk/pull/11624) Handle the error returned from `NewNode` in the `server` package.
* [\#11724](https://github.com/cosmos/cosmos-sdk/pull/11724) Fix data race issues with `api.Server`.

### Improvements

* [\#11693](https://github.com/cosmos/cosmos-sdk/pull/11693) Add validation for gentx cmd.
* [\#11686](https://github.com/cosmos/cosmos-sdk/pull/11686) Update the min required Golang version to `1.17`.
* (x/auth/vesting) [\#11652](https://github.com/cosmos/cosmos-sdk/pull/11652) Add util functions for `Period(s)`

## [v0.45.3](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.3) - 2022-04-12

### Improvements

* [\#11562](https://github.com/cosmos/cosmos-sdk/pull/11562) Updated Tendermint to v0.34.19; `unsafe-reset-all` command has been moved to the `tendermint` sub-command.

### Features

* (x/upgrade) [\#11551](https://github.com/cosmos/cosmos-sdk/pull/11551) Update `ScheduleUpgrade` for chains to schedule an automated upgrade on `BeginBlock` without having to go though governance.
Expand Down
2 changes: 1 addition & 1 deletion x/staking/keeper/delegation.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func (k Keeper) GetDelegatorUnbonding(ctx sdk.Context, delegator sdk.AccAddress)
unbonding := sdk.ZeroInt()
k.IterateDelegatorUnbondingDelegations(ctx, delegator, func(ubd types.UnbondingDelegation) bool {
for _, entry := range ubd.Entries {
unbonding = unbonding.Add(entry.Balance)
unbonding = unbonding.Add(entry.Balance.Amount)
}
return false
})
Expand Down
5 changes: 3 additions & 2 deletions x/staking/keeper/delegation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func TestUnbondingDelegation(t *testing.T) {
valAddrs[0],
0,
time.Unix(0, 0).UTC(),
sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100)),
sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(5)),
)

// set and retrieve a record
Expand All @@ -157,7 +157,8 @@ func TestUnbondingDelegation(t *testing.T) {
require.Equal(t, ubd, resUnbond)

// modify a records, save, and retrieve
ubd.Entries[0].Balance = sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100))
expUnbond := sdk.NewInt(21)
ubd.Entries[0].Balance.Amount = expUnbond
app.StakingKeeper.SetUnbondingDelegation(ctx, ubd)

resUnbonds := app.StakingKeeper.GetUnbondingDelegations(ctx, delAddrs[0], 5)
Expand Down

0 comments on commit 9240cf6

Please sign in to comment.