@agoric/cosmos 0.34.2-upgrade-16-dev-0549112.0 → 0.34.2-upgrade-16-dev-5e17008.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.
@@ -2,6 +2,7 @@ package cmd
2
2
 
3
3
  import (
4
4
  "errors"
5
+ "fmt"
5
6
  "io"
6
7
  "os"
7
8
  "path/filepath"
@@ -452,7 +453,7 @@ func replaceCosmosSnapshotExportCommand(cmd *cobra.Command, ac appCreator) {
452
453
  replacedRunE := func(cmd *cobra.Command, args []string) error {
453
454
  ctx := server.GetServerContextFromCmd(cmd)
454
455
 
455
- height, err := cmd.Flags().GetInt64("height")
456
+ heightFlag, err := cmd.Flags().GetInt64("height")
456
457
  if err != nil {
457
458
  return err
458
459
  }
@@ -467,13 +468,15 @@ func replaceCosmosSnapshotExportCommand(cmd *cobra.Command, ac appCreator) {
467
468
  app := ac.newSnapshotsApp(ctx.Logger, db, nil, ctx.Viper)
468
469
  gaiaApp := app.(*gaia.GaiaApp)
469
470
 
470
- if height == 0 {
471
- height = app.CommitMultiStore().LastCommitID().Version
471
+ latestHeight := app.CommitMultiStore().LastCommitID().Version
472
+
473
+ if heightFlag != 0 && latestHeight != heightFlag {
474
+ return fmt.Errorf("cannot export at height %d, only latest height %d is supported", heightFlag, latestHeight)
472
475
  }
473
476
 
474
- cmd.Printf("Exporting snapshot for height %d\n", height)
477
+ cmd.Printf("Exporting snapshot for height %d\n", latestHeight)
475
478
 
476
- err = gaiaApp.SwingSetSnapshotter.InitiateSnapshot(height)
479
+ err = gaiaApp.SwingSetSnapshotter.InitiateSnapshot(latestHeight)
477
480
  if err != nil {
478
481
  return err
479
482
  }
@@ -488,7 +491,7 @@ func replaceCosmosSnapshotExportCommand(cmd *cobra.Command, ac appCreator) {
488
491
  return err
489
492
  }
490
493
 
491
- snapshotHeight := uint64(height)
494
+ snapshotHeight := uint64(latestHeight)
492
495
 
493
496
  for _, snapshot := range snapshotList {
494
497
  if snapshot.Height == snapshotHeight {
package/git-revision.txt CHANGED
@@ -1 +1 @@
1
- 0549112
1
+ 5e17008
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agoric/cosmos",
3
- "version": "0.34.2-upgrade-16-dev-0549112.0+0549112",
3
+ "version": "0.34.2-upgrade-16-dev-5e17008.0+5e17008",
4
4
  "description": "Connect JS to the Cosmos blockchain SDK",
5
5
  "parsers": {
6
6
  "js": "mjs"
@@ -39,5 +39,5 @@
39
39
  "typeCoverage": {
40
40
  "atLeast": 0
41
41
  },
42
- "gitHead": "05491122ee61362c8310a7924ac67f033b02e38f"
42
+ "gitHead": "5e1700835993739016a08936193644c1ae5abb13"
43
43
  }