From 8c287d0701aa3fb7373da1ae1badbf7ad2650e50 Mon Sep 17 00:00:00 2001 From: Youngtaek Yoon Date: Fri, 22 Mar 2024 00:52:37 +0000 Subject: [PATCH 1/2] fix: export x/collection params into genesis (#1268) * Export params * Update CHANGELOG.md * Move position (cherry picked from commit e86b98002e661881337f53cfcad749227b58173f) # Conflicts: # CHANGELOG.md --- CHANGELOG.md | 10 ++++++++++ x/collection/keeper/genesis.go | 1 + x/collection/keeper/genesis_test.go | 8 ++++++++ 3 files changed, 19 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e29ab978fb..aa786d27ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,9 +43,19 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements ### Bug Fixes +<<<<<<< HEAD * (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) +======= +* chore(deps) [\#1141](https://github.com/Finschia/finschia-sdk/pull/1141) Bump github.com/cosmos/ledger-cosmos-go from 0.12.2 to 0.13.2 to fix ledger signing issue +* (x/auth, x/slashing) [\#1179](https://github.com/Finschia/finschia-sdk/pull/1179) modify missing changes of converting to tendermint +* (x/auth) [#1274](https://github.com/Finschia/finschia-sdk/pull/1274) `ModuleAccount.Validate` now reports a nil `.BaseAccount` instead of panicking. +* (x/collection) [\#1276](https://github.com/Finschia/finschia-sdk/pull/1276) eliminates potential risk for Insufficient Sanity Check of tokenID in Genesis +* (x/foundation) [\#1277](https://github.com/Finschia/finschia-sdk/pull/1277) add init logic of foundation module accounts to InitGenesis in order to eliminate potential panic +* (x/collection, x/token) [\#1288](https://github.com/Finschia/finschia-sdk/pull/1288) use accAddress to compare in validatebasic function in collection & token modules +* (x/collection) [\#1268](https://github.com/Finschia/finschia-sdk/pull/1268) export x/collection params into genesis +>>>>>>> e86b98002 (fix: export x/collection params into genesis (#1268)) ### Removed diff --git a/x/collection/keeper/genesis.go b/x/collection/keeper/genesis.go index 290d8caf48..c4ebef4f46 100644 --- a/x/collection/keeper/genesis.go +++ b/x/collection/keeper/genesis.go @@ -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), diff --git a/x/collection/keeper/genesis_test.go b/x/collection/keeper/genesis_test.go index fc6c0c836c..e2108aeaca 100644 --- a/x/collection/keeper/genesis_test.go +++ b/x/collection/keeper/genesis_test.go @@ -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) +} From 7a9670c5e160d7c44821a2e081fa505ebcea259c Mon Sep 17 00:00:00 2001 From: Youngtaek Yoon Date: Fri, 22 Mar 2024 01:08:24 +0000 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa786d27ee..99d5ba22a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,19 +43,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements ### Bug Fixes -<<<<<<< HEAD * (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) -======= -* chore(deps) [\#1141](https://github.com/Finschia/finschia-sdk/pull/1141) Bump github.com/cosmos/ledger-cosmos-go from 0.12.2 to 0.13.2 to fix ledger signing issue -* (x/auth, x/slashing) [\#1179](https://github.com/Finschia/finschia-sdk/pull/1179) modify missing changes of converting to tendermint -* (x/auth) [#1274](https://github.com/Finschia/finschia-sdk/pull/1274) `ModuleAccount.Validate` now reports a nil `.BaseAccount` instead of panicking. -* (x/collection) [\#1276](https://github.com/Finschia/finschia-sdk/pull/1276) eliminates potential risk for Insufficient Sanity Check of tokenID in Genesis -* (x/foundation) [\#1277](https://github.com/Finschia/finschia-sdk/pull/1277) add init logic of foundation module accounts to InitGenesis in order to eliminate potential panic -* (x/collection, x/token) [\#1288](https://github.com/Finschia/finschia-sdk/pull/1288) use accAddress to compare in validatebasic function in collection & token modules -* (x/collection) [\#1268](https://github.com/Finschia/finschia-sdk/pull/1268) export x/collection params into genesis ->>>>>>> e86b98002 (fix: export x/collection params into genesis (#1268)) +* (x/collection) [\#1290](https://github.com/Finschia/finschia-sdk/pull/1290) export x/collection params into genesis (backport #1268) ### Removed