Commit 4ef01e25f0db10ce812670a695cf71a5ac9aba76
update deps and tests
Norton Wang committed on 4/29/2018, 2:08:20 PMParent: af575337e9eaa5b2166aeec5170d6368494c9404
Files changed
actor.js | changed |
package-lock.json | changed |
package.json | changed |
tests/index.js | changed |
actor.js | ||
---|---|---|
@@ -70,21 +70,31 @@ | ||
70 | 70 … | } |
71 | 71 … | this.ticks += count |
72 | 72 … | } |
73 | 73 … | |
74 … | + /** | |
75 … | + * creates an actor from a module and code | |
76 … | + * @param {Module} mod - the module | |
77 … | + * @param {Buffer} code - the code | |
78 … | + */ | |
74 | 79 … | newActor (mod, code) { |
75 | 80 … | const modRef = this.createModule(mod, code) |
76 | 81 … | return this.createActor(modRef) |
77 | 82 … | } |
78 | 83 … | |
84 … | + /** | |
85 … | + * creates a modref from a module and code | |
86 … | + * @param {Module} mod - the module | |
87 … | + * @param {Buffer} code - the code | |
88 … | + */ | |
79 | 89 … | createModule (mod, code) { |
80 | 90 … | const id = this._generateNextId() |
81 | 91 … | return this.hypervisor.createModule(mod, code, id) |
82 | 92 … | } |
93 … | + | |
83 | 94 … | /** |
84 | - * creates an actor | |
85 | - * @param {Integer} type - the type id for the container | |
86 | - * @param {Object} message - an intial [message](https://github.com/primea/js-primea-message) to send newly created actor | |
95 … | + * creates an actor from a modref | |
96 … | + * @param {ModuleRef} modRef - the modref | |
87 | 97 … | */ |
88 | 98 … | createActor (modRef) { |
89 | 99 … | const id = this._generateNextId() |
90 | 100 … | return this.hypervisor.createActor(modRef, id) |
package-lock.json | ||
---|---|---|
The diff is too large to show. Use a local git client to view these changes. Old file size: 352329 bytes New file size: 350733 bytes |
package.json | ||
---|---|---|
@@ -30,9 +30,9 @@ | ||
30 | 30 … | "license": "MPL-2.0", |
31 | 31 … | "dependencies": { |
32 | 32 … | "binary-search-insert": "^1.0.3", |
33 | 33 … | "events": "^2.0.0", |
34 | - "primea-objects": "0.0.5", | |
34 … | + "primea-objects": "0.0.6", | |
35 | 35 … | "safe-buffer": "^5.1.2" |
36 | 36 … | }, |
37 | 37 … | "devDependencies": { |
38 | 38 … | "coveralls": "^3.0.0", |
tests/index.js | ||
---|---|---|
@@ -51,13 +51,13 @@ | ||
51 | 51 … | } |
52 | 52 … | load () { |
53 | 53 … | const loadedID = this.actor.storage[0].id.toString('hex') |
54 | 54 … | const link = this.actor.storage[1] |
55 | - // const loadedMod = this.actor.storage[2] | |
55 … | + const loadedMod = this.actor.storage[2] | |
56 | 56 … | const loadedFuncref = this.actor.storage[3] |
57 | 57 … | t.equals(id, loadedID, 'should load id correctly') |
58 | 58 … | t.equals(link['/'].toString('hex'), '6fe3180f700090697285ac1e0e8dc400259373d7', 'should load link correctly') |
59 | - // t.deepEquals(loadedMod, mod) | |
59 … | + t.deepEquals(loadedMod, mod) | |
60 | 60 … | t.deepEquals(funcref, loadedFuncref) |
61 | 61 … | } |
62 | 62 … | } |
63 | 63 … |
Built with git-ssb-web