git ssb

0+

wanderer🌟 / js-primea-hypervisor



Commit e7082de1f1be0792df1a00c4efb43344119a6e11

updated deps

wanderer committed on 5/18/2018, 12:04:00 AM
Parent: 6bb7e160de386c6d753687b4ede2c14555ab5364

Files changed

benchmark/index.jschanged
package-lock.jsonchanged
package.jsonchanged
tests/index.jschanged
benchmark/index.jsView
@@ -9,14 +9,17 @@
99 constructor (actor) {
1010 this.actor = actor
1111 }
1212 onStartup () {}
13- static onCreation (code, id) {
13 + static onCreation (code) {
1414 const exp = {}
1515 Object.getOwnPropertyNames(this.prototype).filter(name => name !== 'constructor').forEach(name => {
1616 exp[name] = {}
1717 })
18- return new ModuleRef(exp, id)
18 + return {
19 + exports: exp,
20 + state: []
21 + }
1922 }
2023 onMessage (message) {
2124 return this[message.funcRef.identifier[1]](...message.funcArguments)
2225 }
@@ -46,16 +49,16 @@
4649 }
4750 }
4851 }
4952
50- const hypervisor = new Hypervisor({tree})
51- hypervisor.registerContainer(BenchmarkContainer)
53 + const hypervisor = new Hypervisor({tree, meter: false})
54 + hypervisor.registerModule(BenchmarkContainer)
5255
5356 const refernces = []
5457 let _numOfActors = numOfActors
5558 while (_numOfActors--) {
56- const {module} = hypervisor.createActor(BenchmarkContainer.typeId)
57- const funcRef = module.getFuncRef('main')
59 + const actor = hypervisor.newActor(BenchmarkContainer)
60 + const funcRef = actor.getFuncRef('main')
5861 funcRef.gas = 1000
5962 refernces.push(funcRef)
6063 }
6164 _numOfActors = numOfActors
package-lock.jsonView
The diff is too large to show. Use a local git client to view these changes.
Old file size: 348845 bytes
New file size: 347609 bytes
package.jsonView
@@ -31,17 +31,17 @@
3131 "dependencies": {
3232 "binary-search-insert": "^1.0.3",
3333 "debug": "^3.1.0",
3434 "events": "^2.0.0",
35- "primea-objects": "0.1.0",
35 + "primea-objects": "0.1.1",
3636 "safe-buffer": "^5.1.2"
3737 },
3838 "devDependencies": {
3939 "coveralls": "^3.0.1",
40- "dfinity-radix-tree": "^0.2.3",
41- "documentation": "^6.3.2",
40 + "dfinity-radix-tree": "^0.2.4",
41 + "documentation": "^6.3.3",
4242 "level-browserify": "^1.1.2",
43- "nyc": "^11.7.1",
43 + "nyc": "^11.8.0",
4444 "standard": "11.0.1",
4545 "tape": "^4.9.0"
4646 }
4747 }
tests/index.jsView
@@ -79,9 +79,9 @@
7979 })
8080
8181 tape('basic', async t => {
8282 // t.plan(2)
83- const expectedState = Buffer.from('757b51d7da3195f9bb9d211c8fd382fc526b31e6', 'hex')
83 + const expectedState = Buffer.from('be8e779df9d2ba23e5a6fcb3e551708cbc0fde82', 'hex')
8484 const tree = new RadixTree({
8585 db
8686 })
8787
@@ -109,9 +109,9 @@
109109 })
110110
111111 tape('two communicating actors', async t => {
112112 t.plan(2)
113- const expectedState = Buffer.from('dc389dcfe9350e2fd0a570ca4e0c9dba801dc7ca', 'hex')
113 + const expectedState = Buffer.from('25bc7e81511bfded44a1846f4bca1acc99f24273', 'hex')
114114
115115 const tree = new RadixTree({
116116 db
117117 })
@@ -156,9 +156,9 @@
156156 })
157157
158158 tape('three communicating actors', async t => {
159159 t.plan(3)
160- const expectedState = Buffer.from('916a9ce593fdd553723118ca82d11caa28b76e99', 'hex')
160 + const expectedState = Buffer.from('862f3393675dd33fb7e9b93b43aac7a9131ef665', 'hex')
161161 const tree = new RadixTree({
162162 db: db
163163 })
164164
@@ -206,9 +206,9 @@
206206 })
207207
208208 tape('three communicating actors, with tick counting', async t => {
209209 t.plan(3)
210- const expectedState = Buffer.from('916a9ce593fdd553723118ca82d11caa28b76e99', 'hex')
210 + const expectedState = Buffer.from('862f3393675dd33fb7e9b93b43aac7a9131ef665', 'hex')
211211 const tree = new RadixTree({
212212 db
213213 })
214214
@@ -261,9 +261,9 @@
261261 })
262262
263263 tape('errors', async t => {
264264 t.plan(3)
265- const expectedState = Buffer.from('dc389dcfe9350e2fd0a570ca4e0c9dba801dc7ca', 'hex')
265 + const expectedState = Buffer.from('25bc7e81511bfded44a1846f4bca1acc99f24273', 'hex')
266266 const tree = new RadixTree({
267267 db
268268 })
269269
@@ -359,9 +359,9 @@
359359 })
360360
361361 tape('actor creation', async t => {
362362 t.plan(2)
363- const expectedState = Buffer.from('aa0089210c2ee081f299c84a31b55898e4aad339', 'hex')
363 + const expectedState = Buffer.from('007c3ef07195d2c3959f22f1d2719ed4f4e4193a', 'hex')
364364
365365 const tree = new RadixTree({
366366 db
367367 })
@@ -404,9 +404,9 @@
404404 })
405405
406406 tape('simple message arbiter test', async t => {
407407 t.plan(4)
408- const expectedState = Buffer.from('dc389dcfe9350e2fd0a570ca4e0c9dba801dc7ca', 'hex')
408 + const expectedState = Buffer.from('25bc7e81511bfded44a1846f4bca1acc99f24273', 'hex')
409409 const tree = new RadixTree({
410410 db
411411 })
412412
@@ -472,9 +472,9 @@
472472
473473 tape('arbiter test for id comparision', async t => {
474474 t.plan(5)
475475 let message
476- const expectedState = Buffer.from('916a9ce593fdd553723118ca82d11caa28b76e99', 'hex')
476 + const expectedState = Buffer.from('862f3393675dd33fb7e9b93b43aac7a9131ef665', 'hex')
477477
478478 const tree = new RadixTree({
479479 db: db
480480 })
@@ -540,9 +540,9 @@
540540 })
541541
542542 tape('async work', async t => {
543543 t.plan(3)
544- const expectedState = Buffer.from('dc389dcfe9350e2fd0a570ca4e0c9dba801dc7ca', 'hex')
544 + const expectedState = Buffer.from('25bc7e81511bfded44a1846f4bca1acc99f24273', 'hex')
545545
546546 const tree = new RadixTree({
547547 db
548548 })

Built with git-ssb-web