@agoric/cosmos 0.34.2-dev-5382a55.0 → 0.34.2-dev-55ccfd2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/app.go +20 -36
- package/app/const.go +2 -2
- package/git-revision.txt +1 -1
- package/package.json +2 -2
package/app/app.go
CHANGED
|
@@ -201,6 +201,8 @@ type GaiaApp struct { // nolint: golint
|
|
|
201
201
|
vibcPort int
|
|
202
202
|
vstoragePort int
|
|
203
203
|
|
|
204
|
+
upgradePlan *upgradetypes.Plan
|
|
205
|
+
|
|
204
206
|
invCheckPeriod uint
|
|
205
207
|
|
|
206
208
|
// keys to access the substores
|
|
@@ -744,11 +746,11 @@ func NewAgoricApp(
|
|
|
744
746
|
|
|
745
747
|
app.UpgradeKeeper.SetUpgradeHandler(
|
|
746
748
|
upgradeName,
|
|
747
|
-
|
|
749
|
+
upgrade11Handler(app, upgradeName),
|
|
748
750
|
)
|
|
749
751
|
app.UpgradeKeeper.SetUpgradeHandler(
|
|
750
752
|
upgradeNameTest,
|
|
751
|
-
|
|
753
|
+
upgrade11Handler(app, upgradeNameTest),
|
|
752
754
|
)
|
|
753
755
|
|
|
754
756
|
if loadLatest {
|
|
@@ -771,39 +773,19 @@ func NewAgoricApp(
|
|
|
771
773
|
return app
|
|
772
774
|
}
|
|
773
775
|
|
|
774
|
-
|
|
776
|
+
// upgrade11Handler performs standard upgrade actions plus custom actions for upgrade-11.
|
|
777
|
+
func upgrade11Handler(app *GaiaApp, targetUpgrade string) func(sdk.Context, upgradetypes.Plan, module.VersionMap) (module.VersionMap, error) {
|
|
775
778
|
return func(ctx sdk.Context, plan upgradetypes.Plan, fromVm module.VersionMap) (module.VersionMap, error) {
|
|
776
|
-
//
|
|
777
|
-
|
|
778
|
-
prevParams := app.SwingSetKeeper.GetParams(ctx)
|
|
779
|
-
|
|
780
|
-
ctx.Logger().Info("Pre-upgrade swingset params", "BeansPerUnit", fmt.Sprintf("%v", prevParams.BeansPerUnit), "BootstrapVatConfig", prevParams.BootstrapVatConfig)
|
|
781
|
-
|
|
782
|
-
switch targetUpgrade {
|
|
783
|
-
case upgradeName:
|
|
784
|
-
prevParams.BootstrapVatConfig = "@agoric/vats/decentral-main-vaults-config.json"
|
|
785
|
-
case upgradeNameTest:
|
|
786
|
-
prevParams.BootstrapVatConfig = "@agoric/vats/decentral-test-vaults-config.json"
|
|
787
|
-
default:
|
|
788
|
-
return fromVm, fmt.Errorf("invalid upgrade name")
|
|
789
|
-
}
|
|
790
|
-
|
|
791
|
-
app.SwingSetKeeper.SetParams(ctx, prevParams)
|
|
792
|
-
ctx.Logger().Info("Post-upgrade swingset params", "BeansPerUnit", fmt.Sprintf("%v", prevParams.BeansPerUnit), "BootstrapVatConfig", prevParams.BootstrapVatConfig)
|
|
793
|
-
|
|
794
|
-
app.VstorageKeeper.MigrateNoDataPlaceholders(ctx) // upgrade-10 only
|
|
795
|
-
normalizeModuleAccount(ctx, app.AccountKeeper, vbanktypes.ProvisionPoolName)
|
|
796
|
-
normalizeModuleAccount(ctx, app.AccountKeeper, vbanktypes.ReservePoolName)
|
|
779
|
+
// Record the plan to send to SwingSet
|
|
780
|
+
app.upgradePlan = &plan
|
|
797
781
|
|
|
782
|
+
// Always run module migrations
|
|
798
783
|
mvm, err := app.mm.RunMigrations(ctx, app.configurator, fromVm)
|
|
799
784
|
if err != nil {
|
|
800
785
|
return mvm, err
|
|
801
786
|
}
|
|
802
787
|
|
|
803
|
-
|
|
804
|
-
// business.
|
|
805
|
-
stdlog.Println("Rebooting SwingSet")
|
|
806
|
-
return mvm, swingset.BootSwingset(ctx, app.SwingSetKeeper)
|
|
788
|
+
return mvm, nil
|
|
807
789
|
}
|
|
808
790
|
}
|
|
809
791
|
|
|
@@ -825,14 +807,15 @@ func normalizeModuleAccount(ctx sdk.Context, ak authkeeper.AccountKeeper, name s
|
|
|
825
807
|
}
|
|
826
808
|
|
|
827
809
|
type cosmosInitAction struct {
|
|
828
|
-
Type string
|
|
829
|
-
ChainID string
|
|
830
|
-
Params swingset.Params
|
|
831
|
-
StoragePort int
|
|
832
|
-
SupplyCoins sdk.Coins
|
|
833
|
-
VibcPort int
|
|
834
|
-
VbankPort int
|
|
835
|
-
LienPort int
|
|
810
|
+
Type string `json:"type"`
|
|
811
|
+
ChainID string `json:"chainID"`
|
|
812
|
+
Params swingset.Params `json:"params"`
|
|
813
|
+
StoragePort int `json:"storagePort"`
|
|
814
|
+
SupplyCoins sdk.Coins `json:"supplyCoins"`
|
|
815
|
+
VibcPort int `json:"vibcPort"`
|
|
816
|
+
VbankPort int `json:"vbankPort"`
|
|
817
|
+
LienPort int `json:"lienPort"`
|
|
818
|
+
UpgradePlan *upgradetypes.Plan `json:"upgradePlan,omitempty"`
|
|
836
819
|
}
|
|
837
820
|
|
|
838
821
|
// Name returns the name of the App
|
|
@@ -853,6 +836,7 @@ func (app *GaiaApp) MustInitController(ctx sdk.Context) {
|
|
|
853
836
|
VibcPort: app.vibcPort,
|
|
854
837
|
VbankPort: app.vbankPort,
|
|
855
838
|
LienPort: app.lienPort,
|
|
839
|
+
UpgradePlan: app.upgradePlan,
|
|
856
840
|
}
|
|
857
841
|
out, err := app.SwingSetKeeper.BlockingSend(ctx, action)
|
|
858
842
|
|
package/app/const.go
CHANGED
package/git-revision.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
55ccfd2
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/cosmos",
|
|
3
|
-
"version": "0.34.2-dev-
|
|
3
|
+
"version": "0.34.2-dev-55ccfd2.0+55ccfd2",
|
|
4
4
|
"description": "Connect JS to the Cosmos blockchain SDK",
|
|
5
5
|
"parsers": {
|
|
6
6
|
"js": "mjs"
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"access": "public"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "55ccfd2c76fbd9160bbbd9154632bb859f5ae3fa"
|
|
39
39
|
}
|