-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(cherry picked from commit fedf6e4) # Conflicts: # protocol/testing/version/VERSION_CURRENT # protocol/testing/version/VERSION_FULL_NAME_PREUPGRADE # protocol/testing/version/VERSION_PREUPGRADE
- Loading branch information
1 parent
39e1921
commit f22cc2f
Showing
9 changed files
with
2,442 additions
and
534 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 was deleted.
Oops, something went wrong.
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,13 @@ | ||
package v_7_0_0 | ||
|
||
import ( | ||
"github.com/dydxprotocol/v4-chain/protocol/app/upgrades" | ||
) | ||
|
||
const ( | ||
UpgradeName = "v7.0.0" | ||
) | ||
|
||
var Upgrade = upgrades.Upgrade{ | ||
UpgradeName: UpgradeName, | ||
} |
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,17 @@ | ||
package v_7_0_0 | ||
|
||
import ( | ||
"context" | ||
|
||
upgradetypes "cosmossdk.io/x/upgrade/types" | ||
"github.com/cosmos/cosmos-sdk/types/module" | ||
) | ||
|
||
func CreateUpgradeHandler( | ||
mm *module.Manager, | ||
configurator module.Configurator, | ||
) upgradetypes.UpgradeHandler { | ||
return func(ctx context.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { | ||
return mm.RunMigrations(ctx, configurator, vm) | ||
} | ||
} |
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,47 @@ | ||
//go:build all || container_test | ||
|
||
package v_7_0_0_test | ||
|
||
import ( | ||
"testing" | ||
|
||
v_7_0_0 "github.com/dydxprotocol/v4-chain/protocol/app/upgrades/v7.0.0" | ||
"github.com/dydxprotocol/v4-chain/protocol/testing/containertest" | ||
"github.com/dydxprotocol/v4-chain/protocol/testutil/constants" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
const ( | ||
AliceBobBTCQuantums = 1_000_000 | ||
CarlDaveBTCQuantums = 2_000_000 | ||
CarlDaveETHQuantums = 4_000_000 | ||
) | ||
|
||
func TestStateUpgrade(t *testing.T) { | ||
testnet, err := containertest.NewTestnetWithPreupgradeGenesis() | ||
require.NoError(t, err, "failed to create testnet - is docker daemon running?") | ||
err = testnet.Start() | ||
require.NoError(t, err) | ||
defer testnet.MustCleanUp() | ||
node := testnet.Nodes["alice"] | ||
nodeAddress := constants.AliceAccAddress.String() | ||
|
||
preUpgradeSetups(node, t) | ||
preUpgradeChecks(node, t) | ||
|
||
err = containertest.UpgradeTestnet(nodeAddress, t, node, v_7_0_0.UpgradeName) | ||
require.NoError(t, err) | ||
|
||
postUpgradeChecks(node, t) | ||
} | ||
|
||
func preUpgradeSetups(node *containertest.Node, t *testing.T) { | ||
} | ||
|
||
func preUpgradeChecks(node *containertest.Node, t *testing.T) { | ||
// Add test for your upgrade handler logic below | ||
} | ||
|
||
func postUpgradeChecks(node *containertest.Node, t *testing.T) { | ||
// Add test for your upgrade handler logic below | ||
} |
Oops, something went wrong.