-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(swingset): add failing test for #3264
- Loading branch information
Showing
3 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { E } from '@agoric/eventual-send'; | ||
import { makePromiseKit } from '@agoric/promise-kit'; | ||
import { Far } from '@agoric/marshal'; | ||
|
||
export function buildRootObject() { | ||
const pk1 = makePromiseKit(); | ||
return Far('root', { | ||
bootstrap(vats) { | ||
const p2 = E(vats.right).one(); // p2 is kp41 | ||
E(p2).four(pk1.promise); | ||
// that puts an unresolved promise in the arguments of the promise | ||
// queue for p2 | ||
}, | ||
two() { | ||
pk1.resolve(3); | ||
// The promise is resolved and retired from our clist, the only | ||
// remaining reference is from the p2 promise queue | ||
}, | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Far } from '@agoric/marshal'; | ||
import { makePromiseKit } from '@agoric/promise-kit'; | ||
|
||
export function buildRootObject() { | ||
const pk3 = makePromiseKit(); | ||
const pk4 = makePromiseKit(); | ||
const t2 = Far('t2', { | ||
four(arg) { | ||
// arg should be a Promise that promptly resolves to 4 | ||
const argP = Promise.resolve(arg); | ||
const wasP = argP === arg; | ||
argP.then(newArg => pk4.resolve([wasP, newArg])); | ||
}, | ||
}); | ||
|
||
return Far('root', { | ||
one() { | ||
return pk3.promise; | ||
}, | ||
three() { | ||
pk3.resolve(t2); | ||
return pk4.promise; | ||
}, | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters