Skip to content

Commit

Permalink
tc upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
cgsingh33 committed Nov 6, 2023
1 parent 57a60f6 commit 723cec2
Showing 1 changed file with 44 additions and 44 deletions.
88 changes: 44 additions & 44 deletions app/upgrades/testnet/v13/upgrade_test.go
Original file line number Diff line number Diff line change
@@ -1,64 +1,64 @@
package v13_test

// import (
// "testing"
import (
"testing"

// "github.com/stretchr/testify/suite"
"github.com/stretchr/testify/suite"

// "github.com/comdex-official/comdex/app"
// wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
// v13 "github.com/comdex-official/comdex/app/upgrades/testnet/v13"
// )
"github.com/comdex-official/comdex/app"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
v13 "github.com/comdex-official/comdex/app/upgrades/testnet/v13"
)

// type UpgradeTestSuite struct {
// app.KeeperTestHelper
// }
type UpgradeTestSuite struct {
app.KeeperTestHelper
}

// func (s *UpgradeTestSuite) SetupTest() {
// s.Setup()
// }
func (s *UpgradeTestSuite) SetupTest() {
s.Setup()
}

// func TestKeeperTestSuite(t *testing.T) {
// suite.Run(t, new(UpgradeTestSuite))
// }
func TestKeeperTestSuite(t *testing.T) {
suite.Run(t, new(UpgradeTestSuite))
}

// // Ensures the test does not error out.
// func (s *UpgradeTestSuite) TestUpgrade() {
// s.Setup()
// Ensures the test does not error out.
func (s *UpgradeTestSuite) TestUpgrade() {
s.Setup()

// preUpgradeChecks(s)
preUpgradeChecks(s)

// upgradeHeight := int64(5)
// s.ConfirmUpgradeSucceeded(v13.UpgradeName, upgradeHeight)
upgradeHeight := int64(5)
s.ConfirmUpgradeSucceeded(v13.UpgradeName, upgradeHeight)

// postUpgradeChecks(s)
// }
postUpgradeChecks(s)
}

// func preUpgradeChecks(s *UpgradeTestSuite) {
func preUpgradeChecks(s *UpgradeTestSuite) {

// mp := s.App.MintKeeper.GetParams(s.Ctx)
// s.Require().Equal(mp.BlocksPerYear, uint64(6311520))
mp := s.App.MintKeeper.GetParams(s.Ctx)
s.Require().Equal(mp.BlocksPerYear, uint64(6311520))

// sp := s.App.SlashingKeeper.GetParams(s.Ctx)
// s.Require().Equal(sp.SignedBlocksWindow, int64(100))
sp := s.App.SlashingKeeper.GetParams(s.Ctx)
s.Require().Equal(sp.SignedBlocksWindow, int64(100))

// }
}

// func postUpgradeChecks(s *UpgradeTestSuite) {
func postUpgradeChecks(s *UpgradeTestSuite) {

// // Ensure the gov params have MinInitialDepositRatio added
// gp := s.App.GovKeeper.GetParams(s.Ctx)
// s.Require().Equal(gp.MinInitialDepositRatio, "0.200000000000000000")
// Ensure the gov params have MinInitialDepositRatio added
gp := s.App.GovKeeper.GetParams(s.Ctx)
s.Require().Equal(gp.MinInitialDepositRatio, "0.200000000000000000")

// // Ensure the mint params have doubled
// mp := s.App.MintKeeper.GetParams(s.Ctx)
// s.Require().Equal(mp.BlocksPerYear, uint64(6311520*2))
// Ensure the mint params have doubled
mp := s.App.MintKeeper.GetParams(s.Ctx)
s.Require().Equal(mp.BlocksPerYear, uint64(6311520*2))

// // Ensure the slashing params have doubled
// sp := s.App.SlashingKeeper.GetParams(s.Ctx)
// s.Require().Equal(sp.SignedBlocksWindow, int64(100*2))
// Ensure the slashing params have doubled
sp := s.App.SlashingKeeper.GetParams(s.Ctx)
s.Require().Equal(sp.SignedBlocksWindow, int64(100*2))

// // Ensure the wasm Permissionless
// wp := s.App.WasmKeeper.GetParams(s.Ctx)
// s.Require().Equal(wp.CodeUploadAccess, wasmtypes.AllowEverybody)
// }
// Ensure the wasm Permissionless
wp := s.App.WasmKeeper.GetParams(s.Ctx)
s.Require().Equal(wp.CodeUploadAccess, wasmtypes.AllowEverybody)
}

0 comments on commit 723cec2

Please sign in to comment.