forked from Agoric/agoric-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
closes Agoric#24
- Loading branch information
Showing
7 changed files
with
65 additions
and
54 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
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,34 @@ | ||
import harden from '@agoric/harden'; | ||
|
||
console.log(`=> loading bootstrap.js`); | ||
|
||
export default function setup(syscall, state, helpers) { | ||
function log(what) { | ||
helpers.log(what); | ||
console.log(what); | ||
} | ||
log(`=> setup called`); | ||
return helpers.makeLiveSlots( | ||
syscall, | ||
state, | ||
E => | ||
harden({ | ||
bootstrap(argv, vats) { | ||
console.log('=> bootstrap() called'); | ||
E(vats.user) | ||
.talkToBot(vats.bot, 'encouragementBot') | ||
.then( | ||
r => | ||
log( | ||
`=> the promise given by the call to user.talkToBot resolved to '${r}'`, | ||
), | ||
err => | ||
log( | ||
`=> the promise given by the call to user.talkToBot was rejected '${err}''`, | ||
), | ||
); | ||
}, | ||
}), | ||
helpers.vatID, | ||
); | ||
} |
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
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 harden from '@agoric/harden'; | ||
|
||
export default function setup(syscall, state, helpers) { | ||
function log(what) { | ||
helpers.log(what); | ||
console.log(what); | ||
} | ||
return helpers.makeLiveSlots( | ||
syscall, | ||
state, | ||
E => | ||
harden({ | ||
talkToBot(bot, botName) { | ||
log(`=> user.talkToBot is called with ${botName}`); | ||
E(bot) | ||
.encourageMe('user') | ||
.then(myEncouragement => | ||
log(`=> user receives the encouragement: ${myEncouragement}`), | ||
); | ||
return 'Thanks for the setup. I sure hope I get some encouragement...'; | ||
}, | ||
}), | ||
helpers.vatID, | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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