@agoric/zoe 0.26.3-upgrade-18a-dev-4ee0508.0 → 0.26.3-upgrade-20-dev-086463b.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 +288 -288
- package/bundles/bundle-contractFacet.js +1 -1
- package/package.json +30 -30
- 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/offerHandlerStorage.d.ts.map +1 -1
- package/src/contractFacet/offerHandlerStorage.js +5 -0
- package/src/contractFacet/reallocate.d.ts.map +1 -1
- package/src/contractFacet/reallocate.js +4 -0
- 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 -91
- package/src/contractFacet/vatRoot.d.ts +8 -2
- package/src/contractFacet/vatRoot.d.ts.map +1 -1
- package/src/contractFacet/vatRoot.js +5 -4
- package/src/contractFacet/zcfMint.d.ts +4 -3
- package/src/contractFacet/zcfMint.d.ts.map +1 -1
- package/src/contractFacet/zcfMint.js +9 -21
- package/src/contractFacet/zcfSeat.d.ts.map +1 -1
- package/src/contractFacet/zcfSeat.js +12 -188
- package/src/contractFacet/zcfZygote.d.ts +9 -1
- package/src/contractFacet/zcfZygote.d.ts.map +1 -1
- package/src/contractFacet/zcfZygote.js +27 -9
- 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/durability.d.ts +1 -0
- package/src/contractSupport/durability.d.ts.map +1 -1
- package/src/contractSupport/durability.js +4 -0
- package/src/contractSupport/index.d.ts +2 -2
- package/src/contractSupport/index.js +2 -19
- 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/priceQuote.d.ts +1 -0
- package/src/contractSupport/priceQuote.d.ts.map +1 -1
- package/src/contractSupport/priceQuote.js +6 -1
- package/src/contractSupport/recorder.d.ts +8 -24
- package/src/contractSupport/recorder.d.ts.map +1 -1
- package/src/contractSupport/recorder.js +6 -0
- package/src/contractSupport/types-ambient.d.ts.map +1 -1
- package/src/contractSupport/types-ambient.js +1 -0
- package/src/contractSupport/zoeHelpers.d.ts +11 -2
- package/src/contractSupport/zoeHelpers.d.ts.map +1 -1
- package/src/contractSupport/zoeHelpers.js +7 -2
- package/src/contracts/atomicSwap.d.ts +1 -1
- package/src/contracts/auction/index.d.ts +3 -3
- package/src/contracts/automaticRefund.d.ts +3 -3
- 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 +2 -2
- package/src/contracts/callSpread/fundedCallSpread.d.ts +1 -1
- package/src/contracts/callSpread/pricedCallSpread.d.ts +4 -4
- package/src/contracts/coveredCall-durable.d.ts +1 -1
- package/src/contracts/coveredCall.d.ts +1 -1
- package/src/contracts/coveredCall.d.ts.map +1 -1
- package/src/contracts/coveredCall.js +1 -6
- package/src/contracts/loan/index.d.ts +1 -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 +2 -2
- package/src/contracts/oracle.d.ts +3 -0
- package/src/contracts/oracle.d.ts.map +1 -1
- package/src/contracts/oracle.js +1 -0
- package/src/contracts/priceAggregator.d.ts +2 -0
- package/src/contracts/priceAggregator.d.ts.map +1 -1
- package/src/contracts/priceAggregator.js +14 -11
- 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 +5 -0
- 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.map +1 -1
- package/src/instanceRecordStorage.js +3 -1
- package/src/internal-types.d.ts +15 -6
- package/src/internal-types.d.ts.map +1 -1
- package/src/internal-types.js +9 -5
- 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 +10 -5
- package/src/typeGuards.d.ts +10 -5
- package/src/typeGuards.d.ts.map +1 -1
- package/src/typeGuards.js +9 -6
- 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 +44 -0
- package/src/zoeService/escrowStorage.d.ts.map +1 -1
- package/src/zoeService/escrowStorage.js +4 -0
- package/src/zoeService/feeMint.d.ts +1 -0
- package/src/zoeService/feeMint.d.ts.map +1 -1
- package/src/zoeService/feeMint.js +4 -0
- package/src/zoeService/installationStorage.d.ts +4 -5
- package/src/zoeService/installationStorage.d.ts.map +1 -1
- package/src/zoeService/installationStorage.js +8 -8
- package/src/zoeService/instanceAdminStorage.d.ts +1 -0
- package/src/zoeService/instanceAdminStorage.d.ts.map +1 -1
- package/src/zoeService/instanceAdminStorage.js +4 -0
- package/src/zoeService/internal-types.d.ts +12 -5
- package/src/zoeService/internal-types.d.ts.map +1 -1
- package/src/zoeService/internal-types.js +10 -10
- package/src/zoeService/invitationQueries.d.ts +3 -3
- package/src/zoeService/invitationQueries.js +3 -3
- package/src/zoeService/makeInvitation.d.ts +1 -0
- package/src/zoeService/makeInvitation.d.ts.map +1 -1
- package/src/zoeService/makeInvitation.js +3 -1
- package/src/zoeService/offer/burnInvitation.d.ts +1 -1
- package/src/zoeService/offer/burnInvitation.d.ts.map +1 -1
- package/src/zoeService/offer/burnInvitation.js +3 -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 +6 -4
- package/src/zoeService/startInstance.d.ts +1 -1
- package/src/zoeService/startInstance.d.ts.map +1 -1
- package/src/zoeService/startInstance.js +5 -4
- package/src/zoeService/types-ambient.d.ts +0 -220
- package/src/zoeService/types-ambient.d.ts.map +1 -1
- package/src/zoeService/types-ambient.js +4 -323
- 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 +18 -10
- package/src/zoeService/utils.test-d.ts +1 -0
- package/src/zoeService/zoe.d.ts +11 -1
- package/src/zoeService/zoe.d.ts.map +1 -1
- package/src/zoeService/zoe.js +8 -1
- package/src/zoeService/zoeSeat.d.ts +1 -4
- package/src/zoeService/zoeSeat.d.ts.map +1 -1
- package/src/zoeService/zoeSeat.js +6 -4
- package/src/zoeService/zoeStorageManager.d.ts +5 -5
- package/src/zoeService/zoeStorageManager.d.ts.map +1 -1
- package/src/zoeService/zoeStorageManager.js +4 -3
- package/tools/fakePriceAuthority.d.ts +3 -2
- package/tools/fakePriceAuthority.d.ts.map +1 -1
- package/tools/fakePriceAuthority.js +9 -6
- package/tools/fakeVatAdmin.d.ts +10 -4
- package/tools/fakeVatAdmin.d.ts.map +1 -1
- package/tools/fakeVatAdmin.js +21 -10
- package/tools/manualPriceAuthority.d.ts +6 -2
- package/tools/manualPriceAuthority.d.ts.map +1 -1
- package/tools/manualPriceAuthority.js +8 -6
- package/tools/scriptedOracle.d.ts +7 -3
- package/tools/scriptedOracle.d.ts.map +1 -1
- package/tools/scriptedOracle.js +4 -0
- package/tools/scriptedPriceAuthority.d.ts.map +1 -1
- package/tools/scriptedPriceAuthority.js +6 -5
- package/tools/setup-zoe.d.ts +12 -6
- package/tools/setup-zoe.d.ts.map +1 -1
- package/tools/setup-zoe.js +38 -5
- package/tools/test-utils.d.ts +10 -6
- package/tools/test-utils.d.ts.map +1 -1
- package/tools/test-utils.js +6 -2
- package/tools/types.d.ts +5 -0
- package/tools/types.d.ts.map +1 -1
- package/tools/types.js +5 -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/src/zoeService/zoe.js
CHANGED
|
@@ -28,7 +28,11 @@ import { getZcfBundleCap } from './createZCFVat.js';
|
|
|
28
28
|
import { defaultFeeIssuerConfig, prepareFeeMint } from './feeMint.js';
|
|
29
29
|
import { ZoeServiceI } from '../typeGuards.js';
|
|
30
30
|
|
|
31
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* @import {VatAdminSvc} from '@agoric/swingset-vat';
|
|
33
|
+
* @import {Baggage} from '@agoric/vat-data';
|
|
34
|
+
* @import {FeeIssuerConfig, FeeMintAccess, ZCFSpec, ZoeService} from './types.js';
|
|
35
|
+
*/
|
|
32
36
|
|
|
33
37
|
/**
|
|
34
38
|
* Create a durable instance of Zoe.
|
|
@@ -289,3 +293,6 @@ export { makeDurableZoeKit, makeZoeKit };
|
|
|
289
293
|
/**
|
|
290
294
|
* @typedef {ReturnType<typeof makeDurableZoeKit>} ZoeKit
|
|
291
295
|
*/
|
|
296
|
+
|
|
297
|
+
// eslint-disable-next-line import/export -- no named value exports; only types
|
|
298
|
+
export * from '../types-index.js';
|
|
@@ -16,10 +16,7 @@ export function makeZoeSeatAdminFactory(baggage: import("@agoric/vat-data").Bagg
|
|
|
16
16
|
fail(reason: any): void;
|
|
17
17
|
/** @param {HandleOfferResult} result */
|
|
18
18
|
resolveExitAndResult({ offerResultPromise, exitObj }: HandleOfferResult): void;
|
|
19
|
-
getExitSubscriber():
|
|
20
|
-
subscribeAfter(publishCount?: bigint): Promise<any>;
|
|
21
|
-
getUpdateSince(updateCount: any): any;
|
|
22
|
-
}>;
|
|
19
|
+
getExitSubscriber(): globalThis.Subscriber<any>;
|
|
23
20
|
finalPayouts(payments: any): Promise<void>;
|
|
24
21
|
}>;
|
|
25
22
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zoeSeat.d.ts","sourceRoot":"","sources":["zoeSeat.js"],"names":[],"mappings":"AAkDO,iDAFI,OAAO,kBAAkB,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"zoeSeat.d.ts","sourceRoot":"","sources":["zoeSeat.js"],"names":[],"mappings":"AAkDO,iDAFI,OAAO,kBAAkB,EAAE,OAAO,uBA0WhC,UAAU,YACV,cAAc,uBACd,mBAAmB,iBACnB,aAAa,YACb,IAAI,CAAC,OAAO,CAAC,2BACb,OAAO;;;;;;;;;;;;;;;;QA3IZ,wCAAwC;8DAA5B,iBAAiB;;;;EAoKpC"}
|
|
@@ -4,10 +4,10 @@ import { E } from '@endo/eventual-send';
|
|
|
4
4
|
import { M, prepareExoClassKit } from '@agoric/vat-data';
|
|
5
5
|
import { deeplyFulfilled } from '@endo/marshal';
|
|
6
6
|
import { makePromiseKit } from '@endo/promise-kit';
|
|
7
|
+
import { NonNullish } from '@agoric/internal';
|
|
7
8
|
|
|
8
9
|
import { satisfiesWant } from '../contractFacet/offerSafety.js';
|
|
9
|
-
|
|
10
|
-
import '../internal-types.js';
|
|
10
|
+
|
|
11
11
|
import {
|
|
12
12
|
declareOldZoeSeatAdminKind,
|
|
13
13
|
OriginalZoeSeatIKit,
|
|
@@ -143,8 +143,10 @@ export const makeZoeSeatAdminFactory = baggage => {
|
|
|
143
143
|
// doExit(), which ensures that finalPayouts() has set state.payouts.
|
|
144
144
|
return E.when(
|
|
145
145
|
state.subscriber.subscribeAfter(),
|
|
146
|
-
() =>
|
|
147
|
-
|
|
146
|
+
() =>
|
|
147
|
+
NonNullish(state.payouts[keyword], `No payout for "${keyword}"`),
|
|
148
|
+
() =>
|
|
149
|
+
NonNullish(state.payouts[keyword], `No payout for "${keyword}"`),
|
|
148
150
|
);
|
|
149
151
|
},
|
|
150
152
|
|
|
@@ -4,7 +4,7 @@ export function makeZoeStorageManager(createZCFVat: CreateZCFVat, getBundleCapFo
|
|
|
4
4
|
getFeeBrand: () => Brand;
|
|
5
5
|
}, zoeBaggage: Baggage): import("@endo/exo").GuardedKit<{
|
|
6
6
|
zoeServiceDataAccess: {
|
|
7
|
-
getInvitationIssuer: () => globalThis.Issuer<"set", InvitationDetails>;
|
|
7
|
+
getInvitationIssuer: () => globalThis.Issuer<"set", import("@agoric/zoe").InvitationDetails>;
|
|
8
8
|
getBundleIDFromInstallation(allegedInstallation: any): Promise<string | undefined>;
|
|
9
9
|
getPublicFacet(instance: any): any;
|
|
10
10
|
getBrands(instance: any): any;
|
|
@@ -13,14 +13,14 @@ export function makeZoeStorageManager(createZCFVat: CreateZCFVat, getBundleCapFo
|
|
|
13
13
|
getTerms(instance: any): any;
|
|
14
14
|
getInstallation(instance: any): any;
|
|
15
15
|
getProposalShapeForInvitation: (invitationHandle: any) => any;
|
|
16
|
-
installBundle: (allegedBundle: any, bundleLabel: any) => Promise<Installation
|
|
17
|
-
installBundleID(bundleID: any, bundleLabel: any): Promise<Installation<unknown>>;
|
|
16
|
+
installBundle: (allegedBundle: any, bundleLabel: any) => Promise<globalThis.Installation>;
|
|
17
|
+
installBundleID(bundleID: any, bundleLabel: any): Promise<globalThis.Installation<unknown>>;
|
|
18
18
|
};
|
|
19
19
|
makeOfferAccess: {
|
|
20
20
|
getAssetKindByBrand: GetAssetKindByBrand;
|
|
21
21
|
getInstanceAdmin(instance: any): any;
|
|
22
22
|
getProposalShapeForInvitation: (invitationHandle: any) => any;
|
|
23
|
-
getInvitationIssuer: () => globalThis.Issuer<"set", InvitationDetails>;
|
|
23
|
+
getInvitationIssuer: () => globalThis.Issuer<"set", import("@agoric/zoe").InvitationDetails>;
|
|
24
24
|
depositPayments(proposal: any, payments: any): Promise<Allocation>;
|
|
25
25
|
};
|
|
26
26
|
startInstanceAccess: {
|
|
@@ -33,7 +33,7 @@ export function makeZoeStorageManager(createZCFVat: CreateZCFVat, getBundleCapFo
|
|
|
33
33
|
}>;
|
|
34
34
|
};
|
|
35
35
|
invitationIssuerAccess: {
|
|
36
|
-
getInvitationIssuer: () => globalThis.Issuer<"set", InvitationDetails>;
|
|
36
|
+
getInvitationIssuer: () => globalThis.Issuer<"set", import("@agoric/zoe").InvitationDetails>;
|
|
37
37
|
};
|
|
38
38
|
}>;
|
|
39
39
|
import type { Baggage } from '@agoric/vat-data';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zoeStorageManager.d.ts","sourceRoot":"","sources":["zoeStorageManager.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"zoeStorageManager.d.ts","sourceRoot":"","sources":["zoeStorageManager.js"],"names":[],"mappings":"AAyDO,oDAXI,YAAY,qBAEZ,iBAAiB,kBACjB,OAAO,sBAAsB,EAAE,mBAAmB,WAClD;IACL,eAAe,EAAE,eAAe,CAAC;IACjC,YAAY,EAAE,MAAM,MAAM,CAAC;IAC3B,WAAW,EAAE,MAAM,KAAK,CAAC;CAC3B,cACO,OAAO;;;;;;;;;;;;;;;;;;;;;;;;kBANgC,CAAC;qBAChD,CAAC;oBACa,CAAC;;;;;;;GA+ajB;6BApcyB,kBAAkB"}
|
|
@@ -21,15 +21,16 @@ import { prepareInvitationKit } from './makeInvitation.js';
|
|
|
21
21
|
import { makeInstanceAdminStorage } from './instanceAdminStorage.js';
|
|
22
22
|
import { makeInstallationStorage } from './installationStorage.js';
|
|
23
23
|
|
|
24
|
-
/// <reference path="./types.js" />
|
|
25
|
-
import './internal-types.js';
|
|
26
24
|
import {
|
|
27
25
|
InstanceStorageManagerIKit,
|
|
28
26
|
ZoeMintI,
|
|
29
27
|
ZoeStorageManagerIKit,
|
|
30
28
|
} from '../typeGuards.js';
|
|
31
29
|
|
|
32
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* @import {Baggage} from '@agoric/vat-data';
|
|
32
|
+
* @import {InvitationAmount} from '@agoric/zoe';
|
|
33
|
+
*/
|
|
33
34
|
|
|
34
35
|
const { ownKeys } = Reflect;
|
|
35
36
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @property {Array<[number, number]>} [tradeList]
|
|
7
7
|
* @property {import('@agoric/time').TimerService} timer
|
|
8
8
|
* @property {import('@agoric/time').RelativeTime} [quoteInterval]
|
|
9
|
-
* @property {ERef<Mint<'set'>>} [quoteMint]
|
|
9
|
+
* @property {ERef<Mint<'set', PriceDescription>>} [quoteMint]
|
|
10
10
|
* @property {Amount<'nat'>} [unitAmountIn]
|
|
11
11
|
*/
|
|
12
12
|
/**
|
|
@@ -24,8 +24,9 @@ export type FakePriceAuthorityOptions = {
|
|
|
24
24
|
tradeList?: [number, number][] | undefined;
|
|
25
25
|
timer: import("@agoric/time").TimerService;
|
|
26
26
|
quoteInterval?: import("@agoric/time").RelativeTime | undefined;
|
|
27
|
-
quoteMint?: globalThis.ERef<globalThis.Mint<"set">> | undefined;
|
|
27
|
+
quoteMint?: globalThis.ERef<globalThis.Mint<"set", PriceDescription>> | undefined;
|
|
28
28
|
unitAmountIn?: import("@agoric/ertp").NatAmount | undefined;
|
|
29
29
|
};
|
|
30
30
|
import type { PriceAuthority } from '@agoric/zoe/tools/types.js';
|
|
31
|
+
import type { PriceDescription } from '@agoric/zoe/tools/types.js';
|
|
31
32
|
//# sourceMappingURL=fakePriceAuthority.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fakePriceAuthority.d.ts","sourceRoot":"","sources":["fakePriceAuthority.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fakePriceAuthority.d.ts","sourceRoot":"","sources":["fakePriceAuthority.js"],"names":[],"mappings":"AA4BA;;;;;;;;;;GAUG;AAEH;;;;;;GAMG;AACH,gDAHW,yBAAyB,GACvB,OAAO,CAAC,cAAc,CAAC,CAwSnC;;mBAvTa,KAAK,CAAC,KAAK,CAAC;oBACZ,KAAK,CAAC,KAAK,CAAC;;;WAGZ,OAAO,cAAc,EAAE,YAAY;;;;;oCAhB4C,4BAA4B;sCAA5B,4BAA4B"}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { Fail } from '@endo/errors';
|
|
2
|
-
import { makePromiseKit } from '@endo/promise-kit';
|
|
3
2
|
import { E } from '@endo/eventual-send';
|
|
4
3
|
import { Far } from '@endo/marshal';
|
|
4
|
+
import { makePromiseKit } from '@endo/promise-kit';
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { AmountMath } from '@agoric/ertp';
|
|
7
7
|
import {
|
|
8
|
-
makeNotifierKit,
|
|
9
8
|
makeNotifierFromAsyncIterable,
|
|
9
|
+
makeNotifierKit,
|
|
10
10
|
} from '@agoric/notifier';
|
|
11
11
|
import { TimeMath } from '@agoric/time';
|
|
12
12
|
|
|
13
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
makePriceQuoteIssuer,
|
|
15
|
+
natSafeMath,
|
|
16
|
+
} from '../src/contractSupport/index.js';
|
|
14
17
|
|
|
15
18
|
/**
|
|
16
19
|
* @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js';
|
|
@@ -31,7 +34,7 @@ const timestampLTE = (a, b) => TimeMath.compareAbs(a, b) <= 0;
|
|
|
31
34
|
* @property {Array<[number, number]>} [tradeList]
|
|
32
35
|
* @property {import('@agoric/time').TimerService} timer
|
|
33
36
|
* @property {import('@agoric/time').RelativeTime} [quoteInterval]
|
|
34
|
-
* @property {ERef<Mint<'set'>>} [quoteMint]
|
|
37
|
+
* @property {ERef<Mint<'set', PriceDescription>>} [quoteMint]
|
|
35
38
|
* @property {Amount<'nat'>} [unitAmountIn]
|
|
36
39
|
*/
|
|
37
40
|
|
|
@@ -51,7 +54,7 @@ export async function makeFakePriceAuthority(options) {
|
|
|
51
54
|
timer,
|
|
52
55
|
unitAmountIn = AmountMath.make(actualBrandIn, 1n),
|
|
53
56
|
quoteInterval = 1n,
|
|
54
|
-
quoteMint =
|
|
57
|
+
quoteMint = makePriceQuoteIssuer().mint,
|
|
55
58
|
} = options;
|
|
56
59
|
|
|
57
60
|
tradeList ||
|
package/tools/fakeVatAdmin.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export const zcfBundleCap: any;
|
|
2
2
|
export default fakeVatAdmin;
|
|
3
|
-
export type BundleID = import("@agoric/swingset-vat").BundleID;
|
|
4
|
-
export type EndoZipBase64Bundle = import("@agoric/swingset-vat").EndoZipBase64Bundle;
|
|
5
3
|
export type BundleCap = import("@agoric/swingset-vat").BundleCap;
|
|
6
4
|
declare const fakeVatAdmin: {
|
|
7
5
|
getBundleCap: (bundleID: any) => Promise<any>;
|
|
@@ -90,14 +88,22 @@ export function makeFakeVatAdmin(testContextSetter?: (...args: any) => unknown,
|
|
|
90
88
|
getExitMessage: () => any;
|
|
91
89
|
getHasExited: () => boolean;
|
|
92
90
|
getExitWithFailure: () => any;
|
|
93
|
-
|
|
91
|
+
/**
|
|
92
|
+
* @param {string} id
|
|
93
|
+
* @param {EndoZipBase64Bundle | TestBundle} bundle
|
|
94
|
+
*/
|
|
95
|
+
installBundle: (id: string, bundle: EndoZipBase64Bundle | TestBundle) => any;
|
|
94
96
|
installNamedBundle: (name: any, id: any, bundle: any) => any;
|
|
95
97
|
getCriticalVatKey: () => {};
|
|
96
98
|
getVatPowers: () => {
|
|
97
99
|
D: (bcap: any) => {
|
|
98
|
-
getBundle: () =>
|
|
100
|
+
getBundle: () => EndoZipBase64Bundle | {
|
|
101
|
+
moduleFormat: "test";
|
|
102
|
+
} | undefined;
|
|
99
103
|
};
|
|
100
104
|
};
|
|
101
105
|
};
|
|
102
106
|
};
|
|
107
|
+
import type { EndoZipBase64Bundle } from '@agoric/swingset-vat';
|
|
108
|
+
import type { TestBundle } from '@agoric/swingset-vat';
|
|
103
109
|
//# sourceMappingURL=fakeVatAdmin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fakeVatAdmin.d.ts","sourceRoot":"","sources":["fakeVatAdmin.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fakeVatAdmin.d.ts","sourceRoot":"","sources":["fakeVatAdmin.js"],"names":[],"mappings":"AAyBA,+BAA4C;;wBAJ7B,OAAO,sBAAsB,EAAE,SAAS;AA4JvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA8C;AAtJ9C;;;GAGG;AACH,qDAHW,CAAC,GAAG,IAAI,KAAA,KAAK,OAAO,eACpB,CAAC,CAAC,EAAE,OAAO,KAAK,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAgH9B;;;WAGG;4BAFQ,MAAM,UACN,mBAAmB,GAAG,UAAU;;;;;;kCAxGkB,MAAM;;;;;EAmItE;yCAzJ2D,sBAAsB;gCAAtB,sBAAsB"}
|
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';
|
|
@@ -12,8 +13,10 @@ import { handlePKitWarning } from '../src/handleWarning.js';
|
|
|
12
13
|
import { makeHandle } from '../src/makeHandle.js';
|
|
13
14
|
import zcfBundle from '../bundles/bundle-contractFacet.js';
|
|
14
15
|
|
|
15
|
-
/**
|
|
16
|
-
|
|
16
|
+
/**
|
|
17
|
+
* @import {MapStore} from '@agoric/swingset-liveslots';
|
|
18
|
+
* @import {BundleID, EndoZipBase64Bundle, TestBundle} from '@agoric/swingset-vat';
|
|
19
|
+
*/
|
|
17
20
|
|
|
18
21
|
// this simulates a bundlecap, which is normally a swingset "device node"
|
|
19
22
|
/** @typedef { import('@agoric/swingset-vat').BundleCap } BundleCap */
|
|
@@ -34,8 +37,8 @@ function makeFakeVatAdmin(testContextSetter = undefined, makeRemote = x => x) {
|
|
|
34
37
|
let exitWithFailure;
|
|
35
38
|
/** @type {MapStore<BundleID, BundleCap>} */
|
|
36
39
|
const idToBundleCap = makeScalarMapStore('idToBundleCap');
|
|
37
|
-
/** @type {
|
|
38
|
-
const bundleCapToBundle =
|
|
40
|
+
/** @type {Map<BundleCap, EndoZipBase64Bundle | {moduleFormat: 'test'}>} */
|
|
41
|
+
const bundleCapToBundle = new Map();
|
|
39
42
|
/** @type {MapStore<string, BundleID>} */
|
|
40
43
|
const nameToBundleID = makeScalarMapStore('nameToBundleID');
|
|
41
44
|
const fakeVatPowers = {
|
|
@@ -136,17 +139,25 @@ function makeFakeVatAdmin(testContextSetter = undefined, makeRemote = x => x) {
|
|
|
136
139
|
getExitMessage: () => exitMessage,
|
|
137
140
|
getHasExited: () => hasExited,
|
|
138
141
|
getExitWithFailure: () => exitWithFailure,
|
|
142
|
+
/**
|
|
143
|
+
* @param {string} id
|
|
144
|
+
* @param {EndoZipBase64Bundle | TestBundle} bundle
|
|
145
|
+
*/
|
|
139
146
|
installBundle: (id, bundle) => {
|
|
140
147
|
if (idToBundleCap.has(id)) {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
)
|
|
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
|
+
}
|
|
145
156
|
return idToBundleCap.get(id);
|
|
146
157
|
}
|
|
147
158
|
const bundleCap = fakeBundleCap();
|
|
148
159
|
idToBundleCap.init(id, bundleCap);
|
|
149
|
-
bundleCapToBundle.
|
|
160
|
+
bundleCapToBundle.set(bundleCap, bundle);
|
|
150
161
|
return bundleCap;
|
|
151
162
|
},
|
|
152
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
|
/**
|
|
@@ -7,7 +8,7 @@
|
|
|
7
8
|
* @param {Brand<'nat'>} options.actualBrandOut
|
|
8
9
|
* @param {Ratio} options.initialPrice
|
|
9
10
|
* @param {import('@agoric/time').TimerService} options.timer
|
|
10
|
-
* @param {IssuerKit<'set'>} [options.quoteIssuerKit]
|
|
11
|
+
* @param {IssuerKit<'set', PriceDescription>} [options.quoteIssuerKit]
|
|
11
12
|
* @returns {PriceAuthority & { setPrice: (Ratio) => void; disable: () => void }}
|
|
12
13
|
*/
|
|
13
14
|
export function makeManualPriceAuthority(options: {
|
|
@@ -15,11 +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';
|
|
26
|
+
import type { PriceDescription } from '@agoric/zoe/tools/types.js';
|
|
27
|
+
import type { IssuerKit } from '@agoric/ertp';
|
|
24
28
|
import type { PriceAuthority } from '@agoric/zoe/tools/types.js';
|
|
25
29
|
//# sourceMappingURL=manualPriceAuthority.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manualPriceAuthority.d.ts","sourceRoot":"","sources":["manualPriceAuthority.js"],"names":[],"mappings":"
|
|
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"}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
// @jessie-check
|
|
2
2
|
|
|
3
|
-
import { AmountMath
|
|
3
|
+
import { AmountMath } from '@agoric/ertp';
|
|
4
|
+
import { makeNotifierKit } from '@agoric/notifier';
|
|
4
5
|
import { E } from '@endo/eventual-send';
|
|
5
6
|
import { Far } from '@endo/marshal';
|
|
6
|
-
import { makeNotifierKit } from '@agoric/notifier';
|
|
7
7
|
import {
|
|
8
|
-
makeOnewayPriceAuthorityKit,
|
|
9
|
-
floorMultiplyBy,
|
|
10
8
|
floorDivideBy,
|
|
9
|
+
floorMultiplyBy,
|
|
10
|
+
makeOnewayPriceAuthorityKit,
|
|
11
|
+
makePriceQuoteIssuer,
|
|
11
12
|
} from '../src/contractSupport/index.js';
|
|
12
13
|
|
|
13
14
|
/**
|
|
15
|
+
* @import {Amount, Brand, Issuer, IssuerKit, Payment, Purse} from '@agoric/ertp';
|
|
14
16
|
* @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js';
|
|
15
17
|
*/
|
|
16
18
|
|
|
@@ -20,7 +22,7 @@ import {
|
|
|
20
22
|
* @param {Brand<'nat'>} options.actualBrandOut
|
|
21
23
|
* @param {Ratio} options.initialPrice
|
|
22
24
|
* @param {import('@agoric/time').TimerService} options.timer
|
|
23
|
-
* @param {IssuerKit<'set'>} [options.quoteIssuerKit]
|
|
25
|
+
* @param {IssuerKit<'set', PriceDescription>} [options.quoteIssuerKit]
|
|
24
26
|
* @returns {PriceAuthority & { setPrice: (Ratio) => void; disable: () => void }}
|
|
25
27
|
*/
|
|
26
28
|
export function makeManualPriceAuthority(options) {
|
|
@@ -29,7 +31,7 @@ export function makeManualPriceAuthority(options) {
|
|
|
29
31
|
actualBrandOut,
|
|
30
32
|
initialPrice, // brandOut / brandIn
|
|
31
33
|
timer,
|
|
32
|
-
quoteIssuerKit =
|
|
34
|
+
quoteIssuerKit = makePriceQuoteIssuer(),
|
|
33
35
|
} = options;
|
|
34
36
|
const { brand, issuer: quoteIssuer, mint: quoteMint } = quoteIssuerKit;
|
|
35
37
|
|
|
@@ -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.
|
|
@@ -15,13 +18,14 @@
|
|
|
15
18
|
* @param {Issuer} feeIssuer
|
|
16
19
|
*/
|
|
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
|
-
publicFacet: {
|
|
21
|
+
publicFacet: object & {
|
|
19
22
|
query(query: OracleQuery): Promise<unknown>;
|
|
20
|
-
makeQueryInvitation(query: OracleQuery): Promise<Invitation<unknown, never>>;
|
|
23
|
+
makeQueryInvitation(query: OracleQuery): Promise<globalThis.Invitation<unknown, never>>;
|
|
21
24
|
} & import("@endo/pass-style").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.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scriptedPriceAuthority.d.ts","sourceRoot":"","sources":["scriptedPriceAuthority.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scriptedPriceAuthority.d.ts","sourceRoot":"","sources":["scriptedPriceAuthority.js"],"names":[],"mappings":"AAWA;;GAEG;AAEH,yEAoFC;oCAvF4F,4BAA4B"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { AmountMath
|
|
2
|
-
import { E } from '@endo/eventual-send';
|
|
3
|
-
import { Far } from '@endo/marshal';
|
|
1
|
+
import { AmountMath } from '@agoric/ertp';
|
|
4
2
|
import { observeNotifier } from '@agoric/notifier';
|
|
5
3
|
import { TimeMath } from '@agoric/time';
|
|
4
|
+
import { E } from '@endo/eventual-send';
|
|
5
|
+
import { Far } from '@endo/marshal';
|
|
6
6
|
import {
|
|
7
|
-
natSafeMath,
|
|
8
7
|
makeOnewayPriceAuthorityKit,
|
|
8
|
+
makePriceQuoteIssuer,
|
|
9
|
+
natSafeMath,
|
|
9
10
|
} from '../src/contractSupport/index.js';
|
|
10
11
|
|
|
11
12
|
/**
|
|
@@ -20,7 +21,7 @@ export function makeScriptedPriceAuthority(options) {
|
|
|
20
21
|
timer,
|
|
21
22
|
unitAmountIn = AmountMath.make(actualBrandIn, 1n),
|
|
22
23
|
quoteInterval = 1n,
|
|
23
|
-
quoteIssuerKit =
|
|
24
|
+
quoteIssuerKit = makePriceQuoteIssuer(),
|
|
24
25
|
} = options;
|
|
25
26
|
const { brand, issuer: quoteIssuer, mint: quoteMint } = quoteIssuerKit;
|
|
26
27
|
let currentPrice = priceList[0];
|
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
7
|
setVatAdminService: ((lateVatAdminSvc: any) => void) & import("@endo/pass-style").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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function withAmountUtils(kit: Pick<IssuerKit<"nat">, "brand" | "issuer" | "mint">): {
|
|
1
|
+
export function withAmountUtils(kit: Pick<IssuerKit<"nat", any>, "brand" | "issuer" | "mint">): {
|
|
2
2
|
/** @param {NatValue} v */
|
|
3
3
|
make: (v: NatValue) => import("@agoric/ertp").NatAmount;
|
|
4
4
|
makeEmpty: () => import("@agoric/ertp").NatAmount;
|
|
@@ -6,15 +6,19 @@ export function withAmountUtils(kit: Pick<IssuerKit<"nat">, "brand" | "issuer" |
|
|
|
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 */
|
|
13
|
-
issuerKit: Pick<
|
|
14
|
-
brand:
|
|
15
|
-
issuer:
|
|
16
|
-
mint: globalThis.Mint<"nat",
|
|
13
|
+
issuerKit: Pick<IssuerKit<"nat", any>, "brand" | "issuer" | "mint">;
|
|
14
|
+
brand: Brand<"nat">;
|
|
15
|
+
issuer: Issuer<"nat", any>;
|
|
16
|
+
mint: globalThis.Mint<"nat", any>;
|
|
17
17
|
};
|
|
18
18
|
export { makeFakeStorageKit } from "@agoric/internal/src/storage-test-utils.js";
|
|
19
19
|
export type AmountUtils = ReturnType<typeof withAmountUtils>;
|
|
20
|
+
import type { IssuerKit } from '@agoric/ertp';
|
|
21
|
+
import type { NatValue } from '@agoric/ertp';
|
|
22
|
+
import type { Brand } from '@agoric/ertp';
|
|
23
|
+
import type { Issuer } from '@agoric/ertp';
|
|
20
24
|
//# sourceMappingURL=test-utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-utils.d.ts","sourceRoot":"","sources":["test-utils.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"test-utils.d.ts","sourceRoot":"","sources":["test-utils.js"],"names":[],"mappings":"AAQO,qCADK,IAAI,CAAC,UAAU,KAAK,EAAE,GAAG,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAKhE,0BAA0B;cAAd,QAAQ;;IAGpB;;;OAGG;mBAFQ,QAAQ,MACR,QAAQ;IAGnB,wBAAwB;eAAZ,MAAM;IAGlB,+BAA+B;;;;;EAGlC;;0BACa,UAAU,CAAC,OAAO,eAAe,CAAC;+BAvB2B,cAAc;8BAAd,cAAc;2BAAd,cAAc;4BAAd,cAAc"}
|
package/tools/test-utils.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { AmountMath } from '@agoric/ertp';
|
|
2
|
-
import { makeRatio } from '../src/contractSupport/
|
|
2
|
+
import { makeRatio } from '../src/contractSupport/index.js';
|
|
3
3
|
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* @import {Amount, Brand, DepositFacet, Issuer, IssuerKit, NatValue} from '@agoric/ertp';
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/** @param {Pick<IssuerKit<'nat', any>, 'brand' | 'issuer' | 'mint'>} kit */
|
|
5
9
|
export const withAmountUtils = kit => {
|
|
6
10
|
const decimalPlaces = kit.issuer.getDisplayInfo?.()?.decimalPlaces ?? 6;
|
|
7
11
|
return {
|
package/tools/types.d.ts
CHANGED
|
@@ -139,4 +139,9 @@ export type PriceLevel = {
|
|
|
139
139
|
*/
|
|
140
140
|
amountOut: Amount<"nat">;
|
|
141
141
|
};
|
|
142
|
+
import type { Amount } from '@agoric/ertp';
|
|
143
|
+
import type { Payment } from '@agoric/ertp';
|
|
144
|
+
import type { Brand } from '@agoric/ertp';
|
|
145
|
+
import type { Issuer } from '@agoric/ertp';
|
|
146
|
+
import type { Notifier } from '@agoric/notifier';
|
|
142
147
|
//# sourceMappingURL=types.d.ts.map
|