wao 0.4.1 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cjs/aoconnect.js CHANGED
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.connect = void 0;
8
8
  var _warpArbundles = require("warp-arbundles");
9
+ var _crypto = _interopRequireDefault(require("crypto"));
9
10
  var _base64url = _interopRequireDefault(require("base64url"));
10
11
  var _utils = require("./utils.js");
11
12
  var _armem = _interopRequireDefault(require("./armem.js"));
@@ -185,7 +186,7 @@ var connect = exports.connect = function connect(mem) {
185
186
  }();
186
187
  var spawn = /*#__PURE__*/function () {
187
188
  var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
188
- var _opt$module, _opt$tags;
189
+ var _opt$module, _opt$tags, _opt$tags2;
189
190
  var opt,
190
191
  mod,
191
192
  __dirname,
@@ -264,9 +265,18 @@ var connect = exports.connect = function connect(mem) {
264
265
  }
265
266
  throw Error("module not found");
266
267
  case 17:
268
+ opt.tags = (0, _utils.buildTags)(null, (0, _ramda.mergeLeft)((0, _utils.tags)((_opt$tags = opt.tags) !== null && _opt$tags !== void 0 ? _opt$tags : []), {
269
+ "Data-Protocol": "ao",
270
+ Variant: "ao.TN.1",
271
+ Type: "Process",
272
+ SDK: "aoconnect",
273
+ Module: opt.module,
274
+ Scheduler: opt.scheduler,
275
+ "Content-Type": "text/plain"
276
+ }));
267
277
  _module = mem.modmap[mod];
268
278
  ex = false;
269
- (_opt$tags = opt.tags) !== null && _opt$tags !== void 0 ? _opt$tags : opt.tags = [];
279
+ (_opt$tags2 = opt.tags) !== null && _opt$tags2 !== void 0 ? _opt$tags2 : opt.tags = [];
270
280
  _iterator = _createForOfIteratorHelper(opt.tags);
271
281
  try {
272
282
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
@@ -282,27 +292,29 @@ var connect = exports.connect = function connect(mem) {
282
292
  name: "Type",
283
293
  value: "Process"
284
294
  });
285
- _context2.next = 25;
295
+ _context2.next = 26;
286
296
  return ar.dataitem({
287
297
  data: opt.data,
288
298
  signer: opt.signer,
289
299
  tags: (0, _utils.tags)(opt.tags)
290
300
  });
291
- case 25:
301
+ case 26:
292
302
  _yield$ar$dataitem2 = _context2.sent;
293
303
  id = _yield$ar$dataitem2.id;
294
304
  owner = _yield$ar$dataitem2.owner;
295
305
  item = _yield$ar$dataitem2.item;
296
- _context2.next = 31;
306
+ _context2.next = 32;
297
307
  return ar.postItem(item, _test.su.jwk);
298
- case 31:
308
+ case 32:
299
309
  _tags = (0, _utils.tags)(opt.tags);
300
310
  res = null;
301
311
  memory = null;
302
312
  p = {
303
313
  id: id,
314
+ epochs: [],
304
315
  handle: _module.handle,
305
316
  module: _module.id,
317
+ hash: id,
306
318
  memory: memory,
307
319
  owner: owner,
308
320
  height: 0,
@@ -312,7 +324,7 @@ var connect = exports.connect = function connect(mem) {
312
324
  opt: opt
313
325
  };
314
326
  if (!_tags["On-Boot"]) {
315
- _context2.next = 49;
327
+ _context2.next = 50;
316
328
  break;
317
329
  }
318
330
  data = "";
@@ -325,51 +337,51 @@ var connect = exports.connect = function connect(mem) {
325
337
  auth: _test.mu.addr
326
338
  });
327
339
  _t = (0, _utils.tags)(msg.Tags);
328
- _context2.next = 43;
340
+ _context2.next = 44;
329
341
  return _module.handle(null, msg, _env);
330
- case 43:
342
+ case 44:
331
343
  res = _context2.sent;
332
344
  p.memory = res.Memory;
333
345
  delete res.Memory;
334
346
  p.res[id] = res;
335
- _context2.next = 50;
347
+ _context2.next = 51;
336
348
  break;
337
- case 49:
338
- p.height += 1;
339
349
  case 50:
350
+ p.height += 1;
351
+ case 51:
340
352
  mem.msgs[id] = opt;
341
353
  mem.env[id] = p;
342
354
  if (!_tags["Cron-Interval"]) {
343
- _context2.next = 76;
355
+ _context2.next = 77;
344
356
  break;
345
357
  }
346
358
  _tags$CronInterval$s = _tags["Cron-Interval"].split("-"), _tags$CronInterval$s2 = _slicedToArray(_tags$CronInterval$s, 2), num = _tags$CronInterval$s2[0], unit = _tags$CronInterval$s2[1];
347
359
  _int = 0;
348
360
  _context2.t0 = unit.replace(/s$/, "");
349
- _context2.next = _context2.t0 === "millisecond" ? 58 : _context2.t0 === "second" ? 60 : _context2.t0 === "minute" ? 62 : _context2.t0 === "hour" ? 64 : _context2.t0 === "day" ? 66 : _context2.t0 === "month" ? 68 : _context2.t0 === "year" ? 70 : 72;
361
+ _context2.next = _context2.t0 === "millisecond" ? 59 : _context2.t0 === "second" ? 61 : _context2.t0 === "minute" ? 63 : _context2.t0 === "hour" ? 65 : _context2.t0 === "day" ? 67 : _context2.t0 === "month" ? 69 : _context2.t0 === "year" ? 71 : 73;
350
362
  break;
351
- case 58:
363
+ case 59:
352
364
  _int = num;
353
- return _context2.abrupt("break", 72);
354
- case 60:
365
+ return _context2.abrupt("break", 73);
366
+ case 61:
355
367
  _int = num * 1000;
356
- return _context2.abrupt("break", 72);
357
- case 62:
368
+ return _context2.abrupt("break", 73);
369
+ case 63:
358
370
  _int = num * 1000 * 60;
359
- return _context2.abrupt("break", 72);
360
- case 64:
371
+ return _context2.abrupt("break", 73);
372
+ case 65:
361
373
  _int = num * 1000 * 60 * 60;
362
- return _context2.abrupt("break", 72);
363
- case 66:
374
+ return _context2.abrupt("break", 73);
375
+ case 67:
364
376
  _int = num * 1000 * 60 * 60 * 24;
365
- return _context2.abrupt("break", 72);
366
- case 68:
377
+ return _context2.abrupt("break", 73);
378
+ case 69:
367
379
  _int = num * 1000 * 60 * 60 * 24 * 30;
368
- return _context2.abrupt("break", 72);
369
- case 70:
380
+ return _context2.abrupt("break", 73);
381
+ case 71:
370
382
  _int = num * 1000 * 60 * 60 * 24 * 365;
371
- return _context2.abrupt("break", 72);
372
- case 72:
383
+ return _context2.abrupt("break", 73);
384
+ case 73:
373
385
  cronTags = [];
374
386
  for (k in _tags) {
375
387
  if (/^Cron-Tag-/.test(k)) {
@@ -381,9 +393,9 @@ var connect = exports.connect = function connect(mem) {
381
393
  }
382
394
  mem.env[id].cronTags = cronTags;
383
395
  mem.env[id].span = _int;
384
- case 76:
385
- return _context2.abrupt("return", id);
386
396
  case 77:
397
+ return _context2.abrupt("return", id);
398
+ case 78:
387
399
  case "end":
388
400
  return _context2.stop();
389
401
  }
@@ -393,125 +405,242 @@ var connect = exports.connect = function connect(mem) {
393
405
  return _ref6.apply(this, arguments);
394
406
  };
395
407
  }();
396
- var assign = /*#__PURE__*/function () {
408
+ function genHashChain(previousHash) {
409
+ var previousMessageId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
410
+ var hasher = _crypto["default"].createHash("sha256");
411
+ hasher.update(Buffer.from(previousHash, "base64url"));
412
+ if (previousMessageId) {
413
+ hasher.update(Buffer.from(previousMessageId, "base64url"));
414
+ }
415
+ return (0, _base64url["default"])(hasher.digest());
416
+ }
417
+ var _assign = /*#__PURE__*/function () {
397
418
  var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(opt) {
398
- var p, _opt, _yield$ar$dataitem3, id, owner, item, _opt$data2, _opt$from, _res$Messages, msg, _env, res, _iterator2, _step2, v;
419
+ var _opt$tags3;
420
+ var p, _opt, hash, _yield$ar$dataitem3, id, owner, item, _opt$data2, _ref8, _opt$from, _res$Messages, _res$Spawns, _res$Assignments, msg, _env, res, _iterator2, _step2, v, _iterator3, _step3, _v, _tags, _iterator4, _step4, _v2, _iterator5, _step5, v2;
399
421
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
400
422
  while (1) switch (_context3.prev = _context3.next) {
401
423
  case 0:
402
424
  p = mem.env[opt.process];
403
- _opt = (0, _ramda.clone)(mem.msgs[opt.message]);
404
- _context3.next = 4;
425
+ _opt = mem.msgs[opt.message];
426
+ hash = genHashChain(p.hash, opt.message);
427
+ p.hash = hash;
428
+ opt.tags = (0, _utils.buildTags)(null, (0, _ramda.mergeLeft)((0, _utils.tags)((_opt$tags3 = opt.tags) !== null && _opt$tags3 !== void 0 ? _opt$tags3 : []), {
429
+ Timestamp: Date.now(),
430
+ Epoch: p.epochs.length,
431
+ Nonce: "0",
432
+ "Data-Protocol": "ao",
433
+ Variant: "ao.TN.1",
434
+ SDK: "aoconnect",
435
+ Type: "Assignment",
436
+ "Block-Height": mem.height,
437
+ Process: opt.process,
438
+ Message: opt.message,
439
+ "Hash-Chain": hash
440
+ }));
441
+ p.epochs.push([opt.id]);
442
+ _context3.next = 8;
405
443
  return ar.dataitem({
406
- data: _opt.data,
407
- signer: _opt.signer,
408
- tags: (0, _utils.tags)(_opt.tags),
444
+ data: opt.data,
445
+ signer: opt.signer,
446
+ tags: (0, _utils.tags)(opt.tags),
409
447
  target: opt.process
410
448
  });
411
- case 4:
449
+ case 8:
412
450
  _yield$ar$dataitem3 = _context3.sent;
413
451
  id = _yield$ar$dataitem3.id;
414
452
  owner = _yield$ar$dataitem3.owner;
415
453
  item = _yield$ar$dataitem3.item;
416
- _context3.next = 10;
454
+ _context3.next = 14;
417
455
  return ar.postItem(item, _test.su.jwk);
418
- case 10:
419
- _context3.prev = 10;
420
- msg = genMsg(p, (_opt$data2 = _opt.data) !== null && _opt$data2 !== void 0 ? _opt$data2 : "", _opt.tags, (_opt$from = _opt.from) !== null && _opt$from !== void 0 ? _opt$from : owner, _test.mu.addr);
456
+ case 14:
457
+ _context3.prev = 14;
458
+ msg = genMsg(p, (_opt$data2 = _opt.data) !== null && _opt$data2 !== void 0 ? _opt$data2 : "", _opt.tags, (_ref8 = (_opt$from = _opt.from) !== null && _opt$from !== void 0 ? _opt$from : opt.from) !== null && _ref8 !== void 0 ? _ref8 : owner, _test.mu.addr);
421
459
  _env = genEnv({
422
460
  pid: p.id,
423
461
  owner: p.owner,
424
462
  module: p.module,
425
463
  auth: _test.mu.addr
426
464
  });
427
- _context3.next = 15;
465
+ _context3.next = 19;
428
466
  return p.handle(p.memory, msg, _env);
429
- case 15:
467
+ case 19:
430
468
  res = _context3.sent;
431
469
  p.memory = res.Memory;
432
470
  delete res.Memory;
433
- p.res[id] = res;
434
- p.results.push(id);
471
+ p.res[opt.message] = res;
472
+ p.results.push(opt.message);
435
473
  p.txs.unshift(_objectSpread({
436
- id: id
437
- }, _opt));
438
- mem.msgs[id] = _opt;
474
+ id: opt.message
475
+ }, opt));
476
+ mem.msgs[opt.message] = _opt;
439
477
  _iterator2 = _createForOfIteratorHelper((_res$Messages = res.Messages) !== null && _res$Messages !== void 0 ? _res$Messages : []);
440
- _context3.prev = 23;
478
+ _context3.prev = 27;
441
479
  _iterator2.s();
442
- case 25:
480
+ case 29:
443
481
  if ((_step2 = _iterator2.n()).done) {
444
- _context3.next = 32;
482
+ _context3.next = 36;
445
483
  break;
446
484
  }
447
485
  v = _step2.value;
448
486
  if (!mem.env[v.Target]) {
449
- _context3.next = 30;
487
+ _context3.next = 34;
450
488
  break;
451
489
  }
452
- _context3.next = 30;
453
- return _message({
490
+ _context3.next = 34;
491
+ return message({
454
492
  process: v.Target,
455
493
  tags: v.Tags,
456
494
  data: v.Data,
457
495
  signer: _test.mu.signer,
458
496
  from: opt.process
459
497
  });
460
- case 30:
461
- _context3.next = 25;
498
+ case 34:
499
+ _context3.next = 29;
462
500
  break;
463
- case 32:
464
- _context3.next = 37;
501
+ case 36:
502
+ _context3.next = 41;
465
503
  break;
466
- case 34:
467
- _context3.prev = 34;
468
- _context3.t0 = _context3["catch"](23);
504
+ case 38:
505
+ _context3.prev = 38;
506
+ _context3.t0 = _context3["catch"](27);
469
507
  _iterator2.e(_context3.t0);
470
- case 37:
471
- _context3.prev = 37;
508
+ case 41:
509
+ _context3.prev = 41;
472
510
  _iterator2.f();
473
- return _context3.finish(37);
474
- case 40:
511
+ return _context3.finish(41);
512
+ case 44:
513
+ _iterator3 = _createForOfIteratorHelper((_res$Spawns = res.Spawns) !== null && _res$Spawns !== void 0 ? _res$Spawns : []);
514
+ _context3.prev = 45;
515
+ _iterator3.s();
516
+ case 47:
517
+ if ((_step3 = _iterator3.n()).done) {
518
+ _context3.next = 54;
519
+ break;
520
+ }
521
+ _v = _step3.value;
522
+ _tags = (0, _utils.tags)(_v.Tags);
523
+ _context3.next = 52;
524
+ return spawn({
525
+ module: _tags.Module,
526
+ scheduler: _test.scheduler,
527
+ tags: _v.Tags,
528
+ data: _v.Data,
529
+ from: _tags["From-Process"],
530
+ signer: _test.mu.signer
531
+ });
532
+ case 52:
533
+ _context3.next = 47;
534
+ break;
535
+ case 54:
536
+ _context3.next = 59;
537
+ break;
538
+ case 56:
539
+ _context3.prev = 56;
540
+ _context3.t1 = _context3["catch"](45);
541
+ _iterator3.e(_context3.t1);
542
+ case 59:
543
+ _context3.prev = 59;
544
+ _iterator3.f();
545
+ return _context3.finish(59);
546
+ case 62:
547
+ _iterator4 = _createForOfIteratorHelper((_res$Assignments = res.Assignments) !== null && _res$Assignments !== void 0 ? _res$Assignments : []);
548
+ _context3.prev = 63;
549
+ _iterator4.s();
550
+ case 65:
551
+ if ((_step4 = _iterator4.n()).done) {
552
+ _context3.next = 86;
553
+ break;
554
+ }
555
+ _v2 = _step4.value;
556
+ _iterator5 = _createForOfIteratorHelper(_v2.Processes);
557
+ _context3.prev = 68;
558
+ _iterator5.s();
559
+ case 70:
560
+ if ((_step5 = _iterator5.n()).done) {
561
+ _context3.next = 76;
562
+ break;
563
+ }
564
+ v2 = _step5.value;
565
+ _context3.next = 74;
566
+ return _assign({
567
+ message: _v2.Message,
568
+ process: v2,
569
+ from: opt.process,
570
+ signer: _test.mu.signer
571
+ });
572
+ case 74:
573
+ _context3.next = 70;
574
+ break;
575
+ case 76:
576
+ _context3.next = 81;
577
+ break;
578
+ case 78:
579
+ _context3.prev = 78;
580
+ _context3.t2 = _context3["catch"](68);
581
+ _iterator5.e(_context3.t2);
582
+ case 81:
583
+ _context3.prev = 81;
584
+ _iterator5.f();
585
+ return _context3.finish(81);
586
+ case 84:
587
+ _context3.next = 65;
588
+ break;
589
+ case 86:
590
+ _context3.next = 91;
591
+ break;
592
+ case 88:
593
+ _context3.prev = 88;
594
+ _context3.t3 = _context3["catch"](63);
595
+ _iterator4.e(_context3.t3);
596
+ case 91:
597
+ _context3.prev = 91;
598
+ _iterator4.f();
599
+ return _context3.finish(91);
600
+ case 94:
475
601
  return _context3.abrupt("return", id);
476
- case 43:
477
- _context3.prev = 43;
478
- _context3.t1 = _context3["catch"](10);
479
- console.log(_context3.t1);
480
- case 46:
602
+ case 97:
603
+ _context3.prev = 97;
604
+ _context3.t4 = _context3["catch"](14);
605
+ console.log(_context3.t4);
606
+ case 100:
481
607
  return _context3.abrupt("return", null);
482
- case 47:
608
+ case 101:
483
609
  case "end":
484
610
  return _context3.stop();
485
611
  }
486
- }, _callee3, null, [[10, 43], [23, 34, 37, 40]]);
612
+ }, _callee3, null, [[14, 97], [27, 38, 41, 44], [45, 56, 59, 62], [63, 88, 91, 94], [68, 78, 81, 84]]);
487
613
  }));
