-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CNS-53 spec support simultaneously both res ts get post (#165)
* removed proposal json and using the generated one * removed spec modify * changed specs to the new version * deterministic is moved into the interface * renaming some parameters in spec * added migrator * add upgrade plan * PR changes, moved category to interface * update get interface * add method to newmsg in rest * fix tendermint new msg * update specs Co-authored-by: Yarom Swisa <[email protected] git config --global user.name Yarom> Co-authored-by: omer mishael <[email protected]>
- Loading branch information
1 parent
cf54b2a
commit ada6320
Showing
54 changed files
with
75,829 additions
and
75,861 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,14 @@ | ||
package v0_X_0 | ||
|
||
import ( | ||
store "github.com/cosmos/cosmos-sdk/store/types" | ||
"github.com/lavanet/lava/app/upgrades" | ||
) | ||
|
||
const UpgradeName = "v0.X.0" | ||
|
||
var Upgrade = upgrades.Upgrade{ | ||
UpgradeName: UpgradeName, // upgrade name defined few lines above | ||
CreateUpgradeHandler: CreateUpgradeHandler, // create CreateUpgradeHandler in upgrades.go below | ||
StoreUpgrades: store.StoreUpgrades{}, // StoreUpgrades has 3 fields: Added/Renamed/Deleted any module that fits these description should be added in the way below | ||
} |
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,32 @@ | ||
//go:build ignore | ||
|
||
package v0_x_0_test | ||
|
||
import ( | ||
"testing" | ||
|
||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/ignite-hq/cli/ignite/pkg/cosmoscmd" | ||
keepertest "github.com/lavanet/lava/testutil/keeper" | ||
"github.com/stretchr/testify/suite" | ||
) | ||
|
||
type UpgradeTestSuite struct { | ||
suite.Suite | ||
|
||
ctx sdk.Context | ||
app cosmoscmd.App | ||
} | ||
|
||
func (suite *UpgradeTestSuite) SetupTestApp() { | ||
suite.app, suite.ctx = app.TestSetup() | ||
} | ||
|
||
func TestKeeperTestSuite(t *testing.T) { | ||
suite.Run(t, new(UpgradeTestSuite)) | ||
} | ||
|
||
func (suite *UpgradeTestSuite) TestBody() { | ||
suite.SetupTestApp() // setup test app | ||
suite.T().Log("test") | ||
} |
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,32 @@ | ||
package v0_X_0 | ||
|
||
import ( | ||
"log" | ||
|
||
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/lavanet/lava/app/keepers" | ||
"github.com/lavanet/lava/app/upgrades" | ||
"github.com/lavanet/lava/x/spec/migrations" | ||
) | ||
|
||
func CreateUpgradeHandler( | ||
mm *module.Manager, | ||
configurator module.Configurator, | ||
bpm upgrades.BaseAppParamManager, | ||
keepers *keepers.LavaKeepers, | ||
) upgradetypes.UpgradeHandler { | ||
return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { | ||
log.Println("########################") | ||
log.Println("# STARTING UPGRADE #") | ||
log.Println("########################") | ||
|
||
// delete all existing conflicts | ||
|
||
migrator := migrations.NewMigrator(keepers.SpecKeeper) | ||
migrator.MigrateToV0X0(ctx) | ||
|
||
return mm.RunMigrations(ctx, configurator, vm) | ||
} | ||
} |
Oops, something went wrong.