@agoric/zoe
Version:
Zoe: the Smart Contract Framework for Offer Enforcement
31 lines • 1.68 kB
TypeScript
/**
* @import {ZoeService} from '../src/types-index.js';
*/
/**
* Start an instance of an Oracle that follows a script. The Oracle has access
* to a timer, and looks in the script for events indexed by the current time.
* It responds to onQuery() by reporting any current event. This is intended to
* be useful for tests.
* The queries return an object that has fields { event, time, query }. event is
* whatever was in the script indexed by the time. The query is returned in the
* result, but has no impact on the result. If the script has no entry for the
* time, the event is 'nothing to report'.
*
* @param {Record<string, any>} script
* @param {Installation<import('../src/contracts/oracle.js').OracleStart>} oracleInstallation
* @param {import('@agoric/time').TimerService} timer
* @param {ZoeService} zoe
* @param {Issuer} feeIssuer
*/
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<{
publicFacet: object & {
query(query: OracleQuery): Promise<unknown>;
makeQueryInvitation(query: OracleQuery): Promise<globalThis.Invitation<unknown, never>>;
} & RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
query(query: OracleQuery): Promise<unknown>;
makeQueryInvitation(query: OracleQuery): Promise<globalThis.Invitation<unknown, never>>;
}>;
creatorFacet: OracleCreatorFacet;
}>;
import type { ZoeService } from '../src/types-index.js';
//# sourceMappingURL=scriptedOracle.d.ts.map