agoric 0.21.2-mainnet1B-dev-cfa7cb2.0 → 0.21.2-orchestration-dev-096c4e8.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agoric",
3
- "version": "0.21.2-mainnet1B-dev-cfa7cb2.0+cfa7cb2",
3
+ "version": "0.21.2-orchestration-dev-096c4e8.0+096c4e8",
4
4
  "description": "Manage the Agoric Javascript smart contract platform",
5
5
  "type": "module",
6
6
  "main": "src/main.js",
@@ -8,8 +8,13 @@
8
8
  "agoric": "src/entrypoint.js",
9
9
  "agops": "src/bin-agops.js"
10
10
  },
11
+ "exports": {
12
+ "./src/entrypoint.js": "./src/entrypoint.js",
13
+ "./src/helpers.js": "./src/helpers.js"
14
+ },
11
15
  "files": [
12
16
  "src",
17
+ "tools",
13
18
  "exported.js"
14
19
  ],
15
20
  "scripts": {
@@ -20,48 +25,53 @@
20
25
  "integration-test": "ava --config .ava-integration-test.config.js",
21
26
  "lint-fix": "yarn lint:eslint --fix",
22
27
  "lint": "run-s --continue-on-error lint:*",
23
- "lint:types": "tsc -p jsconfig.json",
28
+ "lint:types": "tsc",
24
29
  "lint:eslint": "eslint ."
25
30
  },
26
31
  "devDependencies": {
27
- "@agoric/deploy-script-support": "0.10.4-mainnet1B-dev-cfa7cb2.0+cfa7cb2",
28
- "ava": "^5.2.0",
32
+ "@agoric/cosmic-swingset": "0.41.4-orchestration-dev-096c4e8.0+096c4e8",
33
+ "@agoric/deploy-script-support": "0.10.4-orchestration-dev-096c4e8.0+096c4e8",
34
+ "ava": "^5.3.0",
29
35
  "c8": "^7.13.0",
30
- "dd-trace": "^3.3.0"
36
+ "dd-trace": "^4.11.1"
31
37
  },
