-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from bze-alphateam/feature/v7
feature/v7
- Loading branch information
Showing
976 changed files
with
450,868 additions
and
1,288 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package openapi | ||
|
||
import ( | ||
"embed" | ||
"html/template" | ||
"net/http" | ||
) | ||
|
||
//go:embed index.tpl | ||
var index embed.FS | ||
|
||
// Handler returns an http handler that servers OpenAPI console for an OpenAPI spec at specURL. | ||
func Handler(title, specURL string) http.HandlerFunc { | ||
t, _ := template.ParseFS(index, "index.tpl") | ||
|
||
return func(w http.ResponseWriter, req *http.Request) { | ||
_ = t.Execute(w, struct { | ||
Title string | ||
URL string | ||
}{ | ||
title, | ||
specURL, | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>{{ .Title }}</title> | ||
<link rel="stylesheet" type="text/css" href="//unpkg.com/swagger-ui-dist@3.40.0/swagger-ui.css" /> | ||
<link rel="icon" type="image/png" href="//unpkg.com/swagger-ui-dist@3.40.0/favicon-16x16.png" /> | ||
</head> | ||
<body> | ||
<div id="swagger-ui"></div> | ||
|
||
<script src="//unpkg.com/swagger-ui-dist@3.40.0/swagger-ui-bundle.js"></script> | ||
<script> | ||
// init Swagger for faucet's openapi.yml. | ||
window.onload = function() { | ||
window.ui = SwaggerUIBundle({ | ||
url: {{ .URL }}, | ||
dom_id: "#swagger-ui", | ||
deepLinking: true, | ||
layout: "BaseLayout", | ||
}); | ||
} | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package v700 | ||
|
||
import ( | ||
burnermodule "github.com/bze-alphateam/bze/x/burner" | ||
burnermoduletypes "github.com/bze-alphateam/bze/x/burner/types" | ||
cointrunkmodule "github.com/bze-alphateam/bze/x/cointrunk" | ||
cointrunkmoduletypes "github.com/bze-alphateam/bze/x/cointrunk/types" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/cosmos/cosmos-sdk/types/module" | ||
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" | ||
) | ||
|
||
const UpgradeName = "v7.0.0" | ||
|
||
func CreateUpgradeHandler( | ||
cfg module.Configurator, | ||
mm *module.Manager, | ||
) upgradetypes.UpgradeHandler { | ||
|
||
return func(ctx sdk.Context, _plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { | ||
//add older modules not present in module_versions yet | ||
vm[burnermoduletypes.ModuleName] = burnermodule.AppModule{}.ConsensusVersion() | ||
vm[cointrunkmoduletypes.ModuleName] = cointrunkmodule.AppModule{}.ConsensusVersion() | ||
|
||
//run default migrations in order to init new module's genesis and to have them in vm | ||
return mm.RunMigrations(ctx, cfg, vm) | ||
} | ||
} |
Oops, something went wrong.