Skip to content

Commit

Permalink
fix: revert overspill from PR #1577
Browse files Browse the repository at this point in the history
  • Loading branch information
erights committed Aug 31, 2020
1 parent 7795f93 commit ba820ec
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions packages/SwingSet/test/test-exomessages.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import '@agoric/install-ses';
import { REMOTE_STYLE } from '@agoric/marshal';
import { 'presence' } from '@agoric/marshal';
import test from 'ava';
import { buildVatController } from '../src/index';

Expand Down Expand Up @@ -40,7 +40,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 +104,7 @@ test('extra message returns presence', async t => {
// prettier-ignore
await extraMessage(
t,
REMOTE_STYLE,
'presence',
'fulfilled',
'{"@qclass":"slot",index:0}',
['ko25'],
Expand Down
8 changes: 4 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,7 @@
/* global harden */

import '@agoric/install-ses';
import { REMOTE_STYLE } from '@agoric/marshal';
import { 'presence' } from '@agoric/marshal';
import test from 'ava';
import anylogger from 'anylogger';
import { initSwingStore } from '@agoric/swing-store-simple';
Expand Down Expand Up @@ -91,7 +91,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 +103,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 +128,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
18 changes: 9 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,7 @@ import test from 'ava';

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

const RETIRE_VPIDS = true;
Expand Down Expand Up @@ -101,7 +101,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 +112,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 +149,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 +516,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 +537,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 +553,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 +639,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 +683,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: 2 additions & 2 deletions packages/SwingSet/test/vat-exomessages.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* global harden */

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

export function buildRootObject(_vatPowers, vatParameters) {
const other = harden({
Expand All @@ -12,7 +12,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

0 comments on commit ba820ec

Please sign in to comment.