From bfd6cf46fb0b5d17827d679c82120c9177b4054a Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Tue, 19 Aug 2025 15:32:38 +0200 Subject: [PATCH] chore: use ignite v29.3.x --- app/app.go | 6 +- app/app_config.go | 1 - app/ibc.go | 10 ++- app/sim_test.go | 2 +- buf.lock | 4 +- config.yml | 2 +- docs/docs.go | 2 +- docs/static/openapi.json | 1 + docs/static/openapi.yml | 1 - docs/template/index.tpl | 2 +- go.mod | 73 +++++++++--------- go.sum | 162 ++++++++++++++++++++------------------- readme.md | 11 ++- 13 files changed, 141 insertions(+), 136 deletions(-) create mode 100644 docs/static/openapi.json delete mode 100644 docs/static/openapi.yml diff --git a/app/app.go b/app/app.go index 52caa74..a497bfc 100644 --- a/app/app.go +++ b/app/app.go @@ -98,11 +98,9 @@ type App struct { ICAHostKeeper icahostkeeper.Keeper TransferKeeper ibctransferkeeper.Keeper - ExampleKeeper examplemodulekeeper.Keeper - // this line is used by starport scaffolding # stargate/app/keeperDeclaration - // simulation manager - sm *module.SimulationManager + sm *module.SimulationManager + ExampleKeeper examplemodulekeeper.Keeper } func init() { diff --git a/app/app_config.go b/app/app_config.go index 9ef8a9a..c90a4f0 100644 --- a/app/app_config.go +++ b/app/app_config.go @@ -83,7 +83,6 @@ var ( {Account: nft.ModuleName}, {Account: ibctransfertypes.ModuleName, Permissions: []string{authtypes.Minter, authtypes.Burner}}, {Account: icatypes.ModuleName}, - // this line is used by starport scaffolding # stargate/app/maccPerms } // blocked account addresses diff --git a/app/ibc.go b/app/ibc.go index 2ad5420..420b49b 100644 --- a/app/ibc.go +++ b/app/ibc.go @@ -20,10 +20,12 @@ import ( ibctransfer "github.com/cosmos/ibc-go/v10/modules/apps/transfer" ibctransferkeeper "github.com/cosmos/ibc-go/v10/modules/apps/transfer/keeper" ibctransfertypes "github.com/cosmos/ibc-go/v10/modules/apps/transfer/types" + ibctransferv2 "github.com/cosmos/ibc-go/v10/modules/apps/transfer/v2" ibc "github.com/cosmos/ibc-go/v10/modules/core" ibcclienttypes "github.com/cosmos/ibc-go/v10/modules/core/02-client/types" // nolint:staticcheck // Deprecated: params key table is needed for params migration ibcconnectiontypes "github.com/cosmos/ibc-go/v10/modules/core/03-connection/types" porttypes "github.com/cosmos/ibc-go/v10/modules/core/05-port/types" + ibcapi "github.com/cosmos/ibc-go/v10/modules/core/api" ibcexported "github.com/cosmos/ibc-go/v10/modules/core/exported" ibckeeper "github.com/cosmos/ibc-go/v10/modules/core/keeper" solomachine "github.com/cosmos/ibc-go/v10/modules/light-clients/06-solomachine" @@ -100,19 +102,25 @@ func (app *App) registerIBCModules(appOpts servertypes.AppOptions) error { // create IBC module from bottom to top of stack var ( transferStack porttypes.IBCModule = ibctransfer.NewIBCModule(app.TransferKeeper) + transferStackV2 ibcapi.IBCModule = ibctransferv2.NewIBCModule(app.TransferKeeper) icaControllerStack porttypes.IBCModule = icacontroller.NewIBCMiddleware(app.ICAControllerKeeper) icaHostStack porttypes.IBCModule = icahost.NewIBCModule(app.ICAHostKeeper) ) - // create static IBC router, add transfer route, then set it on the keeper + // create IBC v1 router, add transfer route, then set it on the keeper ibcRouter := porttypes.NewRouter(). AddRoute(ibctransfertypes.ModuleName, transferStack). AddRoute(icacontrollertypes.SubModuleName, icaControllerStack). AddRoute(icahosttypes.SubModuleName, icaHostStack) + // create IBC v2 router, add transfer route, then set it on the keeper + ibcv2Router := ibcapi.NewRouter(). + AddRoute(ibctransfertypes.PortID, transferStackV2) + // this line is used by starport scaffolding # ibc/app/module app.IBCKeeper.SetRouter(ibcRouter) + app.IBCKeeper.SetRouterV2(ibcv2Router) clientKeeper := app.IBCKeeper.ClientKeeper storeProvider := clientKeeper.GetStoreProvider() diff --git a/app/sim_test.go b/app/sim_test.go index 30a9c89..9f809e9 100644 --- a/app/sim_test.go +++ b/app/sim_test.go @@ -57,7 +57,7 @@ func interBlockCacheOpt() func(*baseapp.BaseApp) { } // BenchmarkSimulation run the chain simulation -// Running using starport command: +// Running using ignite command: // `ignite chain simulate -v --numBlocks 200 --blockSize 50` // Running as go benchmark test: // `go test -benchmem -run=^$ -bench ^BenchmarkSimulation ./app -NumBlocks=200 -BlockSize 50 -Commit=true -Verbose=true -Enabled=true` diff --git a/buf.lock b/buf.lock index 4c4a874..fd81c8d 100644 --- a/buf.lock +++ b/buf.lock @@ -20,5 +20,5 @@ deps: commit: 61b203b9a9164be9a834f58c37be6f62 digest: b5:7811a98b35bd2e4ae5c3ac73c8b3d9ae429f3a790da15de188dc98fc2b77d6bb10e45711f14903af9553fa9821dff256054f2e4b7795789265bc476bec2f088c - name: buf.build/protocolbuffers/wellknowntypes - commit: 3ddd61d1f53d485abd3d3a2b47a62b8e - digest: b5:09e4405493fa16fef2af6b667fcaea9d2280ec44ed4943eddb96fb5a32daa1e8a353331dd4ef33b7df3783d17e912a703d57b73b236cd749d6a87ce83f60e2c9 + commit: a4aee59cf3714106961b09d99b349cd1 + digest: b5:0bcf938c1c604919ccc4bee0b72b56ffe049fd043837b80aca7c89a984979e9b4913b4973166fa6e7895995b30da23daab6c83d9ba21d9d16ddc414bf25e3288 diff --git a/config.yml b/config.yml index f60a827..93de8a6 100644 --- a/config.yml +++ b/config.yml @@ -12,7 +12,7 @@ accounts: - 100000000ignt client: openapi: - path: docs/static/openapi.yml + path: docs/static/openapi.json faucet: name: bob coins: diff --git a/docs/docs.go b/docs/docs.go index 6994b8c..96b9e55 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -9,7 +9,7 @@ import ( ) const ( - apiFile = "/static/openapi.yml" + apiFile = "/static/openapi.json" indexFile = "template/index.tpl" ) diff --git a/docs/static/openapi.json b/docs/static/openapi.json new file mode 100644 index 0000000..c80d965 --- /dev/null +++ b/docs/static/openapi.json @@ -0,0 +1 @@ +{"id":"github.com/ignite/example","consumes":["application/json"],"produces":["application/json"],"swagger":"2.0","info":{"description":"Chain github.com/ignite/example REST API","title":"HTTP API Console","contact":{"name":"github.com/ignite/example"},"version":"version not set"},"paths":{"/example.example.v1.Msg/UpdateParams":{"post":{"tags":["Msg"],"summary":"UpdateParams defines a (governance) operation for updating the module\nparameters. The authority defaults to the x/gov module account.","operationId":"GithubComigniteexampleMsg_UpdateParams","parameters":[{"description":"MsgUpdateParams is the Msg/UpdateParams request type.","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/example.example.v1.MsgUpdateParams"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/example.example.v1.MsgUpdateParamsResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}}},"definitions":{"example.example.v1.MsgUpdateParams":{"description":"MsgUpdateParams is the Msg/UpdateParams request type.","type":"object","properties":{"authority":{"description":"authority is the address that controls the module (defaults to x/gov unless overwritten).","type":"string"},"params":{"description":"params defines the module parameters to update.\n\nNOTE: All parameters must be supplied.","$ref":"#/definitions/example.example.v1.Params"}}},"example.example.v1.MsgUpdateParamsResponse":{"description":"MsgUpdateParamsResponse defines the response structure for executing a\nMsgUpdateParams message.","type":"object"},"example.example.v1.Params":{"description":"Params defines the parameters for the module.","type":"object"},"google.protobuf.Any":{"type":"object","properties":{"@type":{"type":"string"}},"additionalProperties":{}},"google.rpc.Status":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"details":{"type":"array","items":{"type":"object","$ref":"#/definitions/google.protobuf.Any"}},"message":{"type":"string"}}}},"tags":[{"name":"Msg"}]} \ No newline at end of file diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml deleted file mode 100644 index 8f91bfc..0000000 --- a/docs/static/openapi.yml +++ /dev/null @@ -1 +0,0 @@ -{"id":"github.com/ignite/example","consumes":["application/json"],"produces":["application/json"],"swagger":"2.0","info":{"description":"Chain github.com/ignite/example REST API","title":"HTTP API Console","contact":{"name":"github.com/ignite/example"},"version":"version not set"},"paths":{"/example.example.v1.Msg/UpdateParams":{"post":{"tags":["Msg"],"summary":"UpdateParams defines a (governance) operation for updating the module\nparameters. The authority defaults to the x/gov module account.","operationId":"GithubComigniteexampleMsg_UpdateParams","parameters":[{"description":"MsgUpdateParams is the Msg/UpdateParams request type.","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/example.example.v1.MsgUpdateParams"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/example.example.v1.MsgUpdateParamsResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/ignite/example/example/v1/params":{"get":{"tags":["Query"],"summary":"Parameters queries the parameters of the module.","operationId":"GithubComigniteexampleQuery_Params","responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/example.example.v1.QueryParamsResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}}},"definitions":{"example.example.v1.MsgUpdateParams":{"description":"MsgUpdateParams is the Msg/UpdateParams request type.","type":"object","properties":{"authority":{"description":"authority is the address that controls the module (defaults to x/gov unless overwritten).","type":"string"},"params":{"description":"params defines the module parameters to update.\n\nNOTE: All parameters must be supplied.","$ref":"#/definitions/example.example.v1.Params"}}},"example.example.v1.MsgUpdateParamsResponse":{"description":"MsgUpdateParamsResponse defines the response structure for executing a\nMsgUpdateParams message.","type":"object"},"example.example.v1.Params":{"description":"Params defines the parameters for the module.","type":"object"},"example.example.v1.QueryParamsResponse":{"description":"QueryParamsResponse is response type for the Query/Params RPC method.","type":"object","properties":{"params":{"description":"params holds all the parameters of this module.","$ref":"#/definitions/example.example.v1.Params"}}},"google.protobuf.Any":{"type":"object","properties":{"@type":{"type":"string"}},"additionalProperties":{}},"google.rpc.Status":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"details":{"type":"array","items":{"type":"object","$ref":"#/definitions/google.protobuf.Any"}},"message":{"type":"string"}}}},"tags":[{"name":"Query"},{"name":"Msg"}]} \ No newline at end of file diff --git a/docs/template/index.tpl b/docs/template/index.tpl index ec098e8..687d611 100644 --- a/docs/template/index.tpl +++ b/docs/template/index.tpl @@ -11,7 +11,7 @@