agoric 0.21.2-dev-5dc325b.0 → 0.21.2-getting-started-dev-d127d1d.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/CHANGELOG.md +1086 -0
- package/package.json +28 -39
- package/src/bin-agops.js +8 -9
- package/src/chain-config.js +10 -11
- package/src/commands/auction.js +2 -5
- package/src/commands/{gov.js → ec.js} +37 -176
- package/src/commands/inter.js +27 -10
- package/src/commands/oracle.js +3 -2
- package/src/commands/perf.js +2 -0
- package/src/commands/psm.js +11 -11
- package/src/commands/reserve.js +2 -1
- package/src/commands/test-upgrade.js +2 -7
- package/src/commands/vaults.js +5 -3
- package/src/helpers.js +0 -1
- package/src/init.js +8 -5
- package/src/install.js +1 -1
- package/src/lib/chain.js +3 -13
- package/src/lib/format.js +11 -6
- package/src/lib/rpc.js +3 -4
- package/src/lib/wallet.js +44 -2
- package/src/main-publish.js +2 -1
- package/src/main.js +2 -2
- package/src/open.js +6 -6
- package/src/publish.js +3 -1
- package/src/sdk-package-names.js +5 -6
- package/src/set-defaults.js +0 -1
- package/src/start.js +57 -51
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agoric",
|
|
3
|
-
"version": "0.21.2-dev-
|
|
3
|
+
"version": "0.21.2-getting-started-dev-d127d1d.0+d127d1d",
|
|
4
4
|
"description": "Manage the Agoric Javascript smart contract platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/main.js",
|
|
@@ -8,10 +8,6 @@
|
|
|
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
|
-
},
|
|
15
11
|
"files": [
|
|
16
12
|
"src",
|
|
17
13
|
"exported.js"
|
|
@@ -24,48 +20,44 @@
|
|
|
24
20
|
"integration-test": "ava --config .ava-integration-test.config.js",
|
|
25
21
|
"lint-fix": "yarn lint:eslint --fix",
|
|
26
22
|
"lint": "run-s --continue-on-error lint:*",
|
|
27
|
-
"lint:types": "tsc",
|
|
23
|
+
"lint:types": "tsc -p jsconfig.json",
|
|
28
24
|
"lint:eslint": "eslint ."
|
|
29
25
|
},
|
|
30
26
|
"devDependencies": {
|
|
31
|
-
"@agoric/
|
|
32
|
-
"
|
|
33
|
-
"ava": "^5.3.0",
|
|
27
|
+
"@agoric/deploy-script-support": "0.10.4-getting-started-dev-d127d1d.0+d127d1d",
|
|
28
|
+
"ava": "^5.2.0",
|
|
34
29
|
"c8": "^7.13.0",
|
|
35
|
-
"dd-trace": "^
|
|
30
|
+
"dd-trace": "^3.3.0"
|
|
36
31
|
},
|
|
37
32
|
"dependencies": {
|
|
38
|
-
"@agoric/access-token": "0.4.22-dev-
|
|
39
|
-
"@agoric/assert": "0.6.1-dev-
|
|
40
|
-
"@agoric/cache": "0.3.3-dev-
|
|
41
|
-
"@agoric/casting": "0.4.3-dev-
|
|
42
|
-
"@agoric/cosmic-proto": "0.3.1-dev-
|
|
43
|
-
"@agoric/ertp": "0.16.3-dev-
|
|
44
|
-
"@agoric/
|
|
45
|
-
"@agoric/
|
|
46
|
-
"@agoric/
|
|
47
|
-
"@agoric/
|
|
48
|
-
"@agoric/
|
|
49
|
-
"@agoric/
|
|
50
|
-
"@agoric/
|
|
51
|
-
"@agoric/
|
|
52
|
-
"@agoric/zoe": "0.26.3-dev-5dc325b.0+5dc325b",
|
|
53
|
-
"@agoric/zone": "0.2.3-dev-5dc325b.0+5dc325b",
|
|
33
|
+
"@agoric/access-token": "0.4.22-getting-started-dev-d127d1d.0+d127d1d",
|
|
34
|
+
"@agoric/assert": "0.6.1-getting-started-dev-d127d1d.0+d127d1d",
|
|
35
|
+
"@agoric/cache": "0.3.3-getting-started-dev-d127d1d.0+d127d1d",
|
|
36
|
+
"@agoric/casting": "0.4.3-getting-started-dev-d127d1d.0+d127d1d",
|
|
37
|
+
"@agoric/cosmic-proto": "0.3.1-getting-started-dev-d127d1d.0+d127d1d",
|
|
38
|
+
"@agoric/ertp": "0.16.3-getting-started-dev-d127d1d.0+d127d1d",
|
|
39
|
+
"@agoric/inter-protocol": "0.16.2-getting-started-dev-d127d1d.0+d127d1d",
|
|
40
|
+
"@agoric/internal": "0.4.0-getting-started-dev-d127d1d.0+d127d1d",
|
|
41
|
+
"@agoric/smart-wallet": "0.5.4-getting-started-dev-d127d1d.0+d127d1d",
|
|
42
|
+
"@agoric/store": "0.9.3-getting-started-dev-d127d1d.0+d127d1d",
|
|
43
|
+
"@agoric/swingset-vat": "0.32.3-getting-started-dev-d127d1d.0+d127d1d",
|
|
44
|
+
"@agoric/vats": "0.15.2-getting-started-dev-d127d1d.0+d127d1d",
|
|
45
|
+
"@agoric/zoe": "0.26.3-getting-started-dev-d127d1d.0+d127d1d",
|
|
46
|
+
"@agoric/zone": "0.2.3-getting-started-dev-d127d1d.0+d127d1d",
|
|
54
47
|
"@confio/relayer": "^0.9.0",
|
|
55
48
|
"@cosmjs/crypto": "^0.30.1",
|
|
56
49
|
"@cosmjs/encoding": "^0.30.1",
|
|
57
50
|
"@cosmjs/math": "^0.30.1",
|
|
58
51
|
"@cosmjs/proto-signing": "^0.30.1",
|
|
59
52
|
"@cosmjs/stargate": "^0.30.1",
|
|
60
|
-
"@endo/bundle-source": "
|
|
61
|
-
"@endo/captp": "
|
|
62
|
-
"@endo/compartment-mapper": "
|
|
63
|
-
"@endo/far": "
|
|
64
|
-
"@endo/init": "
|
|
65
|
-
"@endo/marshal": "
|
|
66
|
-
"@endo/nat": "
|
|
67
|
-
"@endo/
|
|
68
|
-
"@endo/promise-kit": "^0.2.59",
|
|
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",
|
|
69
61
|
"@iarna/toml": "^2.2.3",
|
|
70
62
|
"anylogger": "^0.21.0",
|
|
71
63
|
"chalk": "^5.2.0",
|
|
@@ -95,8 +87,5 @@
|
|
|
95
87
|
"timeout": "2m",
|
|
96
88
|
"workerThreads": false
|
|
97
89
|
},
|
|
98
|
-
"
|
|
99
|
-
"atLeast": 77.53
|
|
100
|
-
},
|
|
101
|
-
"gitHead": "5dc325b8cc1d94f46ecc18a7c67a14989feade11"
|
|
90
|
+
"gitHead": "d127d1db6a8d22a5c56c6408f69ae753c8215372"
|
|
102
91
|
}
|
package/src/bin-agops.js
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// @ts-check
|
|
3
3
|
// @jessie-check
|
|
4
|
-
/* eslint @typescript-eslint/no-floating-promises: "warn" */
|
|
5
4
|
|
|
5
|
+
/* eslint-disable @jessie.js/no-nested-await */
|
|
6
6
|
/* global fetch, setTimeout */
|
|
7
7
|
|
|
8
|
-
import '@endo/init/pre.js';
|
|
9
|
-
|
|
10
8
|
import '@agoric/casting/node-fetch-shim.js';
|
|
11
9
|
import '@endo/init';
|
|
12
|
-
|
|
13
|
-
import { E } from '@endo/far';
|
|
10
|
+
import '@endo/init/pre.js';
|
|
14
11
|
|
|
15
12
|
import { execFileSync } from 'child_process';
|
|
16
13
|
import path from 'path';
|
|
@@ -18,7 +15,7 @@ import process from 'process';
|
|
|
18
15
|
import anylogger from 'anylogger';
|
|
19
16
|
import { Command, CommanderError, createCommand } from 'commander';
|
|
20
17
|
import { makeOracleCommand } from './commands/oracle.js';
|
|
21
|
-
import {
|
|
18
|
+
import { makeEconomicCommiteeCommand } from './commands/ec.js';
|
|
22
19
|
import { makePsmCommand } from './commands/psm.js';
|
|
23
20
|
import { makeReserveCommand } from './commands/reserve.js';
|
|
24
21
|
import { makeVaultsCommand } from './commands/vaults.js';
|
|
@@ -34,7 +31,7 @@ const program = new Command();
|
|
|
34
31
|
program.name(progname).version('unversioned');
|
|
35
32
|
|
|
36
33
|
program.addCommand(makeOracleCommand(logger));
|
|
37
|
-
program.addCommand(
|
|
34
|
+
program.addCommand(makeEconomicCommiteeCommand(logger));
|
|
38
35
|
program.addCommand(makePerfCommand(logger));
|
|
39
36
|
program.addCommand(makePsmCommand(logger));
|
|
40
37
|
program.addCommand(makeVaultsCommand(logger));
|
|
@@ -77,11 +74,13 @@ program.addCommand(makeAuctionCommand(logger, { ...procIO, fetch }));
|
|
|
77
74
|
program.addCommand(makeInterCommand(procIO, { fetch }));
|
|
78
75
|
program.addCommand(makeTestCommand(procIO, { fetch }));
|
|
79
76
|
|
|
80
|
-
|
|
77
|
+
try {
|
|
78
|
+
await program.parseAsync(process.argv);
|
|
79
|
+
} catch (err) {
|
|
81
80
|
if (err instanceof CommanderError) {
|
|
82
81
|
console.error(err.message);
|
|
83
82
|
} else {
|
|
84
83
|
console.error(err); // CRASH! show stack trace
|
|
85
84
|
}
|
|
86
85
|
process.exit(1);
|
|
87
|
-
}
|
|
86
|
+
}
|
package/src/chain-config.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import djson from 'deterministic-json';
|
|
2
2
|
import TOML from '@iarna/toml';
|
|
3
|
-
import * as Tokens from '@agoric/internal/src/tokens.js';
|
|
4
3
|
|
|
5
4
|
export const STAKING_MAX_VALIDATORS = 150;
|
|
6
5
|
// Required for IBC connections not to time out.
|
|
@@ -14,38 +13,38 @@ export const ICA_HOST_ALLOW_MESSAGES = [
|
|
|
14
13
|
];
|
|
15
14
|
|
|
16
15
|
const Stake = /** @type {const} */ ({
|
|
17
|
-
name:
|
|
16
|
+
name: 'Agoric Staking Token',
|
|
18
17
|
description: 'The token used by delegates to stake on the Agoric chain',
|
|
19
18
|
denom_units: [
|
|
20
19
|
{
|
|
21
|
-
denom:
|
|
20
|
+
denom: 'ubld',
|
|
22
21
|
exponent: 0,
|
|
23
22
|
},
|
|
24
23
|
{
|
|
25
24
|
denom: 'bld',
|
|
26
|
-
exponent:
|
|
25
|
+
exponent: 6,
|
|
27
26
|
},
|
|
28
27
|
],
|
|
29
|
-
base:
|
|
28
|
+
base: 'ubld',
|
|
30
29
|
display: 'bld',
|
|
31
|
-
symbol:
|
|
30
|
+
symbol: 'BLD',
|
|
32
31
|
});
|
|
33
32
|
const Stable = /** @type {const} */ ({
|
|
34
|
-
name:
|
|
33
|
+
name: 'Agoric stable token',
|
|
35
34
|
description: 'The stable token used by the Agoric chain',
|
|
36
35
|
denom_units: [
|
|
37
36
|
{
|
|
38
|
-
denom:
|
|
37
|
+
denom: 'uist',
|
|
39
38
|
exponent: 0,
|
|
40
39
|
},
|
|
41
40
|
{
|
|
42
41
|
denom: 'ist',
|
|
43
|
-
exponent:
|
|
42
|
+
exponent: 6,
|
|
44
43
|
},
|
|
45
44
|
],
|
|
46
|
-
base:
|
|
45
|
+
base: 'uist',
|
|
47
46
|
display: 'ist',
|
|
48
|
-
symbol:
|
|
47
|
+
symbol: 'IST',
|
|
49
48
|
});
|
|
50
49
|
export const DENOM_METADATA = /** @type {const} */ ([Stake, Stable]);
|
|
51
50
|
|
package/src/commands/auction.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable @jessie.js/no-nested-await */
|
|
1
2
|
// @ts-check
|
|
2
3
|
/* eslint-disable func-names */
|
|
3
4
|
import { InvalidArgumentError } from 'commander';
|
|
@@ -7,11 +8,7 @@ import { outputActionAndHint } from '../lib/wallet.js';
|
|
|
7
8
|
const { Fail } = assert;
|
|
8
9
|
|
|
9
10
|
/** @typedef {import('@agoric/governance/src/contractGovernance/typedParamManager.js').ParamTypesMap} ParamTypesMap */
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* @template {ParamStateRecord} M
|
|
13
|
-
* @typedef {import('@agoric/governance/src/contractGovernance/typedParamManager.js').ParamTypesMapFromRecord<M>} ParamTypesMapFromRecord
|
|
14
|
-
*/
|
|
11
|
+
/** @template M @typedef {import('@agoric/governance/src/contractGovernance/typedParamManager.js').ParamTypesMapFromRecord<M>} ParamTypesMapFromRecord */
|
|
15
12
|
|
|
16
13
|
/**
|
|
17
14
|
* @template {ParamTypesMap} M
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable @jessie.js/no-nested-await */
|
|
1
2
|
// @ts-check
|
|
2
3
|
/* eslint-disable func-names */
|
|
3
4
|
/* global globalThis, process, setTimeout */
|
|
@@ -15,13 +16,6 @@ import {
|
|
|
15
16
|
|
|
16
17
|
/** @typedef {import('@agoric/smart-wallet/src/offers.js').OfferSpec} OfferSpec */
|
|
17
18
|
|
|
18
|
-
const collectValues = (val, memo) => {
|
|
19
|
-
memo.push(val);
|
|
20
|
-
return memo;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const defaultKeyring = process.env.AGORIC_KEYRING_BACKEND || 'test';
|
|
24
|
-
|
|
25
19
|
/**
|
|
26
20
|
* @param {import('anylogger').Logger} _logger
|
|
27
21
|
* @param {{
|
|
@@ -33,7 +27,7 @@ const defaultKeyring = process.env.AGORIC_KEYRING_BACKEND || 'test';
|
|
|
33
27
|
* delay?: (ms: number) => Promise<void>,
|
|
34
28
|
* }} [io]
|
|
35
29
|
*/
|
|
36
|
-
export const
|
|
30
|
+
export const makeEconomicCommiteeCommand = (_logger, io = {}) => {
|
|
37
31
|
const {
|
|
38
32
|
// Allow caller to provide access explicitly, but
|
|
39
33
|
// default to conventional ambient IO facilities.
|
|
@@ -45,22 +39,11 @@ export const makeGovCommand = (_logger, io = {}) => {
|
|
|
45
39
|
delay = ms => new Promise(resolve => setTimeout(resolve, ms)),
|
|
46
40
|
} = io;
|
|
47
41
|
|
|
48
|
-
const
|
|
49
|
-
// backwards compatibility with less general "ec" command. To make this work
|
|
50
|
-
// the new CLI options default to the values used for Economic Committee
|
|
51
|
-
cmd.alias('ec');
|
|
52
|
-
cmd.option(
|
|
53
|
-
'--keyring-backend <os|file|test>',
|
|
54
|
-
`keyring's backend (os|file|test) (default "${defaultKeyring}")`,
|
|
55
|
-
defaultKeyring,
|
|
56
|
-
);
|
|
42
|
+
const ec = new Command('ec').description('Economic Committee commands');
|
|
57
43
|
|
|
58
44
|
/** @param {string} literalOrName */
|
|
59
45
|
const normalizeAddress = literalOrName =>
|
|
60
|
-
normalizeAddressWithOptions(literalOrName, {
|
|
61
|
-
// FIXME does not observe keyring-backend option, which isn't available during arg parsing
|
|
62
|
-
keyringBackend: defaultKeyring,
|
|
63
|
-
});
|
|
46
|
+
normalizeAddressWithOptions(literalOrName, { keyringBackend: 'test' });
|
|
64
47
|
|
|
65
48
|
/** @type {(info: unknown, indent?: unknown) => boolean } */
|
|
66
49
|
const show = (info, indent) =>
|
|
@@ -81,21 +64,15 @@ export const makeGovCommand = (_logger, io = {}) => {
|
|
|
81
64
|
* @param {{
|
|
82
65
|
* toOffer: (agoricNames: *, current: import('@agoric/smart-wallet/src/smartWallet').CurrentWalletRecord | undefined) => OfferSpec,
|
|
83
66
|
* sendFrom?: string | undefined,
|
|
84
|
-
* keyringBackend: string,
|
|
85
67
|
* instanceName?: string,
|
|
86
68
|
* }} detail
|
|
87
69
|
* @param {Awaited<ReturnType<makeRpcUtils>>} [optUtils]
|
|
88
70
|
*/
|
|
89
|
-
const processOffer = async function (
|
|
90
|
-
{ toOffer, sendFrom, keyringBackend },
|
|
91
|
-
optUtils,
|
|
92
|
-
) {
|
|
71
|
+
const processOffer = async function ({ toOffer, sendFrom }, optUtils) {
|
|
93
72
|
const networkConfig = await getNetworkConfig(env);
|
|
94
73
|
const utils = await (optUtils || makeRpcUtils({ fetch }));
|
|
95
74
|
const { agoricNames, readLatestHead } = utils;
|
|
96
75
|
|
|
97
|
-
assert(keyringBackend, 'missing keyring-backend option');
|
|
98
|
-
|
|
99
76
|
let current;
|
|
100
77
|
if (sendFrom) {
|
|
101
78
|
current = await getCurrent(sendFrom, { readLatestHead });
|
|
@@ -113,7 +90,7 @@ export const makeGovCommand = (_logger, io = {}) => {
|
|
|
113
90
|
const result = await sendAction(
|
|
114
91
|
{ method: 'executeOffer', offer },
|
|
115
92
|
{
|
|
116
|
-
keyring: { backend:
|
|
93
|
+
keyring: { backend: 'test' }, // XXX
|
|
117
94
|
from: sendFrom,
|
|
118
95
|
verbose: false,
|
|
119
96
|
...networkConfig,
|
|
@@ -150,38 +127,29 @@ export const makeGovCommand = (_logger, io = {}) => {
|
|
|
150
127
|
show(blockInfo);
|
|
151
128
|
};
|
|
152
129
|
|
|
153
|
-
|
|
154
|
-
.
|
|
155
|
-
.description('accept invitation to join a committee')
|
|
156
|
-
.requiredOption(
|
|
157
|
-
'--name <string>',
|
|
158
|
-
'Committee instance name',
|
|
159
|
-
String,
|
|
160
|
-
'economicCommittee',
|
|
161
|
-
)
|
|
130
|
+
ec.command('committee')
|
|
131
|
+
.description('accept invitation to join the economic committee')
|
|
162
132
|
.option('--voter <number>', 'Voter number', Number, 0)
|
|
163
133
|
.option(
|
|
164
134
|
'--offerId <string>',
|
|
165
135
|
'Offer id',
|
|
166
136
|
String,
|
|
167
|
-
`
|
|
137
|
+
`ecCommittee-${Date.now()}`,
|
|
168
138
|
)
|
|
169
139
|
.option(
|
|
170
140
|
'--send-from <name-or-address>',
|
|
171
141
|
'Send from address',
|
|
172
142
|
normalizeAddress,
|
|
173
143
|
)
|
|
174
|
-
.action(async function (opts
|
|
175
|
-
const { name: instanceName } = opts;
|
|
176
|
-
|
|
144
|
+
.action(async function (opts) {
|
|
177
145
|
/** @type {Parameters<typeof processOffer>[0]['toOffer']} */
|
|
178
146
|
const toOffer = (agoricNames, current) => {
|
|
179
|
-
const instance = agoricNames.instance
|
|
180
|
-
assert(instance, `missing
|
|
147
|
+
const instance = agoricNames.instance.economicCommittee;
|
|
148
|
+
assert(instance, `missing economicCommittee`);
|
|
181
149
|
|
|
182
150
|
if (current) {
|
|
183
151
|
const found = findContinuingIds(current, agoricNames);
|
|
184
|
-
abortIfSeen(
|
|
152
|
+
abortIfSeen('economicCommittee', found);
|
|
185
153
|
}
|
|
186
154
|
|
|
187
155
|
return {
|
|
@@ -197,37 +165,28 @@ export const makeGovCommand = (_logger, io = {}) => {
|
|
|
197
165
|
|
|
198
166
|
await processOffer({
|
|
199
167
|
toOffer,
|
|
200
|
-
instanceName,
|
|
201
|
-
|
|
202
|
-
keyringBackend: options.optsWithGlobals().keyringBackend,
|
|
168
|
+
instanceName: 'economicCommittee',
|
|
169
|
+
...opts,
|
|
203
170
|
});
|
|
204
171
|
});
|
|
205
172
|
|
|
206
|
-
|
|
207
|
-
.command('charter')
|
|
173
|
+
ec.command('charter')
|
|
208
174
|
.description('accept the charter invitation')
|
|
209
|
-
.
|
|
210
|
-
'--name <string>',
|
|
211
|
-
'Charter instance name',
|
|
212
|
-
'economicCommitteeCharter',
|
|
213
|
-
)
|
|
214
|
-
.option('--offerId <string>', 'Offer id', String, `charter-${Date.now()}`)
|
|
175
|
+
.option('--offerId <string>', 'Offer id', String, `ecCharter-${Date.now()}`)
|
|
215
176
|
.option(
|
|
216
177
|
'--send-from <name-or-address>',
|
|
217
178
|
'Send from address',
|
|
218
179
|
normalizeAddress,
|
|
219
180
|
)
|
|
220
|
-
.action(async function (opts
|
|
221
|
-
const { name: instanceName } = opts;
|
|
222
|
-
|
|
181
|
+
.action(async function (opts) {
|
|
223
182
|
/** @type {Parameters<typeof processOffer>[0]['toOffer']} */
|
|
224
183
|
const toOffer = (agoricNames, current) => {
|
|
225
|
-
const instance = agoricNames.instance
|
|
226
|
-
assert(instance, `missing
|
|
184
|
+
const instance = agoricNames.instance.econCommitteeCharter;
|
|
185
|
+
assert(instance, `missing econCommitteeCharter`);
|
|
227
186
|
|
|
228
187
|
if (current) {
|
|
229
188
|
const found = findContinuingIds(current, agoricNames);
|
|
230
|
-
abortIfSeen(
|
|
189
|
+
abortIfSeen('econCommitteeCharter', found);
|
|
231
190
|
}
|
|
232
191
|
|
|
233
192
|
return {
|
|
@@ -243,14 +202,12 @@ export const makeGovCommand = (_logger, io = {}) => {
|
|
|
243
202
|
|
|
244
203
|
await processOffer({
|
|
245
204
|
toOffer,
|
|
246
|
-
instanceName,
|
|
247
|
-
|
|
248
|
-
keyringBackend: options.optsWithGlobals().keyringBackend,
|
|
205
|
+
instanceName: 'econCommitteeCharter',
|
|
206
|
+
...opts,
|
|
249
207
|
});
|
|
250
208
|
});
|
|
251
209
|
|
|
252
|
-
|
|
253
|
-
.command('find-continuing-id')
|
|
210
|
+
ec.command('find-continuing-id')
|
|
254
211
|
.description('print id of specified voting continuing invitation')
|
|
255
212
|
.requiredOption(
|
|
256
213
|
'--from <name-or-address>',
|
|
@@ -276,8 +233,7 @@ export const makeGovCommand = (_logger, io = {}) => {
|
|
|
276
233
|
console.log(match.offerId);
|
|
277
234
|
});
|
|
278
235
|
|
|
279
|
-
|
|
280
|
-
.command('find-continuing-ids')
|
|
236
|
+
ec.command('find-continuing-ids')
|
|
281
237
|
.description('print records of voting continuing invitations')
|
|
282
238
|
.requiredOption(
|
|
283
239
|
'--from <name-or-address>',
|
|
@@ -289,27 +245,12 @@ export const makeGovCommand = (_logger, io = {}) => {
|
|
|
289
245
|
const current = await getCurrent(opts.from, { readLatestHead });
|
|
290
246
|
|
|
291
247
|
const found = findContinuingIds(current, agoricNames);
|
|
292
|
-
|
|
293
|
-
show({ ...it, address: opts.from });
|
|
294
|
-
}
|
|
248
|
+
found.forEach(it => show({ ...it, address: opts.from }));
|
|
295
249
|
});
|
|
296
250
|
|
|
297
|
-
|
|
298
|
-
.
|
|
299
|
-
.
|
|
300
|
-
.requiredOption(
|
|
301
|
-
'--instance <string>',
|
|
302
|
-
'Committee name under agoricNames.instances',
|
|
303
|
-
String,
|
|
304
|
-
'economicCommittee',
|
|
305
|
-
)
|
|
306
|
-
.requiredOption(
|
|
307
|
-
'--pathname <string>',
|
|
308
|
-
'Committee name under published.committees',
|
|
309
|
-
String,
|
|
310
|
-
'Economic_Committee',
|
|
311
|
-
)
|
|
312
|
-
.option('--offerId <number>', 'Offer id', String, `gov-vote-${Date.now()}`)
|
|
251
|
+
ec.command('vote')
|
|
252
|
+
.description('vote on a question (hard-coded for now))')
|
|
253
|
+
.option('--offerId <number>', 'Offer id', String, `ecVote-${Date.now()}`)
|
|
313
254
|
.requiredOption(
|
|
314
255
|
'--forPosition <number>',
|
|
315
256
|
'index of one position to vote for (within the question description.positions); ',
|
|
@@ -320,18 +261,17 @@ export const makeGovCommand = (_logger, io = {}) => {
|
|
|
320
261
|
'Send from address',
|
|
321
262
|
normalizeAddress,
|
|
322
263
|
)
|
|
323
|
-
.action(async function (opts
|
|
264
|
+
.action(async function (opts) {
|
|
324
265
|
const utils = await makeRpcUtils({ fetch });
|
|
325
266
|
const { readLatestHead } = utils;
|
|
326
267
|
|
|
327
268
|
const info = await readLatestHead(
|
|
328
|
-
|
|
269
|
+
'published.committees.Economic_Committee.latestQuestion',
|
|
329
270
|
).catch(err => {
|
|
330
271
|
throw new CommanderError(1, 'VSTORAGE_FAILURE', err.message);
|
|
331
272
|
});
|
|
332
|
-
|
|
333
273
|
// XXX runtime shape-check
|
|
334
|
-
const questionDesc = /** @type {
|
|
274
|
+
const questionDesc = /** @type {any} */ (info);
|
|
335
275
|
|
|
336
276
|
// TODO support multiple position arguments
|
|
337
277
|
const chosenPositions = [questionDesc.positions[opts.forPosition]];
|
|
@@ -340,7 +280,9 @@ export const makeGovCommand = (_logger, io = {}) => {
|
|
|
340
280
|
/** @type {Parameters<typeof processOffer>[0]['toOffer']} */
|
|
341
281
|
const toOffer = (agoricNames, current) => {
|
|
342
282
|
const cont = current ? findContinuingIds(current, agoricNames) : [];
|
|
343
|
-
const votingRight = cont.find(
|
|
283
|
+
const votingRight = cont.find(
|
|
284
|
+
it => it.instance === agoricNames.instance.economicCommittee,
|
|
285
|
+
);
|
|
344
286
|
if (!votingRight) {
|
|
345
287
|
console.debug('continuing ids', cont, 'for', current);
|
|
346
288
|
throw new CommanderError(
|
|
@@ -365,89 +307,8 @@ export const makeGovCommand = (_logger, io = {}) => {
|
|
|
365
307
|
};
|
|
366
308
|
};
|
|
367
309
|
|
|
368
|
-
await processOffer(
|
|
369
|
-
{
|
|
370
|
-
toOffer,
|
|
371
|
-
sendFrom: opts.sendFrom,
|
|
372
|
-
keyringBackend: options.optsWithGlobals().keyringBackend,
|
|
373
|
-
},
|
|
374
|
-
utils,
|
|
375
|
-
);
|
|
376
|
-
});
|
|
377
|
-
|
|
378
|
-
cmd
|
|
379
|
-
.command('proposePauseOffers')
|
|
380
|
-
.description('propose a vote to pause offers')
|
|
381
|
-
.option(
|
|
382
|
-
'--send-from <name-or-address>',
|
|
383
|
-
'Send from address',
|
|
384
|
-
normalizeAddress,
|
|
385
|
-
)
|
|
386
|
-
.option(
|
|
387
|
-
'--offerId <string>',
|
|
388
|
-
'Offer id',
|
|
389
|
-
String,
|
|
390
|
-
`proposePauseOffers-${Date.now()}`,
|
|
391
|
-
)
|
|
392
|
-
.requiredOption(
|
|
393
|
-
'--instance <string>',
|
|
394
|
-
'name of governed instance in agoricNames',
|
|
395
|
-
)
|
|
396
|
-
.requiredOption(
|
|
397
|
-
'--substring <string>',
|
|
398
|
-
'an offer string to pause (can be repeated)',
|
|
399
|
-
collectValues,
|
|
400
|
-
[],
|
|
401
|
-
)
|
|
402
|
-
.option(
|
|
403
|
-
'--deadline <minutes>',
|
|
404
|
-
'minutes from now to close the vote',
|
|
405
|
-
Number,
|
|
406
|
-
1,
|
|
407
|
-
)
|
|
408
|
-
.action(async function (opts, options) {
|
|
409
|
-
const { instance: instanceName } = opts;
|
|
410
|
-
|
|
411
|
-
/** @type {Parameters<typeof processOffer>[0]['toOffer']} */
|
|
412
|
-
const toOffer = (agoricNames, current) => {
|
|
413
|
-
const instance = agoricNames.instance[instanceName];
|
|
414
|
-
assert(instance, `missing ${instanceName}`);
|
|
415
|
-
assert(current, 'missing current wallet');
|
|
416
|
-
|
|
417
|
-
const known = findContinuingIds(current, agoricNames);
|
|
418
|
-
|
|
419
|
-
assert(known, 'could not find committee acceptance offer id');
|
|
420
|
-
|
|
421
|
-
// TODO magic string
|
|
422
|
-
const match = known.find(
|
|
423
|
-
r => r.description === 'charter member invitation',
|
|
424
|
-
);
|
|
425
|
-
assert(match, 'no offer found for charter member invitation');
|
|
426
|
-
|
|
427
|
-
return {
|
|
428
|
-
id: opts.offerId,
|
|
429
|
-
invitationSpec: {
|
|
430
|
-
source: 'continuing',
|
|
431
|
-
previousOffer: match.offerId,
|
|
432
|
-
invitationMakerName: 'VoteOnPauseOffers',
|
|
433
|
-
// ( instance, strings list, timer deadline seconds )
|
|
434
|
-
invitationArgs: harden([
|
|
435
|
-
instance,
|
|
436
|
-
opts.substring,
|
|
437
|
-
BigInt(opts.deadline * 60 + Math.round(Date.now() / 1000)),
|
|
438
|
-
]),
|
|
439
|
-
},
|
|
440
|
-
proposal: {},
|
|
441
|
-
};
|
|
442
|
-
};
|
|
443
|
-
|
|
444
|
-
await processOffer({
|
|
445
|
-
toOffer,
|
|
446
|
-
instanceName,
|
|
447
|
-
sendFrom: opts.sendFrom,
|
|
448
|
-
keyringBackend: options.optsWithGlobals().keyringBackend,
|
|
449
|
-
});
|
|
310
|
+
await processOffer({ toOffer, sendFrom: opts.sendFrom }, utils);
|
|
450
311
|
});
|
|
451
312
|
|
|
452
|
-
return
|
|
313
|
+
return ec;
|
|
453
314
|
};
|