Skip to content

Commit

Permalink
Merge branch 'main' into blv/gov
Browse files Browse the repository at this point in the history
  • Loading branch information
StrathCole committed Dec 7, 2024
2 parents 1de4dd8 + 79f2a5e commit b5fbe60
Show file tree
Hide file tree
Showing 9 changed files with 614 additions and 322 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ gen-swagger-docs:
bash scripts/protoc-swagger-gen.sh

update-swagger-docs: statik
$(BINDIR)/statik -src=client/docs/swagger-ui -dest=client/docs -f -m
$(BINDIR)/statik -src=client/docs/swagger-ui -dest=client/docs -f -m -ns terrad
@if [ -n "$(git status --porcelain)" ]; then \
echo "Swagger docs are out of sync!";\
exit 1;\
Expand Down
5 changes: 1 addition & 4 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ import (
v8_3 "github.com/classic-terra/core/v3/app/upgrades/v8_3"

// v9 had been used by tax2gas and has to be skipped
v10 "github.com/classic-terra/core/v3/app/upgrades/v10"

customante "github.com/classic-terra/core/v3/custom/auth/ante"
custompost "github.com/classic-terra/core/v3/custom/auth/post"
Expand Down Expand Up @@ -94,7 +93,6 @@ var (
v8_1.Upgrade,
v8_2.Upgrade,
v8_3.Upgrade,
v10.Upgrade,
}

// Forks defines forks to be applied to the network
Expand Down Expand Up @@ -430,11 +428,10 @@ func (app *TerraApp) RegisterNodeService(clientCtx client.Context) {

// RegisterSwaggerAPI registers swagger route with API Server
func RegisterSwaggerAPI(rtr *mux.Router) {
statikFS, err := fs.New()
statikFS, err := fs.NewWithNamespace("terrad")
if err != nil {
panic(err)
}

staticServer := http.FileServer(statikFS)
rtr.PathPrefix("/swagger/").Handler(http.StripPrefix("/swagger/", staticServer))
}
Expand Down
21 changes: 21 additions & 0 deletions app/upgrades/v10_1/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//nolint:revive
package v10_1

import (
"github.com/classic-terra/core/v3/app/upgrades"
store "github.com/cosmos/cosmos-sdk/store/types"

tax2gastypes "github.com/classic-terra/core/v3/x/tax/types"
)

const UpgradeName = "v10_1"

var Upgrade = upgrades.Upgrade{
UpgradeName: UpgradeName,
CreateUpgradeHandler: CreateV101UpgradeHandler,
StoreUpgrades: store.StoreUpgrades{
Added: []string{
tax2gastypes.ModuleName,
},
},
}
30 changes: 30 additions & 0 deletions app/upgrades/v10_1/upgrades.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//nolint:revive
package v10_1

import (
"github.com/classic-terra/core/v3/app/keepers"
"github.com/classic-terra/core/v3/app/upgrades"
taxtypes "github.com/classic-terra/core/v3/x/tax/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
)

func CreateV101UpgradeHandler(
mm *module.Manager,
cfg module.Configurator,
_ upgrades.BaseAppParamManager,
keepers *keepers.AppKeepers,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
keepers.TreasuryKeeper.SetTaxRate(ctx, sdk.ZeroDec())
params := keepers.TreasuryKeeper.GetParams(ctx)
params.TaxPolicy.RateMax = sdk.ZeroDec()
params.TaxPolicy.RateMin = sdk.ZeroDec()
keepers.TreasuryKeeper.SetParams(ctx, params)

tax2gasParams := taxtypes.DefaultParams()
keepers.TaxKeeper.SetParams(ctx, tax2gasParams)
return mm.RunMigrations(ctx, cfg, fromVM)
}
}
9 changes: 6 additions & 3 deletions client/docs/statik/statik.go

Large diffs are not rendered by default.

Loading

0 comments on commit b5fbe60

Please sign in to comment.