Skip to content

Commit

Permalink
fix(epoch): fix nil epoch storeKey in perp keeper (#796)
Browse files Browse the repository at this point in the history
* Update CHANGELOG.md

* fix panic

* update changelog

Co-authored-by: NibiruHeisenberg <[email protected]>
  • Loading branch information
AgentSmithMatrix and NibiruHeisenberg committed Aug 4, 2022
1 parent 1c98706 commit 6b5e307
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

* [#796](https://github.com/NibiruChain/nibiru/pull/796) - fix bug that caused that epochKeeper was nil when running epoch hook from Perp module

## [v0.12.0](https://github.com/NibiruChain/nibiru/releases/tag/v0.12.0) - 2022-08-03

### Improvements
Expand Down
7 changes: 4 additions & 3 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -443,15 +443,16 @@ func NewNibiruApp(
app.PricefeedKeeper,
)

app.EpochsKeeper = epochskeeper.NewKeeper(
appCodec, keys[epochstypes.StoreKey],
)

app.PerpKeeper = perpkeeper.NewKeeper(
appCodec, keys[perptypes.StoreKey],
app.GetSubspace(perptypes.ModuleName),
app.AccountKeeper, app.BankKeeper, app.PricefeedKeeper, app.VpoolKeeper, app.EpochsKeeper,
)

app.EpochsKeeper = epochskeeper.NewKeeper(
appCodec, keys[epochstypes.StoreKey],
)
app.EpochsKeeper.SetHooks(
epochstypes.NewMultiEpochHooks(app.StablecoinKeeper.Hooks(), app.PerpKeeper.Hooks()),
)
Expand Down

0 comments on commit 6b5e307

Please sign in to comment.