-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix(clock): v19 params set 250k gas * backport to mainnet v19 * lintorrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
- Loading branch information
1 parent
fadec0a
commit 7e50425
Showing
4 changed files
with
97 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package v18 | ||
|
||
import ( | ||
"fmt" | ||
|
||
store "github.com/cosmos/cosmos-sdk/store/types" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/cosmos/cosmos-sdk/types/module" | ||
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" | ||
|
||
"github.com/CosmosContracts/juno/v19/app/keepers" | ||
"github.com/CosmosContracts/juno/v19/app/upgrades" | ||
clocktypes "github.com/CosmosContracts/juno/v19/x/clock/types" | ||
) | ||
|
||
// UpgradeName defines the on-chain upgrade name for the upgrade. | ||
const UpgradeName = "v1900alpha2" | ||
|
||
var Upgrade = upgrades.Upgrade{ | ||
UpgradeName: UpgradeName, | ||
CreateUpgradeHandler: v1900Alpha2UpgradeHandler, | ||
StoreUpgrades: store.StoreUpgrades{}, | ||
} | ||
|
||
func v1900Alpha2UpgradeHandler( | ||
mm *module.Manager, | ||
cfg module.Configurator, | ||
k *keepers.AppKeepers, | ||
) upgradetypes.UpgradeHandler { | ||
return func(ctx sdk.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { | ||
logger := ctx.Logger().With("upgrade", UpgradeName) | ||
|
||
logger.Info(fmt.Sprintf("pre migrate version map: %v", vm)) | ||
versionMap, err := mm.RunMigrations(ctx, cfg, vm) | ||
if err != nil { | ||
return nil, err | ||
} | ||
logger.Info(fmt.Sprintf("post migrate version map: %v", versionMap)) | ||
|
||
if err := k.ClockKeeper.SetParams(ctx, clocktypes.Params{ | ||
ContractGasLimit: 250_000, | ||
}); err != nil { | ||
return nil, err | ||
} | ||
|
||
return versionMap, nil | ||
} | ||
} |
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,40 @@ | ||
package v18_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/suite" | ||
|
||
"github.com/CosmosContracts/juno/v19/app/apptesting" | ||
v19alpha2 "github.com/CosmosContracts/juno/v19/app/upgrades/testnet/v19.0.0-alpha.2" | ||
) | ||
|
||
type UpgradeTestSuite struct { | ||
apptesting.KeeperTestHelper | ||
} | ||
|
||
func (s *UpgradeTestSuite) SetupTest() { | ||
s.Setup() | ||
} | ||
|
||
func TestKeeperTestSuite(t *testing.T) { | ||
suite.Run(t, new(UpgradeTestSuite)) | ||
} | ||
|
||
// Ensures the test does not error out. | ||
func (s *UpgradeTestSuite) TestUpgrade() { | ||
s.Setup() | ||
|
||
preUpgradeChecks(s) | ||
|
||
upgradeHeight := int64(5) | ||
s.ConfirmUpgradeSucceeded(v19alpha2.UpgradeName, upgradeHeight) | ||
|
||
postUpgradeChecks(s) | ||
} | ||
|
||
func preUpgradeChecks(_ *UpgradeTestSuite) { | ||
} | ||
|
||
func postUpgradeChecks(_ *UpgradeTestSuite) { | ||
} |
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