Skip to content

Commit

Permalink
fix: remove ancient 'resolver' vatSlot type
Browse files Browse the repository at this point in the history
A long long time ago, we represented both Promises and their associated
Resolver as distinct reference types (`p+NN` and `r+NN`). We've since changed
the model to only represent Promises, and to track who has resolution
authority by watching the `p+NN` references get used in the `result:` field
of messages going back and forth.

Apparently I forgot to delete the code in `parseVatSlots.js` which classified
`r+NN` as a resolver.
  • Loading branch information
warner committed Sep 15, 2020
1 parent 3a98491 commit 4adcd58
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions packages/SwingSet/src/parseVatSlots.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { assert } from '@agoric/assert';
/**
* Parse a vat slot reference string into a vat slot object:
* {
* type: STRING, // 'object', 'device', 'promise', or 'resolver'
* type: STRING, // 'object', 'device', 'promise'
* allocatedByVat: BOOL, // true=>allocated by vat, false=>by the kernel
* id: Nat
* }
Expand All @@ -47,8 +47,6 @@ export function parseVatSlot(s) {
type = 'device';
} else if (typechar === 'p') {
type = 'promise';
} else if (typechar === 'r') {
type = 'resolver';
} else {
throw new Error(`invalid vatSlot ${s}`);
}
Expand All @@ -68,7 +66,7 @@ export function parseVatSlot(s) {
/**
* Generate a vat slot reference string given a type, ownership, and id.
*
* @param type The type, 'object', 'device', 'promise', or 'resolver'
* @param type The type, 'object', 'device', 'promise'
* @param allocatedByVat Flag: true=>vat allocated, false=>kernel allocated
* @param id The id, a Nat.
*
Expand All @@ -93,9 +91,6 @@ export function makeVatSlot(type, allocatedByVat, id) {
if (type === 'promise') {
return `p${idSuffix}`;
}
if (type === 'resolver') {
return `r${idSuffix}`;
}
throw new Error(`unknown type ${type}`);
}

Expand Down

0 comments on commit 4adcd58

Please sign in to comment.