From 208930a0dd73dc39ca3aef076af19327a86561f3 Mon Sep 17 00:00:00 2001 From: Jayden Lee <41176085+tkxkd0159@users.noreply.github.com> Date: Wed, 8 May 2024 13:55:52 +0900 Subject: [PATCH 1/4] apply finschia-sdk v0.49.0-rc1 --- app/app.go | 35 +++++++++++++++++++++++++++++++++-- go.mod | 2 +- go.sum | 2 ++ 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/app/app.go b/app/app.go index fc3c5167..ce42e3a5 100644 --- a/app/app.go +++ b/app/app.go @@ -77,6 +77,9 @@ import ( "github.com/Finschia/finschia-sdk/x/evidence" evidencekeeper "github.com/Finschia/finschia-sdk/x/evidence/keeper" evidencetypes "github.com/Finschia/finschia-sdk/x/evidence/types" + fbridgekeeper "github.com/Finschia/finschia-sdk/x/fbridge/keeper" + fbridgemodule "github.com/Finschia/finschia-sdk/x/fbridge/module" + fbridgetypes "github.com/Finschia/finschia-sdk/x/fbridge/types" "github.com/Finschia/finschia-sdk/x/feegrant" feegrantkeeper "github.com/Finschia/finschia-sdk/x/feegrant/keeper" feegrantmodule "github.com/Finschia/finschia-sdk/x/feegrant/module" @@ -84,6 +87,10 @@ import ( foundationclient "github.com/Finschia/finschia-sdk/x/foundation/client" foundationkeeper "github.com/Finschia/finschia-sdk/x/foundation/keeper" foundationmodule "github.com/Finschia/finschia-sdk/x/foundation/module" + "github.com/Finschia/finschia-sdk/x/fswap" + fswapclient "github.com/Finschia/finschia-sdk/x/fswap/client" + fswapkeeper "github.com/Finschia/finschia-sdk/x/fswap/keeper" + fswaptypes "github.com/Finschia/finschia-sdk/x/fswap/types" "github.com/Finschia/finschia-sdk/x/genutil" genutiltypes "github.com/Finschia/finschia-sdk/x/genutil/types" "github.com/Finschia/finschia-sdk/x/gov" @@ -157,6 +164,7 @@ var ( foundationclient.ProposalHandler, ibcclientclient.UpdateClientProposalHandler, ibcclientclient.UpgradeProposalHandler, + fswapclient.ProposalHandler, )..., ), params.AppModuleBasic{}, @@ -173,6 +181,8 @@ var ( transfer.AppModuleBasic{}, ica.AppModuleBasic{}, wasmplus.AppModuleBasic{}, + fswap.AppModuleBasic{}, + fbridgemodule.AppModuleBasic{}, ) // module account permissions @@ -188,11 +198,14 @@ var ( govtypes.ModuleName: {authtypes.Burner}, ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner}, wasmplustypes.ModuleName: {authtypes.Burner}, + fbridgetypes.ModuleName: {authtypes.Burner}, + fswaptypes.ModuleName: {authtypes.Burner, authtypes.Minter}, } // module accounts that are allowed to receive tokens allowedReceivingModAcc = map[string]bool{ // govtypes.ModuleName: true, // TODO: uncomment it when authority is ready + fbridgetypes.ModuleName: true, } ) @@ -240,6 +253,8 @@ type LinkApp struct { // nolint: golint TokenKeeper tokenkeeper.Keeper CollectionKeeper collectionkeeper.Keeper WasmKeeper wasmpluskeeper.Keeper + FswapKeeper fswapkeeper.Keeper + FbridgeKeeper fbridgekeeper.Keeper ScopedIBCKeeper capabilitykeeper.ScopedKeeper ScopedTransferKeeper capabilitykeeper.ScopedKeeper @@ -301,12 +316,14 @@ func NewLinkApp( ibctransfertypes.StoreKey, icahosttypes.StoreKey, wasmplustypes.StoreKey, + fswaptypes.StoreKey, + fbridgetypes.StoreKey, ) tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey) // NOTE: The testingkey is just mounted for testing purposes. Actual applications should // not include this key. - memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) + memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey, fbridgetypes.MemStoreKey, "testingkey") // configure state listening capabilities using AppOptions // we are doing nothing with the returned streamingServices and waitGroup in this case @@ -460,6 +477,11 @@ func NewLinkApp( wasmOpts..., ) + fswapConfig := fswaptypes.DefaultConfig() + app.FswapKeeper = fswapkeeper.NewKeeper(appCodec, keys[fswaptypes.StoreKey], fswapConfig, app.BankKeeper) + const FinschiaV4BaseDenom = "cony" + app.FbridgeKeeper = fbridgekeeper.NewKeeper(appCodec, keys[fbridgetypes.StoreKey], memKeys[fbridgetypes.MemStoreKey], app.AccountKeeper, app.BankKeeper, FinschiaV4BaseDenom, fbridgetypes.DefaultAuthority().String()) + // register the proposal types govRouter := govtypes.NewRouter() govRouter.AddRoute(govtypes.RouterKey, govtypes.ProposalHandler). @@ -468,7 +490,8 @@ func NewLinkApp( AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)). AddRoute(foundation.RouterKey, foundationkeeper.NewFoundationProposalsHandler(app.FoundationKeeper)). AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)). - AddRoute(wasmplustypes.RouterKey, wasmpluskeeper.NewWasmProposalHandler(&app.WasmKeeper, wasmplustypes.EnableAllProposals)) + AddRoute(wasmplustypes.RouterKey, wasmpluskeeper.NewWasmProposalHandler(&app.WasmKeeper, wasmplustypes.EnableAllProposals)). + AddRoute(fswaptypes.RouterKey, fswap.NewSwapHandler(app.FswapKeeper)) govKeeper := govkeeper.NewKeeper( appCodec, keys[govtypes.StoreKey], app.GetSubspace(govtypes.ModuleName), app.AccountKeeper, app.BankKeeper, @@ -521,6 +544,8 @@ func NewLinkApp( ibc.NewAppModule(app.IBCKeeper), transferModule, icaModule, + fswap.NewAppModule(appCodec, app.FswapKeeper, app.BankKeeper), + fbridgemodule.NewAppModule(appCodec, app.FbridgeKeeper), ) // During begin block slashing happens after distr.BeginBlocker so that @@ -551,6 +576,8 @@ func NewLinkApp( ibchost.ModuleName, icatypes.ModuleName, wasmplustypes.ModuleName, + fswaptypes.ModuleName, + fbridgetypes.ModuleName, ) app.mm.SetOrderEndBlockers( crisistypes.ModuleName, @@ -576,6 +603,8 @@ func NewLinkApp( ibchost.ModuleName, icatypes.ModuleName, wasmplustypes.ModuleName, + fswaptypes.ModuleName, + fbridgetypes.ModuleName, ) // NOTE: The genutils module must occur after staking so that pools are @@ -591,6 +620,7 @@ func NewLinkApp( capabilitytypes.ModuleName, authtypes.ModuleName, banktypes.ModuleName, + fbridgetypes.ModuleName, distrtypes.ModuleName, stakingtypes.ModuleName, slashingtypes.ModuleName, @@ -612,6 +642,7 @@ func NewLinkApp( icatypes.ModuleName, // wasm after ibc transfer wasmplustypes.ModuleName, + fswaptypes.ModuleName, ) app.mm.RegisterInvariants(&app.CrisisKeeper) diff --git a/go.mod b/go.mod index 9a3ec2a5..49f253ff 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/Finschia/finschia/v3 go 1.20 require ( - github.com/Finschia/finschia-sdk v0.48.1 + github.com/Finschia/finschia-sdk v0.49.0-rc1 github.com/Finschia/ostracon v1.1.3 github.com/Finschia/wasmd v0.3.0 github.com/cosmos/ibc-go/v4 v4.3.1 diff --git a/go.sum b/go.sum index a3303878..d86fd4da 100644 --- a/go.sum +++ b/go.sum @@ -49,6 +49,8 @@ github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1: github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/Finschia/finschia-sdk v0.48.1 h1:lqO5DOXNVmvYq3/CCSO5g5nn6dLMzGFUHgY8RutoQGA= github.com/Finschia/finschia-sdk v0.48.1/go.mod h1:bmPv3zWUAWmm+ZxLpUAK3NhURQ4l+3tg3Bw+WcinbmY= +github.com/Finschia/finschia-sdk v0.49.0-rc1 h1:IiNz6KVGjMRDByV7HqUkUYncY/CFdJAFbAfMecalYHA= +github.com/Finschia/finschia-sdk v0.49.0-rc1/go.mod h1:bmPv3zWUAWmm+ZxLpUAK3NhURQ4l+3tg3Bw+WcinbmY= github.com/Finschia/ibc-go/v4 v4.3.1 h1:pUKry0j+1/ypCC3X1TkEzoLrS1A/low/1PE2HZL+13k= github.com/Finschia/ibc-go/v4 v4.3.1/go.mod h1:kFZgmXXT2pt9QL7Ngx/eA7lI9JlOMGRG/oU4RTDXKcg= github.com/Finschia/ostracon v1.1.3 h1:GYPTc8et+sXEq9W2SUlYwvnImpZ4aG8hI2cIhyBWRSU= From 0107a4a388e9a9b3aae31ff7d2b796bf2eaaff80 Mon Sep 17 00:00:00 2001 From: Jayden Lee <41176085+tkxkd0159@users.noreply.github.com> Date: Wed, 8 May 2024 14:07:45 +0900 Subject: [PATCH 2/4] add mergify config --- .mergify.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.mergify.yml b/.mergify.yml index 7c489220..487ca138 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -32,3 +32,11 @@ pull_request_rules: backport: branches: - release/v3.0.x + - name: backport patches to v4.0.x branch + conditions: + - base=main + - label=backport/v4.0.x + actions: + backport: + branches: + - release/v4.0.x From 30b3bdc7e8c29477e2bbcc33d8c9e2c9ddb8b949 Mon Sep 17 00:00:00 2001 From: Jayden Lee <41176085+tkxkd0159@users.noreply.github.com> Date: Wed, 8 May 2024 14:10:37 +0900 Subject: [PATCH 3/4] Add CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f0667ae7..0494926a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] ### Features +* (fswap, fbridge) [\#354](https://github.com/Finschia/finschia/pull/354) Bump finschia-sdk v0.48.1 to v0.49.0-rc1 ### Improvements From c4a68c445b175b56eb054cf80e841bc6d5ba6c86 Mon Sep 17 00:00:00 2001 From: Jayden Lee <41176085+tkxkd0159@users.noreply.github.com> Date: Wed, 8 May 2024 15:31:56 +0900 Subject: [PATCH 4/4] fix --- app/app.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/app.go b/app/app.go index ce42e3a5..15311b40 100644 --- a/app/app.go +++ b/app/app.go @@ -321,9 +321,7 @@ func NewLinkApp( ) tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey) - // NOTE: The testingkey is just mounted for testing purposes. Actual applications should - // not include this key. - memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey, fbridgetypes.MemStoreKey, "testingkey") + memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey, fbridgetypes.MemStoreKey) // configure state listening capabilities using AppOptions // we are doing nothing with the returned streamingServices and waitGroup in this case @@ -480,7 +478,7 @@ func NewLinkApp( fswapConfig := fswaptypes.DefaultConfig() app.FswapKeeper = fswapkeeper.NewKeeper(appCodec, keys[fswaptypes.StoreKey], fswapConfig, app.BankKeeper) const FinschiaV4BaseDenom = "cony" - app.FbridgeKeeper = fbridgekeeper.NewKeeper(appCodec, keys[fbridgetypes.StoreKey], memKeys[fbridgetypes.MemStoreKey], app.AccountKeeper, app.BankKeeper, FinschiaV4BaseDenom, fbridgetypes.DefaultAuthority().String()) + app.FbridgeKeeper = fbridgekeeper.NewKeeper(appCodec, keys[fbridgetypes.StoreKey], memKeys[fbridgetypes.MemStoreKey], app.AccountKeeper, app.BankKeeper, FinschiaV4BaseDenom, foundation.DefaultAuthority().String()) // register the proposal types govRouter := govtypes.NewRouter()