agoric-labs / PlaygroundVat

OBSOLETE prototype Vat host: use SwingSet instead
Apache License 2.0
30 stars 5 forks source link

use require() instead of global Nat/def/harden #33

Closed warner closed 5 years ago

warner commented 5 years ago

This changes the Vat code to use SES's new s.makeRequire() helper, so both host and guest code can use things like Nat = require('@agoric/nat') and harden = require('@agoric/harden'). When guest code with these imports is run outside of SES, they get the usual npm versions. When it runs inside SES, it gets corresponding in-realm objects, so we can write unit tests of the individual pieces without having to go through hoops.

refs #19