488
614
  return function assign(_x2) {
489
615
  return _ref7.apply(this, arguments);
490
616
  };
491
617
  }();
492
- var _message = /*#__PURE__*/function () {
493
- var _ref8 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(opt) {
494
- var p, ex, _iterator3, _step3, _v3, _yield$ar$dataitem4, item, id, owner, _opt$data3, _opt$from2, _res$Messages2, _res$Spawns, _res$Assignments, msg, _env, res, _iterator4, _step4, v, _iterator5, _step5, _v, _tags, _iterator6, _step6, _v2, _iterator7, _step7, v2;
618
+ var message = /*#__PURE__*/function () {
619
+ var _ref9 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(opt) {
620
+ var _opt$tags4;
621
+ var p, ex, _iterator6, _step6, v, _yield$ar$dataitem4, item, id, owner;
495
622
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
496
623
  while (1) switch (_context4.prev = _context4.next) {
497
624
  case 0:
498
625
  p = mem.env[opt.process];
499
626
  ex = false;
500
- _iterator3 = _createForOfIteratorHelper(opt.tags);
627
+ _iterator6 = _createForOfIteratorHelper(opt.tags);
501
628
  try {
502
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
503
- _v3 = _step3.value;
504
- if (_v3.name === "Type") ex = true;
629
+ for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
630
+ v = _step6.value;
631
+ if (v.name === "Type") ex = true;
505
632
  }
506
633
  } catch (err) {
507
- _iterator3.e(err);
634
+ _iterator6.e(err);
508
635
  } finally {
509
- _iterator3.f();
636
+ _iterator6.f();
510
637
  }
511
- if (!ex) opt.tags.push({
512
- name: "Type",
513
- value: "Message"
514
- });
638
+ opt.tags = (0, _utils.buildTags)(null, (0, _ramda.mergeLeft)((0, _utils.tags)((_opt$tags4 = opt.tags) !== null && _opt$tags4 !== void 0 ? _opt$tags4 : []), {
639
+ "Data-Protocol": "ao",
640
+ Variant: "ao.TN.1",
641
+ Type: "Message",
642
+ SDK: "aoconnect"
643
+ }));
515
644
  _context4.next = 7;
516
645
  return ar.dataitem({
517
646
  data: opt.data,
@@ -527,169 +656,28 @@ var connect = exports.connect = function connect(mem) {
527
656
  _context4.next = 13;
528
657
  return ar.postItem(item, _test.su.jwk);
529
658
  case 13:
530
- _context4.prev = 13;
531
- msg = genMsg(p, (_opt$data3 = opt.data) !== null && _opt$data3 !== void 0 ? _opt$data3 : "", opt.tags, (_opt$from2 = opt.from) !== null && _opt$from2 !== void 0 ? _opt$from2 : owner, _test.mu.addr);
532
- _env = genEnv({
533
- pid: p.id,
534
- owner: p.owner,
535
- module: p.module,
536
- auth: _test.mu.addr
537
- });
538
- _context4.next = 18;
539
- return p.handle(p.memory, msg, _env);
540
- case 18:
541
- res = _context4.sent;
542
- p.memory = res.Memory;
543
- delete res.Memory;
544
- p.res[id] = res;
545
- p.results.push(id);
546
- p.txs.unshift(_objectSpread({
547
- id: id
548
- }, opt));
549
659
  mem.msgs[id] = opt;
550
- _iterator4 = _createForOfIteratorHelper((_res$Messages2 = res.Messages) !== null && _res$Messages2 !== void 0 ? _res$Messages2 : []);
551
- _context4.prev = 26;
552
- _iterator4.s();
553
- case 28:
554
- if ((_step4 = _iterator4.n()).done) {
555
- _context4.next = 35;
556
- break;
557
- }
558
- v = _step4.value;
559
- if (!mem.env[v.Target]) {
560
- _context4.next = 33;
561
- break;
562
- }
563
- _context4.next = 33;
564
- return _message({
565
- process: v.Target,
566
- tags: v.Tags,
567
- data: v.Data,
568
- signer: _test.mu.signer,
569
- from: opt.process
570
- });
571
- case 33:
572
- _context4.next = 28;
573
- break;
574
- case 35:
575
- _context4.next = 40;
576
- break;
577
- case 37:
578
- _context4.prev = 37;
579
- _context4.t0 = _context4["catch"](26);
580
- _iterator4.e(_context4.t0);
581
- case 40:
582
- _context4.prev = 40;
583
- _iterator4.f();
584
- return _context4.finish(40);
585
- case 43:
586
- _iterator5 = _createForOfIteratorHelper((_res$Spawns = res.Spawns) !== null && _res$Spawns !== void 0 ? _res$Spawns : []);
587
- _context4.prev = 44;
588
- _iterator5.s();
589
- case 46:
590
- if ((_step5 = _iterator5.n()).done) {
591
- _context4.next = 53;
592
- break;
593
- }
594
- _v = _step5.value;
595
- _tags = (0, _utils.tags)(_v.Tags);
596
- _context4.next = 51;
597
- return spawn({
598
- module: _tags.Module,
599
- scheduler: _test.scheduler,
600
- tags: _v.Tags,
601
- data: _v.Data,
602
- from: _tags["From-Process"],
660
+ _context4.next = 16;
661
+ return _assign({
662
+ message: id,
663
+ process: opt.process,
664
+ from: owner,
603
665
  signer: _test.mu.signer
604
666
  });
605
- case 51:
606
- _context4.next = 46;
607
- break;
608
- case 53:
609
- _context4.next = 58;
610
- break;
611
- case 55:
612
- _context4.prev = 55;
613
- _context4.t1 = _context4["catch"](44);
614
- _iterator5.e(_context4.t1);
615
- case 58:
616
- _context4.prev = 58;
617
- _iterator5.f();
618
- return _context4.finish(58);
619
- case 61:
620
- _iterator6 = _createForOfIteratorHelper((_res$Assignments = res.Assignments) !== null && _res$Assignments !== void 0 ? _res$Assignments : []);
621
- _context4.prev = 62;
622
- _iterator6.s();
623
- case 64:
624
- if ((_step6 = _iterator6.n()).done) {
625
- _context4.next = 85;
626
- break;
627
- }
628
- _v2 = _step6.value;
629
- _iterator7 = _createForOfIteratorHelper(_v2.Processes);
630
- _context4.prev = 67;
631
- _iterator7.s();
632
- case 69:
633
- if ((_step7 = _iterator7.n()).done) {
634
- _context4.next = 75;
635
- break;
636
- }
637
- v2 = _step7.value;
638
- _context4.next = 73;
639
- return assign({
640
- message: _v2.Message,
641
- process: v2,
642
- from: opt.process,
643
- signer: _test.mu.signer
644
- });
645
- case 73:
646
- _context4.next = 69;
647
- break;
648
- case 75:
649
- _context4.next = 80;
650
- break;
651
- case 77:
652
- _context4.prev = 77;
653
- _context4.t2 = _context4["catch"](67);
654
- _iterator7.e(_context4.t2);
655
- case 80:
656
- _context4.prev = 80;
657
- _iterator7.f();
658
- return _context4.finish(80);
659
- case 83:
660
- _context4.next = 64;
661
- break;
662
- case 85:
663
- _context4.next = 90;
664
- break;
665
- case 87:
666
- _context4.prev = 87;
667
- _context4.t3 = _context4["catch"](62);
668
- _iterator6.e(_context4.t3);
669
- case 90:
670
- _context4.prev = 90;
671
- _iterator6.f();
672
- return _context4.finish(90);
673
- case 93:
667
+ case 16:
674
668
  return _context4.abrupt("return", id);
675
- case 96:
676
- _context4.prev = 96;
677
- _context4.t4 = _context4["catch"](13);
678
- console.log(_context4.t4);
679
- case 99:
680
- return _context4.abrupt("return", null);
681
- case 100:
669
+ case 17:
682
670
  case "end":
683
671
  return _context4.stop();
684
672
  }
685
- }, _callee4, null, [[13, 96], [26, 37, 40, 43], [44, 55, 58, 61], [62, 87, 90, 93], [67, 77, 80, 83]]);
673
+ }, _callee4);
686
674
  }));
687
675
  return function message(_x3) {
688
- return _ref8.apply(this, arguments);
676
+ return _ref9.apply(this, arguments);
689
677
  };
690
678
  }();
