Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert overspill from PR #1577 #1647

Merged
merged 2 commits into from
Aug 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions packages/SwingSet/test/test-exomessages.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import '@agoric/install-ses';
import { REMOTE_STYLE } from '@agoric/marshal';
import test from 'ava';
import { buildVatController } from '../src/index';

Expand Down Expand Up @@ -40,7 +39,7 @@ test('bootstrap returns presence', async t => {
// prettier-ignore
await bootstrapSuccessfully(
t,
REMOTE_STYLE,
'presence',
'{"@qclass":"slot",index:0}',
['ko25'],
);
Expand Down Expand Up @@ -104,7 +103,7 @@ test('extra message returns presence', async t => {
// prettier-ignore
await extraMessage(
t,
REMOTE_STYLE,
'presence',
'fulfilled',
'{"@qclass":"slot",index:0}',
['ko25'],
Expand Down
7 changes: 3 additions & 4 deletions packages/SwingSet/test/test-vpid-kernel.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/* global harden */

import '@agoric/install-ses';
import { REMOTE_STYLE } from '@agoric/marshal';
import test from 'ava';
import anylogger from 'anylogger';
import { initSwingStore } from '@agoric/swing-store-simple';
Expand Down Expand Up @@ -91,7 +90,7 @@ function buildRawVat(name, kernel, onDispatchCallback = undefined) {
// ways:
// prettier-ignore
const modes = [
REMOTE_STYLE, // resolveToPresence: messages can be sent to resolution
'presence', // resolveToPresence: messages can be sent to resolution
'local-object', // resolve to a local object: messages to resolution don't create syscalls
'data', // resolveToData: messages are rejected as DataIsNotCallable
'promise-data', // resolveToData that contains a promise ID
Expand All @@ -103,7 +102,7 @@ const slot0arg = { '@qclass': 'slot', index: 0 };

function doResolveSyscall(syscallA, vpid, mode, targets) {
switch (mode) {
case REMOTE_STYLE:
case 'presence':
syscallA.fulfillToPresence(vpid, targets.target2);
break;
case 'local-object':
Expand All @@ -128,7 +127,7 @@ function doResolveSyscall(syscallA, vpid, mode, targets) {

function resolutionOf(vpid, mode, targets) {
switch (mode) {
case REMOTE_STYLE:
case 'presence':
return {
type: 'notifyFulfillToPresence',
promiseID: vpid,
Expand Down
17 changes: 8 additions & 9 deletions packages/SwingSet/test/test-vpid-liveslots.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import test from 'ava';

import { E } from '@agoric/eventual-send';
import { makePromiseKit } from '@agoric/promise-kit';
import { REMOTE_STYLE } from '@agoric/marshal';
import { makeLiveSlots } from '../src/kernel/liveSlots';

const RETIRE_VPIDS = true;
Expand Down Expand Up @@ -101,7 +100,7 @@ function hush(p) {
// In addition, we want to exercise the promises being resolved in various
// ways:
const modes = [
REMOTE_STYLE, // resolveToPresence, messages can be sent to resolution
'presence', // resolveToPresence, messages can be sent to resolution
'local-object', // resolve to a local object, messages can be sent but do
// // not create syscalls
'data', // resolveToData, messages are rejected as DataIsNotCallable
Expand All @@ -112,7 +111,7 @@ const modes = [

function resolvePR(pr, mode, targets) {
switch (mode) {
case REMOTE_STYLE:
case 'presence':
pr.resolve(targets.target2);
break;
case 'local-object':
Expand Down Expand Up @@ -149,7 +148,7 @@ const slot1arg = { '@qclass': 'slot', index: 1 };

function resolutionOf(vpid, mode, targets) {
switch (mode) {
case REMOTE_STYLE:
case 'presence':
return {
type: 'fulfillToPresence',
promiseID: vpid,
Expand Down Expand Up @@ -516,7 +515,7 @@ async function doVatResolveCase23(t, which, mode, stalls) {
// resolution target. If that target is a Presence, we'll see a syscall,
// otherwise the vat handles it internally.

if (mode === REMOTE_STYLE) {
if (mode === 'presence') {
t.deepEqual(log.shift(), {
type: 'send',
targetSlot: target2,
Expand All @@ -537,7 +536,7 @@ async function doVatResolveCase23(t, which, mode, stalls) {
t.deepEqual(log, []);

// assert that the vat saw the local promise being resolved too
if (mode === REMOTE_STYLE) {
if (mode === 'presence') {
t.is(resolutionOfP1.toString(), `[Alleged: presence ${target2}]`);
} else if (mode === 'data') {
t.is(resolutionOfP1, 4);
Expand All @@ -553,7 +552,7 @@ async function doVatResolveCase23(t, which, mode, stalls) {

// uncomment this when debugging specific problems
// test.only(`XX`, async t => {
// await doVatResolveCase23(t, 2, REMOTE_STYLE, 0);
// await doVatResolveCase23(t, 2, 'presence', 0);
// });

for (const caseNum of [2, 3]) {
Expand Down Expand Up @@ -639,7 +638,7 @@ async function doVatResolveCase4(t, mode) {
t.deepEqual(log.shift(), { type: 'subscribe', target: expectedP3 });
t.deepEqual(log, []);

if (mode === REMOTE_STYLE) {
if (mode === 'presence') {
dispatch.notifyFulfillToPresence(p1, target2);
} else if (mode === 'local-object') {
dispatch.notifyFulfillToPresence(p1, rootA);
Expand Down Expand Up @@ -683,7 +682,7 @@ async function doVatResolveCase4(t, mode) {
target: expectedResultOfThree,
});

if (mode === REMOTE_STYLE) {
if (mode === 'presence') {
const expectedP6 = nextP();
t.deepEqual(log.shift(), {
type: 'send',
Expand Down
4 changes: 1 addition & 3 deletions packages/SwingSet/test/vat-exomessages.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/* global harden */

import { REMOTE_STYLE } from '@agoric/marshal';

export function buildRootObject(_vatPowers, vatParameters) {
const other = harden({
something(arg) {
Expand All @@ -12,7 +10,7 @@ export function buildRootObject(_vatPowers, vatParameters) {
function behave(mode) {
if (mode === 'data') {
return 'a big hello to all intelligent lifeforms everywhere';
} else if (mode === REMOTE_STYLE) {
} else if (mode === 'presence') {
return other;
} else if (mode === 'reject') {
throw new Error('gratuitous error');
Expand Down