@agoric/vats 0.16.0-upgrade-19-dev-0754752.0 → 0.16.0-upgrade-18a-dev-4ee0508.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 +57 -8
- package/package.json +28 -28
- package/src/centralSupply.d.ts +2 -2
- package/src/core/boot-chain.d.ts +1 -1
- package/src/core/boot-chain.d.ts.map +1 -1
- package/src/core/chain-behaviors.d.ts.map +1 -1
- package/src/core/chain-behaviors.js +1 -6
- package/src/core/lib-boot.d.ts +1 -2
- package/src/core/lib-boot.d.ts.map +1 -1
- package/src/core/lib-boot.js +1 -5
- package/src/core/startWalletFactory.d.ts +4 -5
- package/src/core/startWalletFactory.d.ts.map +1 -1
- package/src/core/startWalletFactory.js +1 -5
- package/src/core/types-ambient.d.ts +2 -2
- package/src/core/utils.d.ts +1 -1
- package/src/core/utils.d.ts.map +1 -1
- package/src/localchain.d.ts +1 -41
- package/src/localchain.d.ts.map +1 -1
- package/src/localchain.js +2 -2
- package/src/proposals/kread-proposal.d.ts +1 -1
- package/src/proposals/kread-proposal.d.ts.map +1 -1
- package/src/proposals/localchain-proposal.d.ts +10 -3
- package/src/proposals/localchain-proposal.d.ts.map +1 -1
- package/src/proposals/localchain-test.d.ts +1 -1
- package/src/proposals/localchain-test.d.ts.map +1 -1
- package/src/proposals/network-proposal.d.ts +1 -1
- package/src/proposals/network-proposal.d.ts.map +1 -1
- package/src/proposals/probeZcfBundle.d.ts +1 -1
- package/src/proposals/probeZcfBundle.d.ts.map +1 -1
- package/src/proposals/restart-vats-proposal.d.ts +1 -1
- package/src/proposals/restart-vats-proposal.d.ts.map +1 -1
- package/src/proposals/testUpgradedBoard.d.ts +1 -1
- package/src/proposals/testUpgradedBoard.d.ts.map +1 -1
- package/src/proposals/transfer-proposal.d.ts +1 -1
- package/src/proposals/transfer-proposal.d.ts.map +1 -1
- package/src/proposals/transfer-proposal.js +1 -5
- package/src/proposals/upgrade-agoricNames-proposal.d.ts +1 -1
- package/src/proposals/upgrade-agoricNames-proposal.d.ts.map +1 -1
- package/src/proposals/upgrade-asset-reserve-proposal.d.ts +2 -7
- package/src/proposals/upgrade-asset-reserve-proposal.d.ts.map +1 -1
- package/src/proposals/upgrade-asset-reserve-proposal.js +1 -2
- package/src/proposals/upgrade-bank-proposal.d.ts +1 -1
- package/src/proposals/upgrade-bank-proposal.d.ts.map +1 -1
- package/src/proposals/upgrade-board-proposal.d.ts +1 -1
- package/src/proposals/upgrade-board-proposal.d.ts.map +1 -1
- package/src/proposals/upgrade-mintHolder-proposal.d.ts +2 -7
- package/src/proposals/upgrade-mintHolder-proposal.d.ts.map +1 -1
- package/src/proposals/upgrade-mintHolder-proposal.js +1 -2
- package/src/proposals/upgrade-paRegistry-proposal.d.ts +1 -1
- package/src/proposals/upgrade-paRegistry-proposal.d.ts.map +1 -1
- package/src/proposals/upgrade-provisionPool-proposal.d.ts +3 -8
- package/src/proposals/upgrade-provisionPool-proposal.d.ts.map +1 -1
- package/src/proposals/upgrade-provisionPool-proposal.js +2 -15
- package/src/proposals/upgrade-vats-generic-proposal.d.ts +1 -1
- package/src/proposals/upgrade-vats-generic-proposal.d.ts.map +1 -1
- package/src/proposals/upgrade-vaultFactory-proposal.d.ts +1 -1
- package/src/proposals/upgrade-vaultFactory-proposal.d.ts.map +1 -1
- package/src/proposals/upgrade-zoe-proposal.d.ts +1 -1
- package/src/proposals/upgrade-zoe-proposal.d.ts.map +1 -1
- package/src/proposals/vtransfer-echoer.d.ts +1 -1
- package/src/proposals/vtransfer-echoer.d.ts.map +1 -1
- package/src/proposals/zcf-only-proposal.d.ts +2 -2
- package/src/proposals/zcf-only-proposal.d.ts.map +1 -1
- package/src/proposals/zcf-proposal.d.ts +1 -1
- package/src/proposals/zcf-proposal.d.ts.map +1 -1
- package/src/types.d.ts +3 -10
- package/src/types.d.ts.map +1 -1
- package/src/types.ts +3 -10
- package/src/vat-bank.d.ts +26 -6
- package/src/vat-bank.d.ts.map +1 -1
- package/src/vat-bank.js +8 -13
- package/src/vat-mints.d.ts +6 -6
- package/tools/bank-utils.d.ts.map +1 -1
- package/src/proposals/upgrade-psm-proposal.d.ts +0 -33
- package/src/proposals/upgrade-psm-proposal.d.ts.map +0 -1
- package/src/proposals/upgrade-psm-proposal.js +0 -75
package/src/vat-bank.js
CHANGED
|
@@ -3,7 +3,7 @@ import { E, Far } from '@endo/far';
|
|
|
3
3
|
import { M, getInterfaceGuardPayload } from '@endo/patterns';
|
|
4
4
|
|
|
5
5
|
import { AmountMath, AssetKind, BrandShape } from '@agoric/ertp';
|
|
6
|
-
import { deeplyFulfilledObject
|
|
6
|
+
import { deeplyFulfilledObject } from '@agoric/internal';
|
|
7
7
|
import { prepareGuardedAttenuator } from '@agoric/internal/src/callback.js';
|
|
8
8
|
import {
|
|
9
9
|
IterableEachTopicI,
|
|
@@ -23,8 +23,8 @@ import {
|
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* @import {Guarded} from '@endo/exo';
|
|
26
|
-
* @import {RemotableObject} from '@endo/pass-style';
|
|
27
|
-
* @import {
|
|
26
|
+
* @import {Passable, RemotableObject} from '@endo/pass-style';
|
|
27
|
+
* @import {VirtualPurseController} from './virtual-purse.js';
|
|
28
28
|
*/
|
|
29
29
|
|
|
30
30
|
const { VirtualPurseControllerI } = makeVirtualPurseKitIKit();
|
|
@@ -42,12 +42,12 @@ const BridgeChannelI = M.interface('BridgeChannel', {
|
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
44
|
* @typedef {Guarded<{
|
|
45
|
-
* update: (value: string, nonce?:
|
|
45
|
+
* update: (value: string, nonce?: string) => void;
|
|
46
46
|
* }>} BalanceUpdater
|
|
47
47
|
*/
|
|
48
48
|
|
|
49
49
|
const BalanceUpdaterI = M.interface('BalanceUpdater', {
|
|
50
|
-
update: M.call(M.string()).optional(
|
|
50
|
+
update: M.call(M.string()).optional(M.string()).returns(),
|
|
51
51
|
});
|
|
52
52
|
|
|
53
53
|
/**
|
|
@@ -71,10 +71,6 @@ const prepareBalanceUpdater = zone =>
|
|
|
71
71
|
lastBalanceUpdate: -1n,
|
|
72
72
|
}),
|
|
73
73
|
{
|
|
74
|
-
/**
|
|
75
|
-
* @param {string} value
|
|
76
|
-
* @param {BridgeBigInt} [nonce]
|
|
77
|
-
*/
|
|
78
74
|
update(value, nonce = undefined) {
|
|
79
75
|
if (nonce !== undefined) {
|
|
80
76
|
const thisBalanceUpdate = BigInt(nonce);
|
|
@@ -190,13 +186,12 @@ const prepareBankChannelHandler = zone =>
|
|
|
190
186
|
/** @param {MapStore<string, MapStore<string, BalanceUpdater>>} denomToAddressUpdater */
|
|
191
187
|
denomToAddressUpdater => ({ denomToAddressUpdater }),
|
|
192
188
|
{
|
|
193
|
-
/** @param {BridgeMessage} obj */
|
|
194
189
|
async fromBridge(obj) {
|
|
195
|
-
switch (obj
|
|
190
|
+
switch (obj && obj.type) {
|
|
196
191
|
case 'VBANK_BALANCE_UPDATE': {
|
|
197
192
|
const { denomToAddressUpdater } = this.state;
|
|
198
193
|
for (const update of obj.updated) {
|
|
199
|
-
const { address, denom, amount } = update;
|
|
194
|
+
const { address, denom, amount: value, nonce } = update;
|
|
200
195
|
/** @type {BalanceUpdater | undefined} */
|
|
201
196
|
let updater;
|
|
202
197
|
try {
|
|
@@ -209,7 +204,7 @@ const prepareBankChannelHandler = zone =>
|
|
|
209
204
|
}
|
|
210
205
|
if (updater) {
|
|
211
206
|
try {
|
|
212
|
-
updater.update(
|
|
207
|
+
updater.update(value, nonce);
|
|
213
208
|
} catch (e) {
|
|
214
209
|
// ??? Is this an invariant that should complain louder?
|
|
215
210
|
|
package/src/vat-mints.d.ts
CHANGED
|
@@ -17,10 +17,10 @@ export function buildRootObject(): {
|
|
|
17
17
|
* @param {any} issuerNameSingular For example, 'moola', or 'simolean'
|
|
18
18
|
* @param {[AssetKind?, DisplayInfo?]} issuerArgs
|
|
19
19
|
*/
|
|
20
|
-
makeMintAndIssuer: (issuerNameSingular: any, issuerArgs_0?: globalThis.AssetKind | undefined, issuerArgs_1?: globalThis.DisplayInfo | undefined) => globalThis.Issuer<"copySet" | "set" | "nat" | "copyBag",
|
|
20
|
+
makeMintAndIssuer: (issuerNameSingular: any, issuerArgs_0?: globalThis.AssetKind | undefined, issuerArgs_1?: globalThis.DisplayInfo | undefined) => globalThis.Issuer<"copySet" | "set" | "nat" | "copyBag", any>;
|
|
21
21
|
provideIssuerKit: (issuerName: any, ...issuerArgs: any[]) => {
|
|
22
|
-
mint: globalThis.Mint<any,
|
|
23
|
-
issuer: globalThis.Issuer<any,
|
|
22
|
+
mint: globalThis.Mint<any, any>;
|
|
23
|
+
issuer: globalThis.Issuer<any, any>;
|
|
24
24
|
brand: globalThis.Brand<any>;
|
|
25
25
|
};
|
|
26
26
|
/**
|
|
@@ -52,10 +52,10 @@ export function buildRootObject(): {
|
|
|
52
52
|
* @param {any} issuerNameSingular For example, 'moola', or 'simolean'
|
|
53
53
|
* @param {[AssetKind?, DisplayInfo?]} issuerArgs
|
|
54
54
|
*/
|
|
55
|
-
makeMintAndIssuer: (issuerNameSingular: any, issuerArgs_0?: globalThis.AssetKind | undefined, issuerArgs_1?: globalThis.DisplayInfo | undefined) => globalThis.Issuer<"copySet" | "set" | "nat" | "copyBag",
|
|
55
|
+
makeMintAndIssuer: (issuerNameSingular: any, issuerArgs_0?: globalThis.AssetKind | undefined, issuerArgs_1?: globalThis.DisplayInfo | undefined) => globalThis.Issuer<"copySet" | "set" | "nat" | "copyBag", any>;
|
|
56
56
|
provideIssuerKit: (issuerName: any, ...issuerArgs: any[]) => {
|
|
57
|
-
mint: globalThis.Mint<any,
|
|
58
|
-
issuer: globalThis.Issuer<any,
|
|
57
|
+
mint: globalThis.Mint<any, any>;
|
|
58
|
+
issuer: globalThis.Issuer<any, any>;
|
|
59
59
|
brand: globalThis.Brand<any>;
|
|
60
60
|
};
|
|
61
61
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bank-utils.d.ts","sourceRoot":"","sources":["bank-utils.js"],"names":[],"mappings":"AAYO,4CAFI,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC,EAAE;sBA4B1C,MAAM,cACN,MAAM,gBACN,MAAM,OACN,OAAO,oBAAoB,EAAE,cAAc;;;EAqBvD;AAOM,8CAHJ;IAAmD,QAAQ;IAC3B,UAAU,kBAAzB,OAAO;CAC1B;;;
|
|
1
|
+
{"version":3,"file":"bank-utils.d.ts","sourceRoot":"","sources":["bank-utils.js"],"names":[],"mappings":"AAYO,4CAFI,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC,EAAE;sBA4B1C,MAAM,cACN,MAAM,gBACN,MAAM,OACN,OAAO,oBAAoB,EAAE,cAAc;;;EAqBvD;AAOM,8CAHJ;IAAmD,QAAQ;IAC3B,UAAU,kBAAzB,OAAO;CAC1B;;;6FAyB87gB,WAAW,eAA6B,cAA2B;;;mBAAo8C,CAAC;;;;0BAX17jB,MAAM,CAAC,KAAK,CAAC,KACX,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;GASrC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
export function upgradePSMProposal({ consume: { psmKit: psmKitP, economicCommitteeCreatorFacet: electorateCreatorFacet, instancePrivateArgs: instancePrivateArgsP, }, }: BootstrapPowers & {
|
|
2
|
-
consume: {
|
|
3
|
-
economicCommitteeCreatorFacet: any;
|
|
4
|
-
psmKit: any;
|
|
5
|
-
};
|
|
6
|
-
}, options: {
|
|
7
|
-
options: {
|
|
8
|
-
psmRef: VatSourceRef;
|
|
9
|
-
};
|
|
10
|
-
}): Promise<void>;
|
|
11
|
-
export function getManifestForUpgradingPSM({ restoreRef }: {
|
|
12
|
-
restoreRef: any;
|
|
13
|
-
}, { psmRef }: {
|
|
14
|
-
psmRef: any;
|
|
15
|
-
}): {
|
|
16
|
-
manifest: {
|
|
17
|
-
[upgradePSMProposal.name]: {
|
|
18
|
-
consume: {
|
|
19
|
-
psmKit: boolean;
|
|
20
|
-
economicCommitteeCreatorFacet: boolean;
|
|
21
|
-
instancePrivateArgs: boolean;
|
|
22
|
-
};
|
|
23
|
-
produce: {};
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
options: {
|
|
27
|
-
psmRef: any;
|
|
28
|
-
};
|
|
29
|
-
installations: {
|
|
30
|
-
psm: any;
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
//# sourceMappingURL=upgrade-psm-proposal.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"upgrade-psm-proposal.d.ts","sourceRoot":"","sources":["upgrade-psm-proposal.js"],"names":[],"mappings":"AAkBO,yKAXI,eAAe,GAAG;IACxB,OAAO,EAAE;QACP,6BAA6B,EAAE,GAAG,CAAC;QACnC,MAAM,EAAE,GAAG,CAAC;KACb,CAAC;CACH,WAED;IAEW,OAAO,EAFV;QACN,MAAM,EAAE,YAAY,CAAC;KACtB;CACH,iBA0CA;AAEM;;;;;;QAEH,CAAC,kBAAkB,CAAC,IAAI,CAAC;;;;;;;UAOxB;;;;;;;;EAIH"}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { E } from '@endo/far';
|
|
2
|
-
import { deeplyFulfilled } from '@endo/marshal';
|
|
3
|
-
import { makeTracer } from '@agoric/internal';
|
|
4
|
-
|
|
5
|
-
const trace = makeTracer('UpgradePSM');
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @param {BootstrapPowers & {
|
|
9
|
-
* consume: {
|
|
10
|
-
* economicCommitteeCreatorFacet: any;
|
|
11
|
-
* psmKit: any;
|
|
12
|
-
* };
|
|
13
|
-
* }} powers
|
|
14
|
-
* @param {object} options
|
|
15
|
-
* @param {{
|
|
16
|
-
* psmRef: VatSourceRef;
|
|
17
|
-
* }} options.options
|
|
18
|
-
*/
|
|
19
|
-
export const upgradePSMProposal = async (
|
|
20
|
-
{
|
|
21
|
-
consume: {
|
|
22
|
-
psmKit: psmKitP,
|
|
23
|
-
economicCommitteeCreatorFacet: electorateCreatorFacet,
|
|
24
|
-
instancePrivateArgs: instancePrivateArgsP,
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
options,
|
|
28
|
-
) => {
|
|
29
|
-
const { psmRef } = options.options;
|
|
30
|
-
|
|
31
|
-
trace(`PSM BUNDLE ID: `, psmRef);
|
|
32
|
-
|
|
33
|
-
const [psmKitMap, instancePrivateArgs] = await Promise.all([
|
|
34
|
-
psmKitP,
|
|
35
|
-
instancePrivateArgsP,
|
|
36
|
-
]);
|
|
37
|
-
|
|
38
|
-
for (const { psm, psmAdminFacet, label } of psmKitMap.values()) {
|
|
39
|
-
const [originalPrivateArgs, poserInvitation] = await Promise.all([
|
|
40
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
41
|
-
// @ts-ignore Local tsc sees this as an error but typedoc does not
|
|
42
|
-
deeplyFulfilled(instancePrivateArgs.get(psm)),
|
|
43
|
-
E(electorateCreatorFacet).getPoserInvitation(),
|
|
44
|
-
]);
|
|
45
|
-
|
|
46
|
-
const newPrivateArgs = harden({
|
|
47
|
-
...originalPrivateArgs,
|
|
48
|
-
initialPoserInvitation: poserInvitation,
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
const upgradeResult = await E(psmAdminFacet).upgradeContract(
|
|
52
|
-
psmRef.bundleID,
|
|
53
|
-
newPrivateArgs,
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
trace(`PSM ${label} upgraded: `, upgradeResult);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
trace('Done.');
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export const getManifestForUpgradingPSM = ({ restoreRef }, { psmRef }) => ({
|
|
63
|
-
manifest: {
|
|
64
|
-
[upgradePSMProposal.name]: {
|
|
65
|
-
consume: {
|
|
66
|
-
psmKit: true,
|
|
67
|
-
economicCommitteeCreatorFacet: true,
|
|
68
|
-
instancePrivateArgs: true,
|
|
69
|
-
},
|
|
70
|
-
produce: {},
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
options: { psmRef },
|
|
74
|
-
installations: { psm: restoreRef(psmRef) },
|
|
75
|
-
});
|