feat: use CacheContext() in AssertInvariants() (#14588)
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
This commit is contained in:
parent
fd3bac0bda
commit
e559ab730a
@ -39,6 +39,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
|
||||
|
||||
### Features
|
||||
|
||||
* (x/crisis) [#14588](https://github.com/cosmos/cosmos-sdk/pull/14588) Use CacheContext() in AssertInvariants()
|
||||
* (client) [#14342](https://github.com/cosmos/cosmos-sdk/pull/14342) Add `simd config` command is now a sub-command, for setting, getting and migrating Cosmos SDK configuration files.
|
||||
* (query) [#14468](https://github.com/cosmos/cosmos-sdk/pull/14468) Implement pagination for collections.
|
||||
* (x/bank) [#14045](https://github.com/cosmos/cosmos-sdk/pull/14045) Add CLI command `spendable-balances`, which also accepts the flag `--denom`.
|
||||
|
||||
@ -84,7 +84,9 @@ func (k *Keeper) AssertInvariants(ctx sdk.Context) {
|
||||
n := len(invarRoutes)
|
||||
for i, ir := range invarRoutes {
|
||||
logger.Info("asserting crisis invariants", "inv", fmt.Sprint(i+1, "/", n), "name", ir.FullRoute())
|
||||
if res, stop := ir.Invar(ctx); stop {
|
||||
|
||||
invCtx, _ := ctx.CacheContext()
|
||||
if res, stop := ir.Invar(invCtx); stop {
|
||||
// TODO: Include app name as part of context to allow for this to be
|
||||
// variable.
|
||||
panic(fmt.Errorf("invariant broken: %s\n"+
|
||||
|
||||
Loading…
Reference in New Issue
Block a user