@agoric/zoe 0.27.0-upgrade-19-devnet-dev-5428c4d.0 → 0.27.0-upgrade-21-dev-16519b2.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/bundles/bundle-contractFacet-js-meta.json +305 -305
- package/bundles/bundle-contractFacet.js +1 -1
- package/package.json +36 -35
- package/src/cleanProposal.d.ts +2 -0
- package/src/cleanProposal.d.ts.map +1 -1
- package/src/cleanProposal.js +4 -2
- package/src/contractFacet/exit.d.ts +1 -1
- package/src/contractFacet/exit.d.ts.map +1 -1
- package/src/contractFacet/offerHandlerStorage.d.ts +1 -1
- package/src/contractFacet/rightsConservation.d.ts.map +1 -1
- package/src/contractFacet/rightsConservation.js +0 -1
- package/src/contractFacet/types.d.ts +184 -0
- package/src/contractFacet/types.d.ts.map +1 -0
- package/src/contractFacet/{types-ambient.d.ts → types.ts} +66 -29
- package/src/contractFacet/vatRoot.d.ts +9 -3
- package/src/contractFacet/vatRoot.d.ts.map +1 -1
- package/src/contractFacet/vatRoot.js +5 -4
- package/src/contractFacet/zcfMint.d.ts +3 -2
- package/src/contractFacet/zcfMint.d.ts.map +1 -1
- package/src/contractFacet/zcfMint.js +7 -7
- package/src/contractFacet/zcfSeat.d.ts +3 -1
- package/src/contractFacet/zcfSeat.d.ts.map +1 -1
- package/src/contractFacet/zcfSeat.js +6 -4
- package/src/contractFacet/zcfZygote.d.ts +8 -1
- package/src/contractFacet/zcfZygote.d.ts.map +1 -1
- package/src/contractFacet/zcfZygote.js +20 -8
- package/src/contractSupport/atomicTransfer.d.ts +6 -0
- package/src/contractSupport/atomicTransfer.d.ts.map +1 -1
- package/src/contractSupport/atomicTransfer.js +4 -0
- package/src/contractSupport/bondingCurves.js +1 -1
- package/src/contractSupport/index.d.ts +2 -2
- package/src/contractSupport/index.js +2 -19
- package/src/contractSupport/prepare-ownable.d.ts +1 -1
- package/src/contractSupport/prepare-ownable.d.ts.map +1 -1
- package/src/contractSupport/prepare-ownable.js +5 -1
- package/src/contractSupport/priceAuthorityInitial.d.ts +2 -0
- package/src/contractSupport/priceAuthorityInitial.d.ts.map +1 -1
- package/src/contractSupport/priceAuthorityInitial.js +3 -1
- package/src/contractSupport/types-ambient.d.ts.map +1 -1
- package/src/contractSupport/types-ambient.js +1 -0
- package/src/contractSupport/zoeHelpers.d.ts +6 -1
- package/src/contractSupport/zoeHelpers.d.ts.map +1 -1
- package/src/contractSupport/zoeHelpers.js +1 -0
- package/src/contracts/atomicSwap.d.ts +1 -1
- package/src/contracts/auction/index.d.ts +5 -5
- package/src/contracts/automaticRefund.d.ts +4 -4
- package/src/contracts/autoswap.d.ts +4 -0
- package/src/contracts/autoswap.d.ts.map +1 -1
- package/src/contracts/autoswap.js +4 -0
- package/src/contracts/barterExchange.d.ts +3 -3
- package/src/contracts/callSpread/fundedCallSpread.d.ts +1 -1
- package/src/contracts/callSpread/pricedCallSpread.d.ts +5 -5
- package/src/contracts/coveredCall-durable.d.ts +1 -1
- package/src/contracts/coveredCall.d.ts +1 -1
- package/src/contracts/loan/index.d.ts +1 -1
- package/src/contracts/loan/liquidate.d.ts.map +1 -1
- package/src/contracts/loan/liquidate.js +5 -1
- package/src/contracts/loan/types-ambient.d.ts +13 -13
- package/src/contracts/loan/types-ambient.d.ts.map +1 -1
- package/src/contracts/loan/types-ambient.js +17 -17
- package/src/contracts/mintPayments.d.ts +4 -4
- package/src/contracts/oracle.d.ts +5 -2
- package/src/contracts/oracle.d.ts.map +1 -1
- package/src/contracts/oracle.js +1 -0
- package/src/contracts/otcDesk.d.ts +1 -1
- package/src/contracts/priceAggregator.d.ts +4 -2
- package/src/contracts/priceAggregator.d.ts.map +1 -1
- package/src/contracts/priceAggregator.js +10 -8
- package/src/contracts/scaledPriceAuthority.d.ts +1 -0
- package/src/contracts/scaledPriceAuthority.d.ts.map +1 -1
- package/src/contracts/scaledPriceAuthority.js +1 -0
- package/src/contracts/sellItems.d.ts +1 -1
- package/src/contracts/simpleExchange.d.ts +6 -1
- package/src/contracts/simpleExchange.d.ts.map +1 -1
- package/src/contracts/simpleExchange.js +4 -0
- package/src/contracts/types-ambient.d.ts +7 -7
- package/src/contracts/types-ambient.d.ts.map +1 -1
- package/src/contracts/types-ambient.js +7 -7
- package/src/contracts/valueVow.contract.d.ts +5 -2
- package/src/contracts/valueVow.contract.d.ts.map +1 -1
- package/src/contracts/valueVow.contract.js +1 -0
- package/src/instanceRecordStorage.d.ts +3 -1
- package/src/instanceRecordStorage.d.ts.map +1 -1
- package/src/instanceRecordStorage.js +9 -2
- package/src/internal-types.d.ts +25 -10
- package/src/internal-types.d.ts.map +1 -1
- package/src/internal-types.js +21 -11
- package/src/issuerRecord.d.ts +3 -2
- package/src/issuerRecord.d.ts.map +1 -1
- package/src/issuerRecord.js +6 -2
- package/src/issuerStorage.d.ts +3 -2
- package/src/issuerStorage.d.ts.map +1 -1
- package/src/issuerStorage.js +6 -5
- package/src/typeGuards.d.ts +10 -6
- package/src/typeGuards.d.ts.map +1 -1
- package/src/typeGuards.js +7 -5
- package/src/types-ambient.d.ts +0 -40
- package/src/types-ambient.d.ts.map +1 -1
- package/src/types-ambient.js +4 -42
- package/src/types-index.d.ts +4 -0
- package/src/types-index.js +2 -0
- package/src/types.d.ts +29 -0
- package/src/types.d.ts.map +1 -0
- package/src/types.ts +37 -0
- package/src/zoeService/escrowStorage.d.ts.map +1 -1
- package/src/zoeService/escrowStorage.js +1 -2
- package/src/zoeService/feeMint.d.ts +6 -3
- package/src/zoeService/feeMint.d.ts.map +1 -1
- package/src/zoeService/feeMint.js +8 -2
- package/src/zoeService/installationStorage.d.ts +3 -2
- package/src/zoeService/installationStorage.d.ts.map +1 -1
- package/src/zoeService/installationStorage.js +3 -7
- package/src/zoeService/internal-types.d.ts +11 -3
- package/src/zoeService/internal-types.d.ts.map +1 -1
- package/src/zoeService/internal-types.js +9 -3
- package/src/zoeService/invitationQueries.d.ts +3 -3
- package/src/zoeService/invitationQueries.js +3 -3
- package/src/zoeService/makeInvitation.d.ts +4 -1
- package/src/zoeService/makeInvitation.d.ts.map +1 -1
- package/src/zoeService/makeInvitation.js +8 -2
- package/src/zoeService/offer/offer.d.ts +1 -0
- package/src/zoeService/offer/offer.d.ts.map +1 -1
- package/src/zoeService/offer/offer.js +3 -1
- package/src/zoeService/originalZoeSeat.d.ts.map +1 -1
- package/src/zoeService/originalZoeSeat.js +0 -2
- package/src/zoeService/startInstance.d.ts.map +1 -1
- package/src/zoeService/startInstance.js +2 -4
- package/src/zoeService/types-ambient.d.ts +0 -226
- package/src/zoeService/types-ambient.d.ts.map +1 -1
- package/src/zoeService/types-ambient.js +4 -327
- package/src/zoeService/types.d.ts +238 -0
- package/src/zoeService/types.d.ts.map +1 -0
- package/src/zoeService/types.ts +307 -0
- package/src/zoeService/utils.d.ts +13 -5
- package/src/zoeService/utils.test-d.ts +1 -0
- package/src/zoeService/zoe.d.ts +18 -7
- package/src/zoeService/zoe.d.ts.map +1 -1
- package/src/zoeService/zoe.js +12 -5
- package/src/zoeService/zoeSeat.d.ts.map +1 -1
- package/src/zoeService/zoeSeat.js +1 -2
- package/src/zoeService/zoeStorageManager.d.ts +6 -6
- package/src/zoeService/zoeStorageManager.d.ts.map +1 -1
- package/src/zoeService/zoeStorageManager.js +13 -4
- package/tools/fakeVatAdmin.d.ts +15 -8
- package/tools/fakeVatAdmin.d.ts.map +1 -1
- package/tools/fakeVatAdmin.js +18 -10
- package/tools/manualPriceAuthority.d.ts +4 -1
- package/tools/manualPriceAuthority.d.ts.map +1 -1
- package/tools/manualPriceAuthority.js +1 -0
- package/tools/scriptedOracle.d.ts +7 -3
- package/tools/scriptedOracle.d.ts.map +1 -1
- package/tools/scriptedOracle.js +4 -0
- package/tools/setup-zoe.d.ts +13 -7
- package/tools/setup-zoe.d.ts.map +1 -1
- package/tools/setup-zoe.js +38 -5
- package/tools/test-utils.d.ts +1 -1
- package/tools/test-utils.js +1 -1
- package/tools/types.d.ts +1 -0
- package/tools/types.d.ts.map +1 -1
- package/tools/types.js +1 -0
- package/src/contractFacet/internal-types.d.ts +0 -8
- package/src/contractFacet/internal-types.d.ts.map +0 -1
- package/src/contractFacet/internal-types.js +0 -15
- package/src/contractFacet/types-ambient.js +0 -1
- package/src/contractSupport/ratio.d.ts +0 -37
- package/src/contractSupport/ratio.d.ts.map +0 -1
- package/src/contractSupport/ratio.js +0 -419
- package/src/contractSupport/safeMath.d.ts +0 -11
- package/src/contractSupport/safeMath.d.ts.map +0 -1
- package/src/contractSupport/safeMath.js +0 -49
package/tools/fakeVatAdmin.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
//
|
|
1
|
+
// no jessie-check because this code runs only in Node for testing
|
|
2
|
+
/* eslint-env node */
|
|
2
3
|
|
|
3
4
|
import { Fail } from '@endo/errors';
|
|
4
5
|
import { E } from '@endo/eventual-send';
|
|
@@ -13,9 +14,8 @@ import { makeHandle } from '../src/makeHandle.js';
|
|
|
13
14
|
import zcfBundle from '../bundles/bundle-contractFacet.js';
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
|
-
* @import {LegacyWeakMap, WeakMapStore} from '@agoric/store';
|
|
17
17
|
* @import {MapStore} from '@agoric/swingset-liveslots';
|
|
18
|
-
* @import {BundleID, EndoZipBase64Bundle} from '@agoric/swingset-vat';
|
|
18
|
+
* @import {BundleID, EndoZipBase64Bundle, TestBundle} from '@agoric/swingset-vat';
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
// this simulates a bundlecap, which is normally a swingset "device node"
|
|
@@ -37,8 +37,8 @@ function makeFakeVatAdmin(testContextSetter = undefined, makeRemote = x => x) {
|
|
|
37
37
|
let exitWithFailure;
|
|
38
38
|
/** @type {MapStore<BundleID, BundleCap>} */
|
|
39
39
|
const idToBundleCap = makeScalarMapStore('idToBundleCap');
|
|
40
|
-
/** @type {
|
|
41
|
-
const bundleCapToBundle =
|
|
40
|
+
/** @type {Map<BundleCap, EndoZipBase64Bundle | {moduleFormat: 'test'}>} */
|
|
41
|
+
const bundleCapToBundle = new Map();
|
|
42
42
|
/** @type {MapStore<string, BundleID>} */
|
|
43
43
|
const nameToBundleID = makeScalarMapStore('nameToBundleID');
|
|
44
44
|
const fakeVatPowers = {
|
|
@@ -139,17 +139,25 @@ function makeFakeVatAdmin(testContextSetter = undefined, makeRemote = x => x) {
|
|
|
139
139
|
getExitMessage: () => exitMessage,
|
|
140
140
|
getHasExited: () => hasExited,
|
|
141
141
|
getExitWithFailure: () => exitWithFailure,
|
|
142
|
+
/**
|
|
143
|
+
* @param {string} id
|
|
144
|
+
* @param {EndoZipBase64Bundle | TestBundle} bundle
|
|
145
|
+
*/
|
|
142
146
|
installBundle: (id, bundle) => {
|
|
143
147
|
if (idToBundleCap.has(id)) {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
)
|
|
148
|
+
const extant = bundleCapToBundle.get(idToBundleCap.get(id));
|
|
149
|
+
assert(extant);
|
|
150
|
+
assert.equal(bundle.moduleFormat, extant.moduleFormat);
|
|
151
|
+
if (extant.moduleFormat === 'endoZipBase64') {
|
|
152
|
+
// Narrow bundle.moduleFormat now that extant.moduleFormat is narrowed
|
|
153
|
+
assert.equal(bundle.moduleFormat, extant.moduleFormat);
|
|
154
|
+
assert.equal(bundle.endoZipBase64, extant.endoZipBase64);
|
|
155
|
+
}
|
|
148
156
|
return idToBundleCap.get(id);
|
|
149
157
|
}
|
|
150
158
|
const bundleCap = fakeBundleCap();
|
|
151
159
|
idToBundleCap.init(id, bundleCap);
|
|
152
|
-
bundleCapToBundle.
|
|
160
|
+
bundleCapToBundle.set(bundleCap, bundle);
|
|
153
161
|
return bundleCap;
|
|
154
162
|
},
|
|
155
163
|
installNamedBundle: (name, id, bundle) => {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @import {Amount, Brand, Issuer, IssuerKit, Payment, Purse} from '@agoric/ertp';
|
|
2
3
|
* @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js';
|
|
3
4
|
*/
|
|
4
5
|
/**
|
|
@@ -15,12 +16,14 @@ export function makeManualPriceAuthority(options: {
|
|
|
15
16
|
actualBrandOut: Brand<"nat">;
|
|
16
17
|
initialPrice: Ratio;
|
|
17
18
|
timer: import("@agoric/time").TimerService;
|
|
18
|
-
quoteIssuerKit?:
|
|
19
|
+
quoteIssuerKit?: IssuerKit<"set", PriceDescription> | undefined;
|
|
19
20
|
}): PriceAuthority & {
|
|
20
21
|
setPrice: (Ratio: any) => void;
|
|
21
22
|
disable: () => void;
|
|
22
23
|
};
|
|
23
24
|
export type ManualPriceAuthority = ReturnType<typeof makeManualPriceAuthority>;
|
|
25
|
+
import type { Brand } from '@agoric/ertp';
|
|
24
26
|
import type { PriceDescription } from '@agoric/zoe/tools/types.js';
|
|
27
|
+
import type { IssuerKit } from '@agoric/ertp';
|
|
25
28
|
import type { PriceAuthority } from '@agoric/zoe/tools/types.js';
|
|
26
29
|
//# sourceMappingURL=manualPriceAuthority.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manualPriceAuthority.d.ts","sourceRoot":"","sources":["manualPriceAuthority.js"],"names":[],"mappings":"AAaA
|
|
1
|
+
{"version":3,"file":"manualPriceAuthority.d.ts","sourceRoot":"","sources":["manualPriceAuthority.js"],"names":[],"mappings":"AAaA;;;GAGG;AAEH;;;;;;;;GAQG;AACH,kDAPG;IAA8B,aAAa,EAAnC,MAAM,KAAK,CAAC;IACU,cAAc,EAApC,MAAM,KAAK,CAAC;IACG,YAAY,EAA3B,KAAK;IACwC,KAAK,EAAlD,OAAO,cAAc,EAAE,YAAY;IACU,cAAc;CACnE,GAAU,cAAc,GAAG;IAAE,QAAQ,EAAE,CAAC,KAAK,KAAA,KAAK,IAAI,CAAC;IAAC,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,CA8E/E;mCACa,UAAU,CAAC,OAAO,wBAAwB,CAAC;2BA1FU,cAAc;sCACY,4BAA4B;+BADtD,cAAc;oCACY,4BAA4B"}
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
} from '../src/contractSupport/index.js';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
+
* @import {Amount, Brand, Issuer, IssuerKit, Payment, Purse} from '@agoric/ertp';
|
|
15
16
|
* @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js';
|
|
16
17
|
*/
|
|
17
18
|
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @import {ZoeService} from '../src/types-index.js';
|
|
3
|
+
*/
|
|
1
4
|
/**
|
|
2
5
|
* Start an instance of an Oracle that follows a script. The Oracle has access
|
|
3
6
|
* to a timer, and looks in the script for events indexed by the current time.
|
|
@@ -17,11 +20,12 @@
|
|
|
17
20
|
export function makeScriptedOracle(script: Record<string, any>, oracleInstallation: Installation<import("../src/contracts/oracle.js").OracleStart>, timer: import("@agoric/time").TimerService, zoe: ZoeService, feeIssuer: Issuer): Promise<{
|
|
18
21
|
publicFacet: object & {
|
|
19
22
|
query(query: OracleQuery): Promise<unknown>;
|
|
20
|
-
makeQueryInvitation(query: OracleQuery): Promise<Invitation<unknown, never>>;
|
|
21
|
-
} &
|
|
23
|
+
makeQueryInvitation(query: OracleQuery): Promise<globalThis.Invitation<unknown, never>>;
|
|
24
|
+
} & RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
22
25
|
query(query: OracleQuery): Promise<unknown>;
|
|
23
|
-
makeQueryInvitation(query: OracleQuery): Promise<Invitation<unknown, never>>;
|
|
26
|
+
makeQueryInvitation(query: OracleQuery): Promise<globalThis.Invitation<unknown, never>>;
|
|
24
27
|
}>;
|
|
25
28
|
creatorFacet: OracleCreatorFacet;
|
|
26
29
|
}>;
|
|
30
|
+
import type { ZoeService } from '../src/types-index.js';
|
|
27
31
|
//# sourceMappingURL=scriptedOracle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scriptedOracle.d.ts","sourceRoot":"","sources":["scriptedOracle.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AACH,2CANW,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,sBACnB,YAAY,CAAC,OAAO,4BAA4B,EAAE,WAAW,CAAC,SAC9D,OAAO,cAAc,EAAE,YAAY,OACnC,UAAU,aACV,MAAM;;;;;;;;;GAqChB"}
|
|
1
|
+
{"version":3,"file":"scriptedOracle.d.ts","sourceRoot":"","sources":["scriptedOracle.js"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,2CANW,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,sBACnB,YAAY,CAAC,OAAO,4BAA4B,EAAE,WAAW,CAAC,SAC9D,OAAO,cAAc,EAAE,YAAY,OACnC,UAAU,aACV,MAAM;;;;;;;;;GAqChB;gCAtD4B,uBAAuB"}
|
package/tools/scriptedOracle.js
CHANGED
|
@@ -2,6 +2,10 @@ import { TimeMath } from '@agoric/time';
|
|
|
2
2
|
import { E } from '@endo/eventual-send';
|
|
3
3
|
import { Far } from '@endo/marshal';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* @import {ZoeService} from '../src/types-index.js';
|
|
7
|
+
*/
|
|
8
|
+
|
|
5
9
|
/**
|
|
6
10
|
* Start an instance of an Oracle that follows a script. The Oracle has access
|
|
7
11
|
* to a timer, and looks in the script for events indexed by the current time.
|
package/tools/setup-zoe.d.ts
CHANGED
|
@@ -1,34 +1,40 @@
|
|
|
1
1
|
export function makeZoeKitForTest(vatAdminSvc?: VatAdminSvc): {
|
|
2
|
-
zoeService: import("@endo/exo").Guarded<ZoeService>;
|
|
2
|
+
zoeService: import("@endo/exo").Guarded<globalThis.ZoeService>;
|
|
3
3
|
zoeConfigFacet: import("@endo/exo").Guarded<{
|
|
4
4
|
updateZcfBundleId(bundleId: any): void;
|
|
5
5
|
}>;
|
|
6
6
|
feeMintAccess: FeeMintAccess;
|
|
7
|
-
setVatAdminService: ((lateVatAdminSvc: any) => void) &
|
|
7
|
+
setVatAdminService: ((lateVatAdminSvc: any) => void) & RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, (lateVatAdminSvc: any) => void>;
|
|
8
8
|
};
|
|
9
|
-
export function makeZoeForTest(vatAdminSvc?: VatAdminSvc): import("@endo/exo").Guarded<ZoeService>;
|
|
9
|
+
export function makeZoeForTest(vatAdminSvc?: VatAdminSvc): import("@endo/exo").Guarded<globalThis.ZoeService>;
|
|
10
10
|
export function setUpZoeForTest<T extends unknown = any>({ setJig, feeIssuerConfig, vatAdminSvc, useNearRemote, }?: {
|
|
11
11
|
setJig?: ((jig: T) => void) | undefined;
|
|
12
12
|
feeIssuerConfig?: FeeIssuerConfig | undefined;
|
|
13
13
|
vatAdminSvc?: VatAdminSvc | undefined;
|
|
14
14
|
useNearRemote?: boolean | undefined;
|
|
15
15
|
}): Promise<{
|
|
16
|
-
zoe: import("@endo/exo").Guarded<ZoeService>;
|
|
16
|
+
zoe: import("@endo/exo").Guarded<globalThis.ZoeService>;
|
|
17
17
|
feeMintAccessP: FeeMintAccess;
|
|
18
|
-
bundleAndInstall: (
|
|
18
|
+
bundleAndInstall: (pathOrExports: object) => Promise<Installation>;
|
|
19
19
|
vatAdminSvc: VatAdminSvc;
|
|
20
20
|
vatAdminState: {
|
|
21
21
|
getExitMessage: () => any;
|
|
22
22
|
getHasExited: () => boolean;
|
|
23
23
|
getExitWithFailure: () => any;
|
|
24
|
-
installBundle: (id:
|
|
24
|
+
installBundle: (id: string, bundle: EndoZipBase64Bundle | TestBundle) => any;
|
|
25
25
|
installNamedBundle: (name: any, id: any, bundle: any) => any;
|
|
26
26
|
getCriticalVatKey: () => {};
|
|
27
27
|
getVatPowers: () => {
|
|
28
28
|
D: (bcap: any) => {
|
|
29
|
-
getBundle: () => EndoZipBase64Bundle
|
|
29
|
+
getBundle: () => EndoZipBase64Bundle | {
|
|
30
|
+
moduleFormat: "test";
|
|
31
|
+
} | undefined;
|
|
30
32
|
};
|
|
31
33
|
};
|
|
32
34
|
} | undefined;
|
|
33
35
|
}>;
|
|
36
|
+
import type { FeeIssuerConfig } from '../src/types-index.js';
|
|
37
|
+
import type { Installation } from '../src/types-index.js';
|
|
38
|
+
import type { EndoZipBase64Bundle } from '@agoric/swingset-vat';
|
|
39
|
+
import type { TestBundle } from '@agoric/swingset-vat';
|
|
34
40
|
//# sourceMappingURL=setup-zoe.d.ts.map
|
package/tools/setup-zoe.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-zoe.d.ts","sourceRoot":"","sources":["setup-zoe.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"setup-zoe.d.ts","sourceRoot":"","sources":["setup-zoe.js"],"names":[],"mappings":"AAgBO,gDAFI,WAAW;;;;;;;EAOrB;AAKM,6CAFI,WAAW,sDAGqB;AAapC,gCAPgB,CAAC,mFAErB;IAAmC,MAAM,UAA3B,CAAC,KAAK,IAAI;IACU,eAAe;IACnB,WAAW;IACf,aAAa;CAAC;;;sCAmD9B,MAAM,KACJ,OAAO,CAAC,YAAY,CAAC;;;;;;;;;;;;;;;;;GAoBnC;qCApG+C,uBAAuB;kCAAvB,uBAAuB;yCADrB,sBAAsB;gCAAtB,sBAAsB"}
|
package/tools/setup-zoe.js
CHANGED
|
@@ -2,9 +2,15 @@ import { E, makeLoopback } from '@endo/captp';
|
|
|
2
2
|
|
|
3
3
|
import { makeScalarBigMapStore } from '@agoric/vat-data';
|
|
4
4
|
import bundleSource from '@endo/bundle-source';
|
|
5
|
+
import { bundleTestExports } from '@endo/import-bundle';
|
|
5
6
|
import { makeDurableZoeKit } from '../src/zoeService/zoe.js';
|
|
6
7
|
import fakeVatAdmin, { makeFakeVatAdmin } from './fakeVatAdmin.js';
|
|
7
8
|
|
|
9
|
+
/**
|
|
10
|
+
* @import {EndoZipBase64Bundle, TestBundle} from '@agoric/swingset-vat';
|
|
11
|
+
* @import {FeeIssuerConfig, Installation} from '../src/types-index.js';
|
|
12
|
+
*/
|
|
13
|
+
|
|
8
14
|
/**
|
|
9
15
|
* @param {VatAdminSvc} [vatAdminSvc]
|
|
10
16
|
*/
|
|
@@ -57,13 +63,40 @@ export const setUpZoeForTest = async ({
|
|
|
57
63
|
);
|
|
58
64
|
|
|
59
65
|
/**
|
|
60
|
-
* @param {
|
|
66
|
+
* @param {object} pathOrExports
|
|
67
|
+
* @returns {Promise<EndoZipBase64Bundle | TestBundle>}
|
|
68
|
+
*/
|
|
69
|
+
const bundleModule = async pathOrExports => {
|
|
70
|
+
if (typeof pathOrExports === 'string') {
|
|
71
|
+
const path = pathOrExports;
|
|
72
|
+
return bundleSource(path);
|
|
73
|
+
} else {
|
|
74
|
+
assert.equal(
|
|
75
|
+
Object.getOwnPropertyDescriptor(pathOrExports, Symbol.toStringTag)
|
|
76
|
+
?.value,
|
|
77
|
+
'Module',
|
|
78
|
+
);
|
|
79
|
+
// Copy all the properties so this object can be hardened.
|
|
80
|
+
const exports = { ...pathOrExports };
|
|
81
|
+
return bundleTestExports(exports);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Bundle the source module (either as file system path or a Module object)
|
|
87
|
+
* and return an Installation. The bundleID is random and should not be relied
|
|
88
|
+
* upon in tests of this variety.
|
|
89
|
+
*
|
|
90
|
+
* @param {object} pathOrExports
|
|
61
91
|
* @returns {Promise<Installation>}
|
|
62
92
|
*/
|
|
63
|
-
const bundleAndInstall = async
|
|
64
|
-
const bundle = await
|
|
65
|
-
|
|
66
|
-
|
|
93
|
+
const bundleAndInstall = async pathOrExports => {
|
|
94
|
+
const bundle = await bundleModule(pathOrExports);
|
|
95
|
+
assert(
|
|
96
|
+
vatAdminState,
|
|
97
|
+
'bundleAndInstall called before vatAdminState defined',
|
|
98
|
+
);
|
|
99
|
+
const id = `b1-zoe-test-${Math.random()}`;
|
|
67
100
|
vatAdminState.installBundle(id, bundle);
|
|
68
101
|
return E(zoeService).installBundleID(id);
|
|
69
102
|
};
|
package/tools/test-utils.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export function withAmountUtils(kit: Pick<IssuerKit<"nat", any>, "brand" | "issu
|
|
|
6
6
|
* @param {NatValue} n
|
|
7
7
|
* @param {NatValue} [d]
|
|
8
8
|
*/
|
|
9
|
-
makeRatio: (n: NatValue, d?: NatValue) => Ratio;
|
|
9
|
+
makeRatio: (n: NatValue, d?: NatValue) => import("@agoric/ertp/src/ratio.js").Ratio;
|
|
10
10
|
/** @param {number} n */
|
|
11
11
|
units: (n: number) => import("@agoric/ertp").NatAmount;
|
|
12
12
|
/** The intact Exo remotable */
|
package/tools/test-utils.js
CHANGED
package/tools/types.d.ts
CHANGED
|
@@ -143,4 +143,5 @@ import type { Amount } from '@agoric/ertp';
|
|
|
143
143
|
import type { Payment } from '@agoric/ertp';
|
|
144
144
|
import type { Brand } from '@agoric/ertp';
|
|
145
145
|
import type { Issuer } from '@agoric/ertp';
|
|
146
|
+
import type { Notifier } from '@agoric/notifier';
|
|
146
147
|
//# sourceMappingURL=types.d.ts.map
|
package/tools/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.js"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.js"],"names":[],"mappings":";;;;iBAUc,OAAO,KAAK,EAAE,gBAAgB,CAAC;;;;kBAE/B,IAAI,CAAC,QAAQ,KAAK,EAAE,gBAAgB,CAAC,CAAC;;;;;;8BAKvC,CAAC,gBAAgB,CAAC;;;;;;;;cAQjB,OAAO,KAAK,CAAC;;;;eAEb,OAAO,KAAK,CAAC;;;;WAEb,OAAO,kBAAkB,EAAE,eAAe,GAAG,OAAO,cAAc,EAAE,YA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=> void;
|
|
4
|
-
type ZCFZygote = {
|
|
5
|
-
startContract: (instanceAdminFromZoe: ERef<ZoeInstanceAdmin>, instanceRecordFromZoe: InstanceRecord, issuerStorageFromZoe: IssuerRecords, privateArgs?: object) => Promise<ExecuteContractResult>;
|
|
6
|
-
restartContract: (privateArgs?: object) => void;
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=internal-types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"internal-types.d.ts","sourceRoot":"","sources":["internal-types.js"],"names":[],"mappings":"qBAGa,CAAE,EAAC,GAAG,EAAC,EAAE;IAAC,GAAG,EAAE,GAAG,CAAA;CAAC,KAAM,IAAI;;mBAK5B,CAAC,oBAAoB,EAAE,IAAI,CAAC,gBAAgB,CAAC,EACpD,qBAAqB,EAAE,cAAc,EACrC,oBAAoB,EAAE,aAAa,EACnC,WAAW,CAAC,EAAE,MAAM,KACnB,OAAO,CAAC,qBAAqB,CAAC;qBACxB,CAAC,WAAW,CAAC,EAAE,MAAM,KAAK,IAAI"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// @jessie-check
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @typedef {( {zcf}: {zcf: ZCF} ) => void} TestJigSetter
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @typedef ZCFZygote
|
|
9
|
-
* @property {(instanceAdminFromZoe: ERef<ZoeInstanceAdmin>,
|
|
10
|
-
* instanceRecordFromZoe: InstanceRecord,
|
|
11
|
-
* issuerStorageFromZoe: IssuerRecords,
|
|
12
|
-
* privateArgs?: object,
|
|
13
|
-
* ) => Promise<ExecuteContractResult>} startContract
|
|
14
|
-
* @property {(privateArgs?: object) => void} restartContract
|
|
15
|
-
*/
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// Dummy file for .d.ts twin to declare ambients
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
export function assertIsRatio(ratio: any): void;
|
|
2
|
-
export function makeRatio(numerator: bigint, numeratorBrand: Brand, denominator?: bigint, denominatorBrand?: Brand): Ratio;
|
|
3
|
-
export function makeRatioFromAmounts(numeratorAmount: Amount, denominatorAmount: Amount): Ratio;
|
|
4
|
-
/** @type {ScaleAmount} */
|
|
5
|
-
export const floorMultiplyBy: ScaleAmount;
|
|
6
|
-
/** @type {ScaleAmount} */
|
|
7
|
-
export const ceilMultiplyBy: ScaleAmount;
|
|
8
|
-
/** @type {ScaleAmount} */
|
|
9
|
-
export const multiplyBy: ScaleAmount;
|
|
10
|
-
/**
|
|
11
|
-
* Divide the amount by the ratio, truncating the remainder.
|
|
12
|
-
* @type {ScaleAmount}
|
|
13
|
-
*/
|
|
14
|
-
export const floorDivideBy: ScaleAmount;
|
|
15
|
-
/**
|
|
16
|
-
* Divide the amount by the ratio, rounding up the remainder.
|
|
17
|
-
* @type {ScaleAmount}
|
|
18
|
-
*/
|
|
19
|
-
export const ceilDivideBy: ScaleAmount;
|
|
20
|
-
/**
|
|
21
|
-
* Divide the amount by the ratio, rounding to nearest with ties to even (aka Banker's Rounding) as in IEEE 754 default rounding.
|
|
22
|
-
* @type {ScaleAmount}
|
|
23
|
-
*/
|
|
24
|
-
export const divideBy: ScaleAmount;
|
|
25
|
-
export function invertRatio(ratio: Ratio): Ratio;
|
|
26
|
-
export function addRatios(left: Ratio, right: Ratio): Ratio;
|
|
27
|
-
export function subtractRatios(left: Ratio, right: Ratio): Ratio;
|
|
28
|
-
export function multiplyRatios(left: Ratio, right: Ratio): Ratio;
|
|
29
|
-
export function oneMinus(ratio: Ratio): Ratio;
|
|
30
|
-
export function ratioGTE(left: Ratio, right: Ratio): boolean;
|
|
31
|
-
export function ratiosSame(left: Ratio, right: Ratio): boolean;
|
|
32
|
-
export function quantize(ratio: Ratio, newDen: bigint): Ratio;
|
|
33
|
-
export function parseRatio(numeric: ParsableNumber, numeratorBrand: Brand, denominatorBrand?: Brand): Ratio;
|
|
34
|
-
export function assertParsableNumber(specimen: unknown): asserts specimen is ParsableNumber;
|
|
35
|
-
export function ratioToNumber(ratio: Ratio): number;
|
|
36
|
-
export type ParsableNumber = bigint | number | string;
|
|
37
|
-
//# sourceMappingURL=ratio.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ratio.d.ts","sourceRoot":"","sources":["ratio.js"],"names":[],"mappings":"AAwCO,gDAcN;AASM,qCANI,MAAM,kBACN,KAAK,gBACL,MAAM,qBACN,KAAK,GACH,KAAK,CAejB;AAOM,sDAJI,MAAM,qBACN,MAAM,GACJ,KAAK,CAYjB;AA2BD,0BAA0B;AAC1B,8BADW,WAAW,CAGpB;AAEF,0BAA0B;AAC1B,6BADW,WAAW,CAGpB;AAEF,0BAA0B;AAC1B,yBADW,WAAW,CAGpB;AA2BF;;;GAGG;AACH,4BAFU,WAAW,CAInB;AAEF;;;GAGG;AACH,2BAFU,WAAW,CAInB;AAEF;;;GAGG;AACH,uBAFU,WAAW,CAInB;AAMK,mCAHI,KAAK,GACH,KAAK,CAWjB;AAOM,gCAJI,KAAK,SACL,KAAK,GACH,KAAK,CAwBjB;AAOM,qCAJI,KAAK,SACL,KAAK,GACH,KAAK,CAmBjB;AAOM,qCAJI,KAAK,SACL,KAAK,GACH,KAAK,CA8BjB;AAQM,gCAHI,KAAK,GACH,KAAK,CAcjB;AAOM,+BAJI,KAAK,SACL,KAAK,GACH,OAAO,CAkBnB;AASM,iCAJI,KAAK,SACL,KAAK,GACH,OAAO,CAOnB;AAUM,gCAJI,KAAK,UACL,MAAM,GACJ,KAAK,CAiBjB;AAaM,oCALI,cAAc,kBACd,KAAK,qBACL,KAAK,GACH,KAAK,CAmBjB;AAMM,+CAHI,OAAO,GACL,QAAQ,QAAQ,IAAI,cAAc,CAK9C;AAQM,qCAHI,KAAK,GACH,MAAM,CAMlB;6BAhDa,MAAM,GAAG,MAAM,GAAG,MAAM"}
|