691
679
  return {
692
- message: _message,
680
+ message: message,
693
681
  unmonitor: function () {
694
682
  var _unmonitor = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(opt) {
695
683
  var p;
@@ -725,7 +713,7 @@ var connect = exports.connect = function connect(mem) {
725
713
  while (1) switch (_context6.prev = _context6.next) {
726
714
  case 0:
727
715
  _context6.next = 2;
728
- return _message({
716
+ return message({
729
717
  tags: p.cronTags,
730
718
  process: opt.process,
731
719
  signer: _test.mu.signer,
@@ -750,7 +738,7 @@ var connect = exports.connect = function connect(mem) {
750
738
  return monitor;
751
739
  }(),
752
740
  spawn: spawn,
753
- assign: assign,
741
+ assign: _assign,
754
742
  result: function () {
755
743
  var _result = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(opt) {
756
744
  return _regeneratorRuntime().wrap(function _callee8$(_context8) {
@@ -840,7 +828,7 @@ var connect = exports.connect = function connect(mem) {
840
828
  }(),
841
829
  dryrun: function () {
842
830
  var _dryrun = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(opt) {
843
- var p, _yield$ar$dataitem5, id, owner, _opt$data4, msg, _env, res;
831
+ var p, _yield$ar$dataitem5, id, owner, _opt$data3, msg, _env, res;
844
832
  return _regeneratorRuntime().wrap(function _callee10$(_context10) {
845
833
  while (1) switch (_context10.prev = _context10.next) {
846
834
  case 0:
@@ -854,7 +842,7 @@ var connect = exports.connect = function connect(mem) {
854
842
  id = _yield$ar$dataitem5.id;
855
843
  owner = _yield$ar$dataitem5.owner;
856
844
  _context10.prev = 6;
857
- msg = genMsg(p, (_opt$data4 = opt.data) !== null && _opt$data4 !== void 0 ? _opt$data4 : "", opt.tags, owner, _test.mu.addr, true);
845
+ msg = genMsg(p, (_opt$data3 = opt.data) !== null && _opt$data3 !== void 0 ? _opt$data3 : "", opt.tags, owner, _test.mu.addr, true);
858
846
  _env = genEnv({
859
847
  pid: p.id,
860
848
  owner: p.owner,
package/cjs/armem.js CHANGED
@@ -24,6 +24,7 @@ var ArMem = exports["default"] = /*#__PURE__*/_createClass(function ArMem() {
24
24
  this.arweave.transactions.getPrice = function () {
25
25
  return 0;
26
26
  };
27
+ this.addrmap = {};
27
28
  this.txs = {};
28
29
  this.jwks = {};
29
30
  this.height = 0;