Skip to content

Commit

Permalink
fix: export x/collection params into genesis (backport #1268) (#1290)
Browse files Browse the repository at this point in the history
* fix: export x/collection params into genesis (#1268)

* Export params

* Update CHANGELOG.md

* Move position

(cherry picked from commit e86b980)

# Conflicts:
#	CHANGELOG.md

* Update CHANGELOG.md

---------

Co-authored-by: Youngtaek Yoon <[email protected]>
  • Loading branch information
mergify[bot] and 0Tech authored Mar 22, 2024
1 parent 8b312a6 commit 66a0114
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (x/auth) [#1281](https://github.com/Finschia/finschia-sdk/pull/1281) `ModuleAccount.Validate` now reports a nil `.BaseAccount` instead of panicking. (backport #1274)
* (x/foundation) [\#1283](https://github.com/Finschia/finschia-sdk/pull/1283) add init logic of foundation module accounts to InitGenesis in order to eliminate potential panic (backport #1277)
* (x/collection) [\#1282](https://github.com/Finschia/finschia-sdk/pull/1282) eliminates potential risk for Insufficient Sanity Check of tokenID in Genesis (backport #1276)
* (x/collection) [\#1290](https://github.com/Finschia/finschia-sdk/pull/1290) export x/collection params into genesis (backport #1268)

### Removed

Expand Down
1 change: 1 addition & 0 deletions x/collection/keeper/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ func (k Keeper) ExportGenesis(ctx sdk.Context) *collection.GenesisState {
contracts := k.getContracts(ctx)

return &collection.GenesisState{
Params: k.GetParams(ctx),
Contracts: contracts,
NextClassIds: k.getAllNextClassIDs(ctx),
Classes: k.getClasses(ctx, contracts),
Expand Down
8 changes: 8 additions & 0 deletions x/collection/keeper/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,11 @@ func (s *KeeperTestSuite) TestImportExportGenesis() {
newGenesis := s.keeper.ExportGenesis(s.ctx)
s.Require().Equal(genesis, newGenesis)
}

func (s *KeeperTestSuite) TestExportGenesis() {
genesis := s.keeper.ExportGenesis(s.ctx)

params := genesis.Params
s.Require().NotZero(params.DepthLimit)
s.Require().NotZero(params.WidthLimit)
}

0 comments on commit 66a0114

Please sign in to comment.