32
38
  "dependencies": {
33
- "@agoric/access-token": "0.4.22-mainnet1B-dev-cfa7cb2.0+cfa7cb2",
34
- "@agoric/assert": "0.6.1-mainnet1B-dev-cfa7cb2.0+cfa7cb2",
35
- "@agoric/cache": "0.3.3-mainnet1B-dev-cfa7cb2.0+cfa7cb2",
36
- "@agoric/casting": "0.4.3-mainnet1B-dev-cfa7cb2.0+cfa7cb2",
37
- "@agoric/cosmic-proto": "0.3.1-mainnet1B-dev-cfa7cb2.0+cfa7cb2",
38
- "@agoric/ertp": "0.16.3-mainnet1B-dev-cfa7cb2.0+cfa7cb2",
39
- "@agoric/inter-protocol": "0.16.2-mainnet1B-dev-cfa7cb2.0+cfa7cb2",
40
- "@agoric/internal": "0.3.3-mainnet1B-dev-cfa7cb2.0+cfa7cb2",
41
- "@agoric/smart-wallet": "0.5.4-mainnet1B-dev-cfa7cb2.0+cfa7cb2",
42
- "@agoric/store": "0.9.3-mainnet1B-dev-cfa7cb2.0+cfa7cb2",
43
- "@agoric/swingset-vat": "0.32.3-mainnet1B-dev-cfa7cb2.0+cfa7cb2",
44
- "@agoric/vats": "0.15.2-mainnet1B-dev-cfa7cb2.0+cfa7cb2",
45
- "@agoric/zoe": "0.26.3-mainnet1B-dev-cfa7cb2.0+cfa7cb2",
46
- "@agoric/zone": "0.2.3-mainnet1B-dev-cfa7cb2.0+cfa7cb2",
47
- "@confio/relayer": "^0.9.0",
48
- "@cosmjs/crypto": "^0.30.1",
49
- "@cosmjs/encoding": "^0.30.1",
50
- "@cosmjs/math": "^0.30.1",
51
- "@cosmjs/proto-signing": "^0.30.1",
52
- "@cosmjs/stargate": "^0.30.1",
53
- "@endo/bundle-source": "2.5.2-upstream-rollup",
54
- "@endo/captp": "3.1.1",
55
- "@endo/compartment-mapper": "0.8.4",
56
- "@endo/far": "0.2.18",
57
- "@endo/init": "0.5.56",
58
- "@endo/marshal": "0.8.5",
59
- "@endo/nat": "4.1.27",
60
- "@endo/promise-kit": "0.2.56",
39
+ "@agoric/access-token": "0.4.22-orchestration-dev-096c4e8.0+096c4e8",
40
+ "@agoric/assert": "0.6.1-orchestration-dev-096c4e8.0+096c4e8",
41
+ "@agoric/cache": "0.3.3-orchestration-dev-096c4e8.0+096c4e8",
42
+ "@agoric/casting": "0.4.3-orchestration-dev-096c4e8.0+096c4e8",
43
+ "@agoric/cosmic-proto": "0.4.1-orchestration-dev-096c4e8.0+096c4e8",
44
+ "@agoric/ertp": "0.16.3-orchestration-dev-096c4e8.0+096c4e8",
45
+ "@agoric/governance": "0.10.4-orchestration-dev-096c4e8.0+096c4e8",
46
+ "@agoric/inter-protocol": "0.16.2-orchestration-dev-096c4e8.0+096c4e8",
47
+ "@agoric/internal": "0.3.3-orchestration-dev-096c4e8.0+096c4e8",
48
+ "@agoric/network": "0.1.1-orchestration-dev-096c4e8.0+096c4e8",
49
+ "@agoric/smart-wallet": "0.5.4-orchestration-dev-096c4e8.0+096c4e8",
50
+ "@agoric/store": "0.9.3-orchestration-dev-096c4e8.0+096c4e8",
51
+ "@agoric/swingset-vat": "0.32.3-orchestration-dev-096c4e8.0+096c4e8",
52
+ "@agoric/vats": "0.15.2-orchestration-dev-096c4e8.0+096c4e8",
53
+ "@agoric/zoe": "0.26.3-orchestration-dev-096c4e8.0+096c4e8",
54
+ "@agoric/zone": "0.2.3-orchestration-dev-096c4e8.0+096c4e8",
55
+ "@confio/relayer": "^0.11.3",
56
+ "@cosmjs/crypto": "^0.32.2",
57
+ "@cosmjs/encoding": "^0.32.2",
58
+ "@cosmjs/math": "^0.32.2",
59
+ "@cosmjs/proto-signing": "^0.32.2",
60
+ "@cosmjs/stargate": "^0.32.2",
61
+ "@endo/bundle-source": "^3.1.0",
62
+ "@endo/captp": "^4.0.4",
63
+ "@endo/compartment-mapper": "^1.1.2",
64
+ "@endo/env-options": "^1.1.1",
65
+ "@endo/far": "^1.0.4",
66
+ "@endo/init": "^1.0.4",
67
+ "@endo/marshal": "^1.3.0",
68
+ "@endo/nat": "^5.0.4",
69
+ "@endo/patterns": "^1.2.0",
70
+ "@endo/promise-kit": "^1.0.4",
61
71
  "@iarna/toml": "^2.2.3",
62
72
  "anylogger": "^0.21.0",
63
73
  "chalk": "^5.2.0",
64
- "commander": "^10.0.0",
74
+ "commander": "^11.1.0",
65
75
  "deterministic-json": "^1.0.5",
66
76
  "esm": "agoric-labs/esm#Agoric-built",
67
77
  "inquirer": "^8.2.2",
@@ -87,5 +97,8 @@
87
97
  "timeout": "2m",
88
98
  "workerThreads": false
89
99
  },
90
- "gitHead": "cfa7cb2bf1aa80bc60741a0eb5ba884995e8ee4c"
100
+ "typeCoverage": {
101
+ "atLeast": 76.93
102
+ },
103
+ "gitHead": "096c4e8fce80e9a509b0e1a30fda11736c4570e1"
91
104
  }
@@ -1,31 +1,45 @@
1
- /* global process */
1
+ import {
2
+ getEnvironmentOption,
3
+ getEnvironmentOptionsList,
4
+ } from '@endo/env-options';
2
5
  import anylogger from 'anylogger';
3
6
  import chalk from 'chalk';
4
7
 
