|
7 | 7 | context "context" |
8 | 8 | "fmt" |
9 | 9 | "io" |
| 10 | + "net/http" |
10 | 11 | "os" |
| 12 | + "strings" |
11 | 13 |
|
12 | 14 | autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" |
13 | 15 | reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" |
@@ -544,6 +546,12 @@ func NewArkeoApp( |
544 | 546 | return app.mm.RunMigrations(ctx, app.configurator, fromVM) |
545 | 547 | }) |
546 | 548 |
|
| 549 | + // general v1.0.17.1 upgrade handler |
| 550 | + app.Keepers.UpgradeKeeper.SetUpgradeHandler("general-v1.0.17.1", func(ctx context.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { |
| 551 | + app.Logger().Info("running general-v1.0.17.1 upgrade") |
| 552 | + return app.mm.RunMigrations(ctx, app.configurator, fromVM) |
| 553 | + }) |
| 554 | + |
547 | 555 | groupConfig := group.DefaultConfig() |
548 | 556 | /* |
549 | 557 | Example of setting group params: |
@@ -1044,6 +1052,23 @@ func (app *ArkeoApp) GetSubspace(moduleName string) paramstypes.Subspace { |
1044 | 1052 | // RegisterAPIRoutes registers all application module routes with the provided |
1045 | 1053 | // API server. |
1046 | 1054 | func (app *ArkeoApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) { |
| 1055 | + // Legacy LCD compat: map ?events=... to ?query=... |
| 1056 | + apiSvr.Router.Use(func(next http.Handler) http.Handler { |
| 1057 | + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
| 1058 | + if r.URL.Path == "/cosmos/tx/v1beta1/txs" { |
| 1059 | + q := r.URL.Query() |
| 1060 | + if q.Get("query") == "" { |
| 1061 | + if evs, ok := q["events"]; ok && len(evs) > 0 { |
| 1062 | + q.Set("query", strings.Join(evs, " AND ")) |
| 1063 | + q.Del("events") |
| 1064 | + r.URL.RawQuery = q.Encode() |
| 1065 | + } |
| 1066 | + } |
| 1067 | + } |
| 1068 | + next.ServeHTTP(w, r) |
| 1069 | + }) |
| 1070 | + }) |
| 1071 | + |
1047 | 1072 | clientCtx := apiSvr.ClientCtx |
1048 | 1073 | // Register new tx routes from grpc-gateway. |
1049 | 1074 | authtx.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) |
|
0 commit comments