Skip to content

Commit

Permalink
fixup to test without a new contract
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Sep 16, 2024
1 parent f283047 commit d232c8d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 117 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { E } from '@endo/far';
const trace = makeTracer('StartBuggySA', true);

/**
* @import {start as StartFn} from '@agoric/orchestration/src/examples/buggy-sendAnywhere.contract.js';
* @import {start as StartFn} from '@agoric/orchestration/src/examples/send-anywhere.contract.js';
*/

/**
Expand Down
22 changes: 17 additions & 5 deletions packages/builders/scripts/testing/start-buggy-sendAnywhere.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
makeTracer,
NonNullish,
} from '@agoric/internal';
import { E } from '@endo/far';
import { E, Far } from '@endo/far';

/// <reference types="@agoric/vats/src/core/types-ambient"/>
/**
Expand All @@ -17,7 +17,7 @@ import { E } from '@endo/far';
const trace = makeTracer('StartBuggySA', true);

/**
* @import {start as StartFn} from '@agoric/orchestration/src/examples/buggy-sendAnywhere.contract.js';
* @import {start as StartFn} from '@agoric/orchestration/src/examples/send-anywhere.contract.js';
*/

/**
Expand Down Expand Up @@ -64,18 +64,30 @@ export const startSendAnywhere = async ({
}),
);

const agoricNamesHangs = Far('agoricNames that hangs', {
// ...privateArgs.agoricNames,
lookup: async () => {
trace('agoricNames.lookup being called that will never resolve');
// BUG: this never resolves
return new Promise(() => {});
},
});

const { instance } = await E(startUpgradable)({
label: 'sendAnywhere',
installation: sendAnywhere,
privateArgs,
privateArgs: {
...privateArgs,
agoricNames: agoricNamesHangs,
},
});
produceInstance.resolve(instance);
trace('done');
};
harden(startSendAnywhere);

export const getManifestForValueVow = ({ restoreRef }, { sendAnywhereRef }) => {
console.log('sendAnywhereRef', sendAnywhereRef);
trace('sendAnywhereRef', sendAnywhereRef);
return {
manifest: {
[startSendAnywhere.name]: {
Expand Down Expand Up @@ -113,7 +125,7 @@ export const defaultProposalBuilder = async ({ publishRef, install }) =>
{
sendAnywhereRef: publishRef(
install(
'@agoric/orchestration/src/examples/buggy-sendAnywhere.contract.js',
'@agoric/orchestration/src/examples/send-anywhere.contract.js',
),
),
},
Expand Down
110 changes: 0 additions & 110 deletions packages/orchestration/src/examples/buggy-sendAnywhere.contract.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ harden(SingleAmountRecord);
* @param {Zone} zone
* @param {OrchestrationTools} tools
*/
const contract = async (
export const contract = async (
zcf,
privateArgs,
zone,
Expand Down Expand Up @@ -69,6 +69,7 @@ const contract = async (

return { publicFacet, creatorFacet };
};
harden(contract);

export const start = withOrchestration(contract);
harden(start);

0 comments on commit d232c8d

Please sign in to comment.