5
- // Turn on debugging output with DEBUG=agoric
6
- const { DEBUG } = process.env;
7
- let selectedLevel = 'info';
8
- if (DEBUG === undefined) {
9
- selectedLevel = 'log';
10
- } else if (DEBUG.includes('agoric')) {
11
- selectedLevel = 'debug';
8
+ const DEBUG_LIST = getEnvironmentOptionsList('DEBUG');
9
+
10
+ // Turn on debugging output with DEBUG=agoric or DEBUG=agoric:${level}
11
+ let selectedLevel =
12
+ DEBUG_LIST.length || getEnvironmentOption('DEBUG', 'unset') === 'unset'
13
+ ? 'log'
14
+ : 'info';
15
+ for (const level of DEBUG_LIST) {
16
+ const parts = level.split(':');
17
+ if (parts[0] !== 'agoric') {
18
+ continue;
19
+ }
20
+ if (parts.length > 1) {
21
+ selectedLevel = parts[1];
22
+ } else {
23
+ selectedLevel = 'debug';
24
+ }
12
25
  }
13
- const defaultLevel = anylogger.levels[selectedLevel];
26
+ const selectedCode = anylogger.levels[selectedLevel];
27
+ const globalCode = selectedCode === undefined ? -Infinity : selectedCode;
14
28
 
15
29
  const oldExt = anylogger.ext;
16
30
  anylogger.ext = (l, o) => {
17
31
  l = oldExt(l, o);
18
- l.enabledFor = lvl => defaultLevel >= anylogger.levels[lvl];
32
+ l.enabledFor = lvl => globalCode >= anylogger.levels[lvl];
19
33
 
20
34
  const prefix = l.name.replace(/:/g, ': ');
21
35
  for (const [level, code] of Object.entries(anylogger.levels)) {
22
- if (code > defaultLevel) {
23
- // Disable printing.
24
- l[level] = () => {};
25
- } else {
36
+ if (globalCode >= code) {
26
37
  // Enable the printing with a prefix.
27
38
  const doLog = l[level] || (() => {});
28
39
  l[level] = (...args) => doLog(chalk.bold.blue(`${prefix}:`), ...args);
40
+ } else {
41
+ // Disable printing.
42
+ l[level] = () => {};
29
43
  }
30
44
  }
31
45
  return l;
package/src/bin-agops.js CHANGED
@@ -1,13 +1,16 @@
1
1
  #!/usr/bin/env node
2
2
  // @ts-check
3
3
  // @jessie-check
4
+ /* eslint @typescript-eslint/no-floating-promises: "warn" */
4
5
 
5
- /* eslint-disable @jessie.js/no-nested-await */
6
6
  /* global fetch, setTimeout */
7
7
 
8
+ import '@endo/init/pre.js';
9
+
8
10
  import '@agoric/casting/node-fetch-shim.js';
9
11
  import '@endo/init';
10
- import '@endo/init/pre.js';
12
+
13
+ import { E } from '@endo/far';
11
14
 
12
15
  import { execFileSync } from 'child_process';
13
16
  import path from 'path';
@@ -15,7 +18,7 @@ import process from 'process';
15
18
  import anylogger from 'anylogger';
16
19
  import { Command, CommanderError, createCommand } from 'commander';
17
20
  import { makeOracleCommand } from './commands/oracle.js';
18
- import { makeEconomicCommiteeCommand } from './commands/ec.js';
21
+ import { makeGovCommand } from './commands/gov.js';
19
22
  import { makePsmCommand } from './commands/psm.js';
20
23
  import { makeReserveCommand } from './commands/reserve.js';
21
24
  import { makeVaultsCommand } from './commands/vaults.js';
@@ -31,7 +34,7 @@ const program = new Command();
31
34
  program.name(progname).version('unversioned');
32
35
 
33
36
  program.addCommand(makeOracleCommand(logger));
34
- program.addCommand(makeEconomicCommiteeCommand(logger));
37
+ program.addCommand(makeGovCommand(logger));
35
38
  program.addCommand(makePerfCommand(logger));
36
39
  program.addCommand(makePsmCommand(logger));
37
40
  program.addCommand(makeVaultsCommand(logger));
@@ -74,13 +77,11 @@ program.addCommand(makeAuctionCommand(logger, { ...procIO, fetch }));
74
77
  program.addCommand(makeInterCommand(procIO, { fetch }));
75
78
  program.addCommand(makeTestCommand(procIO, { fetch }));
76
79
 
77
- try {
78
- await program.parseAsync(process.argv);
79
- } catch (err) {
80
+ void E.when(program.parseAsync(process.argv), undefined, err => {
80
81
  if (err instanceof CommanderError) {
81
82
  console.error(err.message);
82
83
  } else {
83
84
  console.error(err); // CRASH! show stack trace
84
85
  }
85
86
  process.exit(1);
86
- }
87
+ });
@@ -1,5 +1,6 @@
1
1
  import djson from 'deterministic-json';
2
2
  import TOML from '@iarna/toml';
3
+ import * as Tokens from '@agoric/internal/src/tokens.js';
3
4
 
4
5
  export const STAKING_MAX_VALIDATORS = 150;
5
6
  // Required for IBC connections not to time out.
@@ -13,38 +14,38 @@ export const ICA_HOST_ALLOW_MESSAGES = [
13
14
  ];
14
15
 
15
16
  const Stake = /** @type {const} */ ({
16
- name: 'Agoric Staking Token',
17
+ name: Tokens.Stake.proposedName,
17
18
  description: 'The token used by delegates to stake on the Agoric chain',
18
19
  denom_units: [
19
20
  {
20
- denom: 'ubld',
21
+ denom: Tokens.Stake.denom,
21
22
  exponent: 0,
22
23
  },
23
24
  {
24
25
  denom: 'bld',
25
- exponent: 6,
26
+ exponent: Tokens.Stake.displayInfo.decimalPlaces,
26
27
  },
27
28
  ],
28
- base: 'ubld',
29
+ base: Tokens.Stake.denom,
29
30
  display: 'bld',
30
- symbol: 'BLD',
31
+ symbol: Tokens.Stake.symbol,
31
32
  });
32
33
  const Stable = /** @type {const} */ ({
33
- name: 'Agoric stable token',
34
+ name: Tokens.Stable.proposedName,
34
35
  description: 'The stable token used by the Agoric chain',
35
36
  denom_units: [
36
37
  {
37
- denom: 'uist',
38
+ denom: Tokens.Stable.denom,
38
39
  exponent: 0,
39
40
  },
40
41
  {
41
42
  denom: 'ist',
42
- exponent: 6,
43
+ exponent: Tokens.Stable.displayInfo.decimalPlaces,
43
44
  },
44
45
  ],
45
- base: 'uist',
46
+ base: Tokens.Stable.denom,
46
47
  display: 'ist',
47
- symbol: 'IST',
48
+ symbol: Tokens.Stable.symbol,
48
49
  });
49
50
  export const DENOM_METADATA = /** @type {const} */ ([Stake, Stable]);
50
51
 
@@ -235,7 +236,6 @@ export function finishCosmosGenesis({ genesisJson, exportedGenesisJson }) {
235
236
 
236
237
  // Set the denomination for different modules.
237
238
  genesis.app_state.mint.params.mint_denom = MINT_DENOM;
238
- genesis.app_state.crisis.constant_fee.denom = MINT_DENOM;
239
239
  genesis.app_state.gov.deposit_params.min_deposit = GOV_DEPOSIT_COINS;
240
240
  genesis.app_state.gov.voting_params.voting_period = GOV_VOTING_PERIOD;
241
241
 
@@ -1,4 +1,3 @@
1
- /* eslint-disable @jessie.js/no-nested-await */
2
1
  // @ts-check
3
2
  /* eslint-disable func-names */
4
3
  import { InvalidArgumentError } from 'commander';
@@ -8,7 +7,11 @@ import { outputActionAndHint } from '../lib/wallet.js';
8
7
  const { Fail } = assert;
9
8
 
10
9
  /** @typedef {import('@agoric/governance/src/contractGovernance/typedParamManager.js').ParamTypesMap} ParamTypesMap */
11
- /** @template M @typedef {import('@agoric/governance/src/contractGovernance/typedParamManager.js').ParamTypesMapFromRecord<M>} ParamTypesMapFromRecord */
10
+
11
+ /**
12
+ * @template {ParamStateRecord} M
13
+ * @typedef {import('@agoric/governance/src/contractGovernance/typedParamManager.js').ParamTypesMapFromRecord<M>} ParamTypesMapFromRecord
14
+ */
12
15
 
13
16
  /**
14
17
  * @template {ParamTypesMap} M
@@ -111,7 +114,7 @@ export const makeAuctionCommand = (
111
114
  * but TimeMath.toRel prodocues a RelativeTime (which may be a bare bigint).
112
115
  *
113
116
  * @param {bigint} relValue
114
- * @returns {import('@agoric/time/src/types').RelativeTimeRecord}
117
+ * @returns {import('@agoric/time').RelativeTimeRecord}
115
118
  */
116
119
  const toRel = relValue => ({ timerBrand, relValue });
117
120