wao 0.21.1 → 0.21.2
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-base.js +718 -613
- package/esm/aoconnect-base.js +54 -1
- package/package.json +1 -1
package/cjs/aoconnect-base.js
CHANGED
|
@@ -11,6 +11,7 @@ var _crypto = _interopRequireDefault(require("crypto"));
|
|
|
11
11
|
var _base64url = _interopRequireDefault(require("base64url"));
|
|
12
12
|
var _utils = require("./utils.js");
|
|
13
13
|
var _ao = _interopRequireDefault(require("./ao.js"));
|
|
14
|
+
var _aoconnect = require("@permaweb/aoconnect");
|
|
14
15
|
var _weavedrive = _interopRequireDefault(require("./weavedrive.js"));
|
|
15
16
|
var _ramda = require("ramda");
|
|
16
17
|
var _Arweave$default, _WarpArBundles$defaul;
|
|
@@ -671,26 +672,26 @@ var _default = exports["default"] = function _default() {
|
|
|
671
672
|
return (0, _base64url["default"])(hasher.digest());
|
|
672
673
|
}
|
|
673
674
|
var _assign = /*#__PURE__*/function () {
|
|
674
|
-
var _ref9 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
675
|
+
var _ref9 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(opt) {
|
|
675
676
|
var _opt$tags2;
|
|
676
|
-
var p, _opt, hash, _yield$ar$dataitem2, id, owner, item, _opt$data2, _ref10, _opt$from, _res$Messages, _res$Spawns, _res$Assignments, data, _tags, from, t, msg, _env, _yield$mem$getTx3, _yield$mem$getWasm2, format, mod, wasm, wdrive, start, res, _msg, _iterator3, _step3,
|
|
677
|
-
return _regeneratorRuntime().wrap(function
|
|
678
|
-
while (1) switch (
|
|
677
|
+
var p, _opt, hash, _yield$ar$dataitem2, id, owner, item, _opt$data2, _ref10, _opt$from, _res$Messages, _res$Spawns, _res$Assignments, data, _tags, from, t, msg, _env, _yield$mem$getTx3, _yield$mem$getWasm2, format, mod, wasm, wdrive, start, res, _msg, _iterator3, _step3, _loop, _iterator4, _step4, v, __tags, _iterator5, _step5, _v, _iterator6, _step6, v2;
|
|
678
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context6) {
|
|
679
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
679
680
|
case 0:
|
|
680
|
-
|
|
681
|
+
_context6.next = 2;
|
|
681
682
|
return mem.get("env", opt.process);
|
|
682
683
|
case 2:
|
|
683
|
-
p =
|
|
684
|
+
p = _context6.sent;
|
|
684
685
|
if (!(!p || !opt.process)) {
|
|
685
|
-
|
|
686
|
+
_context6.next = 5;
|
|
686
687
|
break;
|
|
687
688
|
}
|
|
688
|
-
return
|
|
689
|
+
return _context6.abrupt("return", null);
|
|
689
690
|
case 5:
|
|
690
|
-
|
|
691
|
+
_context6.next = 7;
|
|
691
692
|
return mem.get("msgs", opt.message);
|
|
692
693
|
case 7:
|
|
693
|
-
_opt =
|
|
694
|
+
_opt = _context6.sent;
|
|
694
695
|
hash = p.hash;
|
|
695
696
|
try {
|
|
696
697
|
hash = genHashChain(p.hash, opt.message);
|
|
@@ -698,35 +699,35 @@ var _default = exports["default"] = function _default() {
|
|
|
698
699
|
console.log(e);
|
|
699
700
|
}
|
|
700
701
|
p.hash = hash;
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
702
|
+
_context6.t0 = _utils.buildTags;
|
|
703
|
+
_context6.t1 = _ramda.mergeLeft;
|
|
704
|
+
_context6.t2 = (0, _utils.tags)((_opt$tags2 = opt.tags) !== null && _opt$tags2 !== void 0 ? _opt$tags2 : []);
|
|
705
|
+
_context6.t3 = Date.now();
|
|
706
|
+
_context6.t4 = p.epochs.length;
|
|
707
|
+
_context6.t5 = variant !== null && variant !== void 0 ? variant : "ao.TN.1";
|
|
708
|
+
_context6.next = 19;
|
|
708
709
|
return mem.get("height");
|
|
709
710
|
case 19:
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
Timestamp:
|
|
716
|
-
Epoch:
|
|
711
|
+
_context6.t6 = _context6.sent;
|
|
712
|
+
_context6.t7 = opt.process;
|
|
713
|
+
_context6.t8 = opt.message;
|
|
714
|
+
_context6.t9 = hash;
|
|
715
|
+
_context6.t10 = {
|
|
716
|
+
Timestamp: _context6.t3,
|
|
717
|
+
Epoch: _context6.t4,
|
|
717
718
|
Nonce: "0",
|
|
718
719
|
"Data-Protocol": "ao",
|
|
719
|
-
Variant:
|
|
720
|
+
Variant: _context6.t5,
|
|
720
721
|
Type: "Assignment",
|
|
721
|
-
"Block-Height":
|
|
722
|
-
Process:
|
|
723
|
-
Message:
|
|
724
|
-
"Hash-Chain":
|
|
722
|
+
"Block-Height": _context6.t6,
|
|
723
|
+
Process: _context6.t7,
|
|
724
|
+
Message: _context6.t8,
|
|
725
|
+
"Hash-Chain": _context6.t9
|
|
725
726
|
};
|
|
726
|
-
|
|
727
|
-
opt.tags = (0,
|
|
727
|
+
_context6.t11 = (0, _context6.t1)(_context6.t2, _context6.t10);
|
|
728
|
+
opt.tags = (0, _context6.t0)(null, _context6.t11);
|
|
728
729
|
p.epochs.push([opt.message]);
|
|
729
|
-
|
|
730
|
+
_context6.next = 29;
|
|
730
731
|
return ar.dataitem({
|
|
731
732
|
data: opt.data,
|
|
732
733
|
signer: opt.signer,
|
|
@@ -734,29 +735,29 @@ var _default = exports["default"] = function _default() {
|
|
|
734
735
|
target: opt.process
|
|
735
736
|
});
|
|
736
737
|
case 29:
|
|
737
|
-
_yield$ar$dataitem2 =
|
|
738
|
+
_yield$ar$dataitem2 = _context6.sent;
|
|
738
739
|
id = _yield$ar$dataitem2.id;
|
|
739
740
|
owner = _yield$ar$dataitem2.owner;
|
|
740
741
|
item = _yield$ar$dataitem2.item;
|
|
741
742
|
if (!opt.message_item) {
|
|
742
|
-
|
|
743
|
+
_context6.next = 38;
|
|
743
744
|
break;
|
|
744
745
|
}
|
|
745
|
-
|
|
746
|
+
_context6.next = 36;
|
|
746
747
|
return ar.postItems([opt.message_item, item], su.jwk);
|
|
747
748
|
case 36:
|
|
748
|
-
|
|
749
|
+
_context6.next = 40;
|
|
749
750
|
break;
|
|
750
751
|
case 38:
|
|
751
|
-
|
|
752
|
+
_context6.next = 40;
|
|
752
753
|
return ar.postItems(item, su.jwk);
|
|
753
754
|
case 40:
|
|
754
|
-
|
|
755
|
+
_context6.prev = 40;
|
|
755
756
|
data = (_opt$data2 = _opt.data) !== null && _opt$data2 !== void 0 ? _opt$data2 : "";
|
|
756
757
|
_tags = _opt.tags;
|
|
757
758
|
from = (_ref10 = (_opt$from = _opt.from) !== null && _opt$from !== void 0 ? _opt$from : opt.from) !== null && _ref10 !== void 0 ? _ref10 : owner;
|
|
758
759
|
if (!_opt.item) {
|
|
759
|
-
|
|
760
|
+
_context6.next = 53;
|
|
760
761
|
break;
|
|
761
762
|
}
|
|
762
763
|
data = _base64url["default"].decode(_opt.item.data);
|
|
@@ -764,82 +765,82 @@ var _default = exports["default"] = function _default() {
|
|
|
764
765
|
t = (0, _utils.tags)(_tags);
|
|
765
766
|
if (t["From-Process"]) from = t["From-Process"];
|
|
766
767
|
if (from) {
|
|
767
|
-
|
|
768
|
+
_context6.next = 53;
|
|
768
769
|
break;
|
|
769
770
|
}
|
|
770
|
-
|
|
771
|
+
_context6.next = 52;
|
|
771
772
|
return arweave.wallets.jwkToAddress({
|
|
772
773
|
kty: "RSA",
|
|
773
774
|
n: _opt.item.owner,
|
|
774
775
|
e: "AQAB"
|
|
775
776
|
});
|
|
776
777
|
case 52:
|
|
777
|
-
from =
|
|
778
|
+
from = _context6.sent;
|
|
778
779
|
case 53:
|
|
779
|
-
|
|
780
|
+
_context6.next = 55;
|
|
780
781
|
return genMsg(opt.message, p, data, _tags, from, mu.addr);
|
|
781
782
|
case 55:
|
|
782
|
-
msg =
|
|
783
|
-
|
|
783
|
+
msg = _context6.sent;
|
|
784
|
+
_context6.next = 58;
|
|
784
785
|
return genEnv({
|
|
785
786
|
pid: p.id,
|
|
786
787
|
owner: p.owner,
|
|
787
788
|
module: p.module
|
|
788
789
|
});
|
|
789
790
|
case 58:
|
|
790
|
-
_env =
|
|
791
|
+
_env = _context6.sent;
|
|
791
792
|
if (p.handle) {
|
|
792
|
-
|
|
793
|
+
_context6.next = 91;
|
|
793
794
|
break;
|
|
794
795
|
}
|
|
795
|
-
|
|
796
|
+
_context6.next = 62;
|
|
796
797
|
return mem.getWasm(p.modulea);
|
|
797
798
|
case 62:
|
|
798
|
-
_yield$mem$getWasm2 =
|
|
799
|
+
_yield$mem$getWasm2 = _context6.sent;
|
|
799
800
|
format = _yield$mem$getWasm2.format;
|
|
800
801
|
mod = _yield$mem$getWasm2.mod;
|
|
801
802
|
wasm = _yield$mem$getWasm2.wasm;
|
|
802
803
|
wdrive = extensions[p.extention];
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
804
|
+
_context6.t12 = AoLoader;
|
|
805
|
+
_context6.t13 = wasm;
|
|
806
|
+
_context6.t14 = format;
|
|
807
|
+
_context6.t15 = wdrive;
|
|
808
|
+
_context6.next = 73;
|
|
808
809
|
return mem.getTx(p.id);
|
|
809
810
|
case 73:
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
if (
|
|
813
|
-
|
|
811
|
+
_context6.t17 = _yield$mem$getTx3 = _context6.sent;
|
|
812
|
+
_context6.t16 = _context6.t17 === null;
|
|
813
|
+
if (_context6.t16) {
|
|
814
|
+
_context6.next = 77;
|
|
814
815
|
break;
|
|
815
816
|
}
|
|
816
|
-
|
|
817
|
+
_context6.t16 = _yield$mem$getTx3 === void 0;
|
|
817
818
|
case 77:
|
|
818
|
-
if (!
|
|
819
|
-
|
|
819
|
+
if (!_context6.t16) {
|
|
820
|
+
_context6.next = 81;
|
|
820
821
|
break;
|
|
821
822
|
}
|
|
822
|
-
|
|
823
|
-
|
|
823
|
+
_context6.t18 = void 0;
|
|
824
|
+
_context6.next = 82;
|
|
824
825
|
break;
|
|
825
826
|
case 81:
|
|
826
|
-
|
|
827
|
+
_context6.t18 = _yield$mem$getTx3.item;
|
|
827
828
|
case 82:
|
|
828
|
-
|
|
829
|
-
|
|
829
|
+
_context6.t19 = _context6.t18;
|
|
830
|
+
_context6.next = 85;
|
|
830
831
|
return mem.getTx(mod);
|
|
831
832
|
case 85:
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
format:
|
|
835
|
-
WeaveDrive:
|
|
836
|
-
spawn:
|
|
837
|
-
module:
|
|
833
|
+
_context6.t20 = _context6.sent;
|
|
834
|
+
_context6.t21 = {
|
|
835
|
+
format: _context6.t14,
|
|
836
|
+
WeaveDrive: _context6.t15,
|
|
837
|
+
spawn: _context6.t19,
|
|
838
|
+
module: _context6.t20
|
|
838
839
|
};
|
|
839
|
-
|
|
840
|
-
return (0,
|
|
840
|
+
_context6.next = 89;
|
|
841
|
+
return (0, _context6.t12)(_context6.t13, _context6.t21);
|
|
841
842
|
case 89:
|
|
842
|
-
p.handle =
|
|
843
|
+
p.handle = _context6.sent;
|
|
843
844
|
mem.env[opt.process].handle = p.handle;
|
|
844
845
|
case 91:
|
|
845
846
|
if (p.compressed) {
|
|
@@ -847,384 +848,488 @@ var _default = exports["default"] = function _default() {
|
|
|
847
848
|
p.memory = mem.decompress(p.memory, p.original_size);
|
|
848
849
|
p.compressed = false;
|
|
849
850
|
}
|
|
850
|
-
|
|
851
|
+
_context6.next = 94;
|
|
851
852
|
return p.handle(p.memory, msg, _env);
|
|
852
853
|
case 94:
|
|
853
|
-
res =
|
|
854
|
+
res = _context6.sent;
|
|
854
855
|
p.memory = res.Memory;
|
|
855
856
|
delete res.Memory;
|
|
856
857
|
p.results.push(opt.message);
|
|
857
|
-
|
|
858
|
+
_context6.next = 100;
|
|
858
859
|
return mem.set(p, "env", opt.process);
|
|
859
860
|
case 100:
|
|
860
861
|
_msg = _objectSpread(_objectSpread({}, (0, _ramda.dissoc)("signer", _opt)), {}, {
|
|
861
862
|
res: res,
|
|
862
863
|
msg: msg
|
|
863
864
|
});
|
|
864
|
-
|
|
865
|
+
_context6.next = 103;
|
|
865
866
|
return mem.set(_msg, "msgs", opt.message);
|
|
866
867
|
case 103:
|
|
867
868
|
_iterator3 = _createForOfIteratorHelper((_res$Messages = res.Messages) !== null && _res$Messages !== void 0 ? _res$Messages : []);
|
|
868
|
-
|
|
869
|
+
_context6.prev = 104;
|
|
870
|
+
_loop = /*#__PURE__*/_regeneratorRuntime().mark(function _loop() {
|
|
871
|
+
var v, _t, _result, slot, fetchHB, info, _connect, request, _tags2, _yield$request, _yield$fetchHB, body, _yield$fetch$then$Pro, _yield$fetch$then, sch, tar, procs, ao, _yield$mem$getTx$tags3, _yield$mem$getTx4, _tags3$Action, _v$Data, _tags3, pr, module, _yield$ao$msg, mid;
|
|
872
|
+
return _regeneratorRuntime().wrap(function _loop$(_context5) {
|
|
873
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
874
|
+
case 0:
|
|
875
|
+
v = _step3.value;
|
|
876
|
+
_context5.next = 3;
|
|
877
|
+
return mem.get("env", v.Target);
|
|
878
|
+
case 3:
|
|
879
|
+
if (!_context5.sent) {
|
|
880
|
+
_context5.next = 8;
|
|
881
|
+
break;
|
|
882
|
+
}
|
|
883
|
+
_context5.next = 6;
|
|
884
|
+
return message({
|
|
885
|
+
"for": opt.message,
|
|
886
|
+
process: v.Target,
|
|
887
|
+
tags: v.Tags,
|
|
888
|
+
data: v.Data,
|
|
889
|
+
signer: mu.signer,
|
|
890
|
+
from: opt.process,
|
|
891
|
+
target: v.Target
|
|
892
|
+
});
|
|
893
|
+
case 6:
|
|
894
|
+
_context5.next = 103;
|
|
895
|
+
break;
|
|
896
|
+
case 8:
|
|
897
|
+
_t = (0, _utils.tags)(v.Tags); // this behaviour is different from AOS (temporary hack for remote tests)
|
|
898
|
+
if (!_t.__HyperBEAM__) {
|
|
899
|
+
_context5.next = 38;
|
|
900
|
+
break;
|
|
901
|
+
}
|
|
902
|
+
_result = null;
|
|
903
|
+
slot = null;
|
|
904
|
+
_context5.prev = 12;
|
|
905
|
+
fetchHB = /*#__PURE__*/function () {
|
|
906
|
+
var _ref11 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(path) {
|
|
907
|
+
var _ref12,
|
|
908
|
+
_ref12$json,
|
|
909
|
+
json,
|
|
910
|
+
_ref12$params,
|
|
911
|
+
params,
|
|
912
|
+
_args4 = arguments;
|
|
913
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
914
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
915
|
+
case 0:
|
|
916
|
+
_ref12 = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {}, _ref12$json = _ref12.json, json = _ref12$json === void 0 ? true : _ref12$json, _ref12$params = _ref12.params, params = _ref12$params === void 0 ? "" : _ref12$params;
|
|
917
|
+
_context4.next = 3;
|
|
918
|
+
return fetch("".concat(_t.__HyperBEAM__).concat(path).concat(json ? "/serialize~json@1.0" : "").concat(params ? "?" + params : "")).then(function (r) {
|
|
919
|
+
return r[json ? "json" : "text"]();
|
|
920
|
+
});
|
|
921
|
+
case 3:
|
|
922
|
+
return _context4.abrupt("return", _context4.sent);
|
|
923
|
+
case 4:
|
|
924
|
+
case "end":
|
|
925
|
+
return _context4.stop();
|
|
926
|
+
}
|
|
927
|
+
}, _callee4);
|
|
928
|
+
}));
|
|
929
|
+
return function fetchHB(_x9) {
|
|
930
|
+
return _ref11.apply(this, arguments);
|
|
931
|
+
};
|
|
932
|
+
}();
|
|
933
|
+
_context5.next = 16;
|
|
934
|
+
return fetchHB("/~meta@1.0/info");
|
|
935
|
+
case 16:
|
|
936
|
+
info = _context5.sent;
|
|
937
|
+
_connect = (0, _aoconnect.connect)({
|
|
938
|
+
MODE: "mainnet",
|
|
939
|
+
URL: _t.__HyperBEAM__,
|
|
940
|
+
device: "",
|
|
941
|
+
signer: (0, _aoconnect.createSigner)(mu.jwk)
|
|
942
|
+
}), request = _connect.request;
|
|
943
|
+
_tags2 = _objectSpread(_objectSpread({}, _t), {}, {
|
|
944
|
+
"From-Process": opt.process,
|
|
945
|
+
"Pushed-For": id,
|
|
946
|
+
method: "POST",
|
|
947
|
+
path: "/".concat(v.Target, "/schedule"),
|
|
948
|
+
scheduler: info.address
|
|
949
|
+
});
|
|
950
|
+
_context5.next = 21;
|
|
951
|
+
return request(_tags2);
|
|
952
|
+
case 21:
|
|
953
|
+
_yield$request = _context5.sent;
|
|
954
|
+
slot = _yield$request.slot;
|
|
955
|
+
_context5.next = 25;
|
|
956
|
+
return fetchHB("/".concat(v.Target, "~process@1.0/compute"), {
|
|
957
|
+
params: "slot=".concat(slot)
|
|
958
|
+
});
|
|
959
|
+
case 25:
|
|
960
|
+
_yield$fetchHB = _context5.sent;
|
|
961
|
+
body = _yield$fetchHB.results.json.body;
|
|
962
|
+
_result = JSON.parse(body).Output.data;
|
|
963
|
+
_context5.next = 33;
|
|
964
|
+
break;
|
|
965
|
+
case 30:
|
|
966
|
+
_context5.prev = 30;
|
|
967
|
+
_context5.t0 = _context5["catch"](12);
|
|
968
|
+
console.log(_context5.t0);
|
|
969
|
+
case 33:
|
|
970
|
+
if (!_result) {
|
|
971
|
+
_context5.next = 36;
|
|
972
|
+
break;
|
|
973
|
+
}
|
|
974
|
+
_context5.next = 36;
|
|
975
|
+
return message({
|
|
976
|
+
"for": slot,
|
|
977
|
+
process: opt.process,
|
|
978
|
+
tags: (0, _utils.buildTags)({
|
|
979
|
+
"X-Reference": _t.Reference
|
|
980
|
+
}),
|
|
981
|
+
data: JSON.stringify(_result),
|
|
982
|
+
signer: mu.signer,
|
|
983
|
+
from: v.Target,
|
|
984
|
+
target: opt.process
|
|
985
|
+
});
|
|
986
|
+
case 36:
|
|
987
|
+
_context5.next = 103;
|
|
988
|
+
break;
|
|
989
|
+
case 38:
|
|
990
|
+
if (!_t.__Scheduler__) {
|
|
991
|
+
_context5.next = 101;
|
|
992
|
+
break;
|
|
993
|
+
}
|
|
994
|
+
sch = _t.__Scheduler__;
|
|
995
|
+
tar = v.Target;
|
|
996
|
+
_context5.next = 43;
|
|
997
|
+
return fetch(sch).then(function (r) {
|
|
998
|
+
return r.json();
|
|
999
|
+
});
|
|
1000
|
+
case 43:
|
|
1001
|
+
_context5.t3 = _yield$fetch$then = _context5.sent;
|
|
1002
|
+
_context5.t2 = _context5.t3 === null;
|
|
1003
|
+
if (_context5.t2) {
|
|
1004
|
+
_context5.next = 47;
|
|
1005
|
+
break;
|
|
1006
|
+
}
|
|
1007
|
+
_context5.t2 = _yield$fetch$then === void 0;
|
|
1008
|
+
case 47:
|
|
1009
|
+
if (!_context5.t2) {
|
|
1010
|
+
_context5.next = 51;
|
|
1011
|
+
break;
|
|
1012
|
+
}
|
|
1013
|
+
_context5.t4 = void 0;
|
|
1014
|
+
_context5.next = 52;
|
|
1015
|
+
break;
|
|
1016
|
+
case 51:
|
|
1017
|
+
_context5.t4 = _yield$fetch$then.Processes;
|
|
1018
|
+
case 52:
|
|
1019
|
+
_context5.t5 = _yield$fetch$then$Pro = _context5.t4;
|
|
1020
|
+
_context5.t1 = _context5.t5 !== null;
|
|
1021
|
+
if (!_context5.t1) {
|
|
1022
|
+
_context5.next = 56;
|
|
1023
|
+
break;
|
|
1024
|
+
}
|
|
1025
|
+
_context5.t1 = _yield$fetch$then$Pro !== void 0;
|
|
1026
|
+
case 56:
|
|
1027
|
+
if (!_context5.t1) {
|
|
1028
|
+
_context5.next = 60;
|
|
1029
|
+
break;
|
|
1030
|
+
}
|
|
1031
|
+
_context5.t6 = _yield$fetch$then$Pro;
|
|
1032
|
+
_context5.next = 61;
|
|
1033
|
+
break;
|
|
1034
|
+
case 60:
|
|
1035
|
+
_context5.t6 = [];
|
|
1036
|
+
case 61:
|
|
1037
|
+
procs = _context5.t6;
|
|
1038
|
+
_context5.next = 64;
|
|
1039
|
+
return new _ao["default"]({
|
|
1040
|
+
port: sch.split(":").pop() - 3
|
|
1041
|
+
}).init(mu.jwk);
|
|
1042
|
+
case 64:
|
|
1043
|
+
ao = _context5.sent;
|
|
1044
|
+
_context5.prev = 65;
|
|
1045
|
+
_tags3 = _objectSpread(_objectSpread({}, _t), {}, {
|
|
1046
|
+
"From-Process": opt.process,
|
|
1047
|
+
"Pushed-For": id
|
|
1048
|
+
});
|
|
1049
|
+
_context5.next = 69;
|
|
1050
|
+
return mem.getTx(opt.process);
|
|
1051
|
+
case 69:
|
|
1052
|
+
_context5.t9 = _yield$mem$getTx4 = _context5.sent;
|
|
1053
|
+
_context5.t8 = _context5.t9 === null;
|
|
1054
|
+
if (_context5.t8) {
|
|
1055
|
+
_context5.next = 73;
|
|
1056
|
+
break;
|
|
1057
|
+
}
|
|
1058
|
+
_context5.t8 = _yield$mem$getTx4 === void 0;
|
|
1059
|
+
case 73:
|
|
1060
|
+
if (!_context5.t8) {
|
|
1061
|
+
_context5.next = 77;
|
|
1062
|
+
break;
|
|
1063
|
+
}
|
|
1064
|
+
_context5.t10 = void 0;
|
|
1065
|
+
_context5.next = 78;
|
|
1066
|
+
break;
|
|
1067
|
+
case 77:
|
|
1068
|
+
_context5.t10 = _yield$mem$getTx4.tags;
|
|
1069
|
+
case 78:
|
|
1070
|
+
_context5.t11 = _yield$mem$getTx$tags3 = _context5.t10;
|
|
1071
|
+
_context5.t7 = _context5.t11 !== null;
|
|
1072
|
+
if (!_context5.t7) {
|
|
1073
|
+
_context5.next = 82;
|
|
1074
|
+
break;
|
|
1075
|
+
}
|
|
1076
|
+
_context5.t7 = _yield$mem$getTx$tags3 !== void 0;
|
|
1077
|
+
case 82:
|
|
1078
|
+
if (!_context5.t7) {
|
|
1079
|
+
_context5.next = 86;
|
|
1080
|
+
break;
|
|
1081
|
+
}
|
|
1082
|
+
_context5.t12 = _yield$mem$getTx$tags3;
|
|
1083
|
+
_context5.next = 87;
|
|
1084
|
+
break;
|
|
1085
|
+
case 86:
|
|
1086
|
+
_context5.t12 = [];
|
|
1087
|
+
case 87:
|
|
1088
|
+
pr = _context5.t12;
|
|
1089
|
+
module = (0, _utils.tags)(pr).Module;
|
|
1090
|
+
if (module) _tags3["From-Module"] = module;
|
|
1091
|
+
_context5.next = 92;
|
|
1092
|
+
return ao.msg({
|
|
1093
|
+
act: (_tags3$Action = _tags3["Action"]) !== null && _tags3$Action !== void 0 ? _tags3$Action : null,
|
|
1094
|
+
pid: tar,
|
|
1095
|
+
tags: _tags3,
|
|
1096
|
+
data: (_v$Data = v.Data) !== null && _v$Data !== void 0 ? _v$Data : ""
|
|
1097
|
+
});
|
|
1098
|
+
case 92:
|
|
1099
|
+
_yield$ao$msg = _context5.sent;
|
|
1100
|
+
mid = _yield$ao$msg.mid;
|
|
1101
|
+
_context5.next = 99;
|
|
1102
|
+
break;
|
|
1103
|
+
case 96:
|
|
1104
|
+
_context5.prev = 96;
|
|
1105
|
+
_context5.t13 = _context5["catch"](65);
|
|
1106
|
+
console.log(_context5.t13);
|
|
1107
|
+
case 99:
|
|
1108
|
+
_context5.next = 103;
|
|
1109
|
+
break;
|
|
1110
|
+
case 101:
|
|
1111
|
+
_context5.next = 103;
|
|
1112
|
+
return record({
|
|
1113
|
+
"for": opt.message,
|
|
1114
|
+
tags: v.Tags,
|
|
1115
|
+
data: v.Data,
|
|
1116
|
+
signer: mu.signer,
|
|
1117
|
+
from: opt.process,
|
|
1118
|
+
target: v.Target
|
|
1119
|
+
});
|
|
1120
|
+
case 103:
|
|
1121
|
+
case "end":
|
|
1122
|
+
return _context5.stop();
|
|
1123
|
+
}
|
|
1124
|
+
}, _loop, null, [[12, 30], [65, 96]]);
|
|
1125
|
+
});
|
|
869
1126
|
_iterator3.s();
|
|
870
|
-
case
|
|
1127
|
+
case 107:
|
|
871
1128
|
if ((_step3 = _iterator3.n()).done) {
|
|
872
|
-
|
|
873
|
-
break;
|
|
874
|
-
}
|
|
875
|
-
v = _step3.value;
|
|
876
|
-
_context4.next = 110;
|
|
877
|
-
return mem.get("env", v.Target);
|
|
878
|
-
case 110:
|
|
879
|
-
if (!_context4.sent) {
|
|
880
|
-
_context4.next = 115;
|
|
881
|
-
break;
|
|
882
|
-
}
|
|
883
|
-
_context4.next = 113;
|
|
884
|
-
return message({
|
|
885
|
-
"for": opt.message,
|
|
886
|
-
process: v.Target,
|
|
887
|
-
tags: v.Tags,
|
|
888
|
-
data: v.Data,
|
|
889
|
-
signer: mu.signer,
|
|
890
|
-
from: opt.process,
|
|
891
|
-
target: v.Target
|
|
892
|
-
});
|
|
893
|
-
case 113:
|
|
894
|
-
_context4.next = 181;
|
|
895
|
-
break;
|
|
896
|
-
case 115:
|
|
897
|
-
_t = (0, _utils.tags)(v.Tags); // this behaviour is different from AOS (temporary hack for remote tests)
|
|
898
|
-
if (!_t.__Scheduler__) {
|
|
899
|
-
_context4.next = 179;
|
|
900
|
-
break;
|
|
901
|
-
}
|
|
902
|
-
sch = _t.__Scheduler__;
|
|
903
|
-
tar = v.Target;
|
|
904
|
-
_context4.next = 121;
|
|
905
|
-
return fetch(sch).then(function (r) {
|
|
906
|
-
return r.json();
|
|
907
|
-
});
|
|
908
|
-
case 121:
|
|
909
|
-
_context4.t24 = _yield$fetch$then = _context4.sent;
|
|
910
|
-
_context4.t23 = _context4.t24 === null;
|
|
911
|
-
if (_context4.t23) {
|
|
912
|
-
_context4.next = 125;
|
|
913
|
-
break;
|
|
914
|
-
}
|
|
915
|
-
_context4.t23 = _yield$fetch$then === void 0;
|
|
916
|
-
case 125:
|
|
917
|
-
if (!_context4.t23) {
|
|
918
|
-
_context4.next = 129;
|
|
1129
|
+
_context6.next = 111;
|
|
919
1130
|
break;
|
|
920
1131
|
}
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
case 129:
|
|
925
|
-
_context4.t25 = _yield$fetch$then.Processes;
|
|
926
|
-
case 130:
|
|
927
|
-
_context4.t26 = _yield$fetch$then$Pro = _context4.t25;
|
|
928
|
-
_context4.t22 = _context4.t26 !== null;
|
|
929
|
-
if (!_context4.t22) {
|
|
930
|
-
_context4.next = 134;
|
|
931
|
-
break;
|
|
932
|
-
}
|
|
933
|
-
_context4.t22 = _yield$fetch$then$Pro !== void 0;
|
|
934
|
-
case 134:
|
|
935
|
-
if (!_context4.t22) {
|
|
936
|
-
_context4.next = 138;
|
|
937
|
-
break;
|
|
938
|
-
}
|
|
939
|
-
_context4.t27 = _yield$fetch$then$Pro;
|
|
940
|
-
_context4.next = 139;
|
|
941
|
-
break;
|
|
942
|
-
case 138:
|
|
943
|
-
_context4.t27 = [];
|
|
944
|
-
case 139:
|
|
945
|
-
procs = _context4.t27;
|
|
946
|
-
_context4.next = 142;
|
|
947
|
-
return new _ao["default"]({
|
|
948
|
-
port: sch.split(":").pop() - 3
|
|
949
|
-
}).init(mu.jwk);
|
|
950
|
-
case 142:
|
|
951
|
-
ao = _context4.sent;
|
|
952
|
-
_context4.prev = 143;
|
|
953
|
-
_tags2 = _objectSpread(_objectSpread({}, _t), {}, {
|
|
954
|
-
"From-Process": opt.process,
|
|
955
|
-
"Pushed-For": id
|
|
956
|
-
});
|
|
957
|
-
_context4.next = 147;
|
|
958
|
-
return mem.getTx(opt.process);
|
|
959
|
-
case 147:
|
|
960
|
-
_context4.t30 = _yield$mem$getTx4 = _context4.sent;
|
|
961
|
-
_context4.t29 = _context4.t30 === null;
|
|
962
|
-
if (_context4.t29) {
|
|
963
|
-
_context4.next = 151;
|
|
964
|
-
break;
|
|
965
|
-
}
|
|
966
|
-
_context4.t29 = _yield$mem$getTx4 === void 0;
|
|
967
|
-
case 151:
|
|
968
|
-
if (!_context4.t29) {
|
|
969
|
-
_context4.next = 155;
|
|
970
|
-
break;
|
|
971
|
-
}
|
|
972
|
-
_context4.t31 = void 0;
|
|
973
|
-
_context4.next = 156;
|
|
974
|
-
break;
|
|
975
|
-
case 155:
|
|
976
|
-
_context4.t31 = _yield$mem$getTx4.tags;
|
|
977
|
-
case 156:
|
|
978
|
-
_context4.t32 = _yield$mem$getTx$tags3 = _context4.t31;
|
|
979
|
-
_context4.t28 = _context4.t32 !== null;
|
|
980
|
-
if (!_context4.t28) {
|
|
981
|
-
_context4.next = 160;
|
|
982
|
-
break;
|
|
983
|
-
}
|
|
984
|
-
_context4.t28 = _yield$mem$getTx$tags3 !== void 0;
|
|
985
|
-
case 160:
|
|
986
|
-
if (!_context4.t28) {
|
|
987
|
-
_context4.next = 164;
|
|
988
|
-
break;
|
|
989
|
-
}
|
|
990
|
-
_context4.t33 = _yield$mem$getTx$tags3;
|
|
991
|
-
_context4.next = 165;
|
|
992
|
-
break;
|
|
993
|
-
case 164:
|
|
994
|
-
_context4.t33 = [];
|
|
995
|
-
case 165:
|
|
996
|
-
pr = _context4.t33;
|
|
997
|
-
module = (0, _utils.tags)(pr).Module;
|
|
998
|
-
if (module) _tags2["From-Module"] = module;
|
|
999
|
-
_context4.next = 170;
|
|
1000
|
-
return ao.msg({
|
|
1001
|
-
act: (_tags2$Action = _tags2["Action"]) !== null && _tags2$Action !== void 0 ? _tags2$Action : null,
|
|
1002
|
-
pid: tar,
|
|
1003
|
-
tags: _tags2,
|
|
1004
|
-
data: (_v$Data = v.Data) !== null && _v$Data !== void 0 ? _v$Data : ""
|
|
1005
|
-
});
|
|
1006
|
-
case 170:
|
|
1007
|
-
_yield$ao$msg = _context4.sent;
|
|
1008
|
-
mid = _yield$ao$msg.mid;
|
|
1009
|
-
_context4.next = 177;
|
|
1010
|
-
break;
|
|
1011
|
-
case 174:
|
|
1012
|
-
_context4.prev = 174;
|
|
1013
|
-
_context4.t34 = _context4["catch"](143);
|
|
1014
|
-
console.log(_context4.t34);
|
|
1015
|
-
case 177:
|
|
1016
|
-
_context4.next = 181;
|
|
1017
|
-
break;
|
|
1018
|
-
case 179:
|
|
1019
|
-
_context4.next = 181;
|
|
1020
|
-
return record({
|
|
1021
|
-
"for": opt.message,
|
|
1022
|
-
tags: v.Tags,
|
|
1023
|
-
data: v.Data,
|
|
1024
|
-
signer: mu.signer,
|
|
1025
|
-
from: opt.process,
|
|
1026
|
-
target: v.Target
|
|
1027
|
-
});
|
|
1028
|
-
case 181:
|
|
1029
|
-
_context4.next = 106;
|
|
1132
|
+
return _context6.delegateYield(_loop(), "t22", 109);
|
|
1133
|
+
case 109:
|
|
1134
|
+
_context6.next = 107;
|
|
1030
1135
|
break;
|
|
1031
|
-
case
|
|
1032
|
-
|
|
1136
|
+
case 111:
|
|
1137
|
+
_context6.next = 116;
|
|
1033
1138
|
break;
|
|
1034
|
-
case
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
_iterator3.e(
|
|
1038
|
-
case
|
|
1039
|
-
|
|
1139
|
+
case 113:
|
|
1140
|
+
_context6.prev = 113;
|
|
1141
|
+
_context6.t23 = _context6["catch"](104);
|
|
1142
|
+
_iterator3.e(_context6.t23);
|
|
1143
|
+
case 116:
|
|
1144
|
+
_context6.prev = 116;
|
|
1040
1145
|
_iterator3.f();
|
|
1041
|
-
return
|
|
1042
|
-
case
|
|
1146
|
+
return _context6.finish(116);
|
|
1147
|
+
case 119:
|
|
1043
1148
|
_iterator4 = _createForOfIteratorHelper((_res$Spawns = res.Spawns) !== null && _res$Spawns !== void 0 ? _res$Spawns : []);
|
|
1044
|
-
|
|
1149
|
+
_context6.prev = 120;
|
|
1045
1150
|
_iterator4.s();
|
|
1046
|
-
case
|
|
1151
|
+
case 122:
|
|
1047
1152
|
if ((_step4 = _iterator4.n()).done) {
|
|
1048
|
-
|
|
1153
|
+
_context6.next = 129;
|
|
1049
1154
|
break;
|
|
1050
1155
|
}
|
|
1051
|
-
|
|
1052
|
-
__tags = (0, _utils.tags)(
|
|
1053
|
-
|
|
1156
|
+
v = _step4.value;
|
|
1157
|
+
__tags = (0, _utils.tags)(v.Tags);
|
|
1158
|
+
_context6.next = 127;
|
|
1054
1159
|
return spawn({
|
|
1055
1160
|
"for": opt.message,
|
|
1056
1161
|
module: __tags.Module,
|
|
1057
1162
|
scheduler: scheduler,
|
|
1058
|
-
tags:
|
|
1059
|
-
data:
|
|
1163
|
+
tags: v.Tags,
|
|
1164
|
+
data: v.Data,
|
|
1060
1165
|
from: __tags["From-Process"],
|
|
1061
1166
|
signer: mu.signer
|
|
1062
1167
|
});
|
|
1063
|
-
case
|
|
1064
|
-
|
|
1168
|
+
case 127:
|
|
1169
|
+
_context6.next = 122;
|
|
1065
1170
|
break;
|
|
1066
|
-
case
|
|
1067
|
-
|
|
1171
|
+
case 129:
|
|
1172
|
+
_context6.next = 134;
|
|
1068
1173
|
break;
|
|
1069
|
-
case
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
_iterator4.e(
|
|
1073
|
-
case
|
|
1074
|
-
|
|
1174
|
+
case 131:
|
|
1175
|
+
_context6.prev = 131;
|
|
1176
|
+
_context6.t24 = _context6["catch"](120);
|
|
1177
|
+
_iterator4.e(_context6.t24);
|
|
1178
|
+
case 134:
|
|
1179
|
+
_context6.prev = 134;
|
|
1075
1180
|
_iterator4.f();
|
|
1076
|
-
return
|
|
1077
|
-
case
|
|
1181
|
+
return _context6.finish(134);
|
|
1182
|
+
case 137:
|
|
1078
1183
|
_iterator5 = _createForOfIteratorHelper((_res$Assignments = res.Assignments) !== null && _res$Assignments !== void 0 ? _res$Assignments : []);
|
|
1079
|
-
|
|
1184
|
+
_context6.prev = 138;
|
|
1080
1185
|
_iterator5.s();
|
|
1081
|
-
case
|
|
1186
|
+
case 140:
|
|
1082
1187
|
if ((_step5 = _iterator5.n()).done) {
|
|
1083
|
-
|
|
1188
|
+
_context6.next = 161;
|
|
1084
1189
|
break;
|
|
1085
1190
|
}
|
|
1086
|
-
|
|
1087
|
-
_iterator6 = _createForOfIteratorHelper(
|
|
1088
|
-
|
|
1191
|
+
_v = _step5.value;
|
|
1192
|
+
_iterator6 = _createForOfIteratorHelper(_v.Processes);
|
|
1193
|
+
_context6.prev = 143;
|
|
1089
1194
|
_iterator6.s();
|
|
1090
|
-
case
|
|
1195
|
+
case 145:
|
|
1091
1196
|
if ((_step6 = _iterator6.n()).done) {
|
|
1092
|
-
|
|
1197
|
+
_context6.next = 151;
|
|
1093
1198
|
break;
|
|
1094
1199
|
}
|
|
1095
1200
|
v2 = _step6.value;
|
|
1096
|
-
|
|
1201
|
+
_context6.next = 149;
|
|
1097
1202
|
return _assign({
|
|
1098
|
-
message:
|
|
1203
|
+
message: _v.Message,
|
|
1099
1204
|
process: v2,
|
|
1100
1205
|
from: opt.process,
|
|
1101
1206
|
signer: mu.signer
|
|
1102
1207
|
});
|
|
1103
|
-
case
|
|
1104
|
-
|
|
1208
|
+
case 149:
|
|
1209
|
+
_context6.next = 145;
|
|
1105
1210
|
break;
|
|
1106
|
-
case
|
|
1107
|
-
|
|
1211
|
+
case 151:
|
|
1212
|
+
_context6.next = 156;
|
|
1108
1213
|
break;
|
|
1109
|
-
case
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
_iterator6.e(
|
|
1113
|
-
case
|
|
1114
|
-
|
|
1214
|
+
case 153:
|
|
1215
|
+
_context6.prev = 153;
|
|
1216
|
+
_context6.t25 = _context6["catch"](143);
|
|
1217
|
+
_iterator6.e(_context6.t25);
|
|
1218
|
+
case 156:
|
|
1219
|
+
_context6.prev = 156;
|
|
1115
1220
|
_iterator6.f();
|
|
1116
|
-
return
|
|
1117
|
-
case
|
|
1118
|
-
|
|
1221
|
+
return _context6.finish(156);
|
|
1222
|
+
case 159:
|
|
1223
|
+
_context6.next = 140;
|
|
1119
1224
|
break;
|
|
1120
|
-
case
|
|
1121
|
-
|
|
1225
|
+
case 161:
|
|
1226
|
+
_context6.next = 166;
|
|
1122
1227
|
break;
|
|
1123
|
-
case
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
_iterator5.e(
|
|
1127
|
-
case
|
|
1128
|
-
|
|
1228
|
+
case 163:
|
|
1229
|
+
_context6.prev = 163;
|
|
1230
|
+
_context6.t26 = _context6["catch"](138);
|
|
1231
|
+
_iterator5.e(_context6.t26);
|
|
1232
|
+
case 166:
|
|
1233
|
+
_context6.prev = 166;
|
|
1129
1234
|
_iterator5.f();
|
|
1130
|
-
return
|
|
1131
|
-
case
|
|
1132
|
-
return
|
|
1133
|
-
case
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
console.log(
|
|
1137
|
-
case
|
|
1138
|
-
return
|
|
1139
|
-
case
|
|
1235
|
+
return _context6.finish(166);
|
|
1236
|
+
case 169:
|
|
1237
|
+
return _context6.abrupt("return", id);
|
|
1238
|
+
case 172:
|
|
1239
|
+
_context6.prev = 172;
|
|
1240
|
+
_context6.t27 = _context6["catch"](40);
|
|
1241
|
+
console.log(_context6.t27);
|
|
1242
|
+
case 175:
|
|
1243
|
+
return _context6.abrupt("return", null);
|
|
1244
|
+
case 176:
|
|
1140
1245
|
case "end":
|
|
1141
|
-
return
|
|
1246
|
+
return _context6.stop();
|
|
1142
1247
|
}
|
|
1143
|
-
},
|
|
1248
|
+
}, _callee5, null, [[40, 172], [104, 113, 116, 119], [120, 131, 134, 137], [138, 163, 166, 169], [143, 153, 156, 159]]);
|
|
1144
1249
|
}));
|
|
1145
1250
|
return function assign(_x8) {
|
|
1146
1251
|
return _ref9.apply(this, arguments);
|
|
1147
1252
|
};
|
|
1148
1253
|
}();
|
|
1149
1254
|
var message = /*#__PURE__*/function () {
|
|
1150
|
-
var
|
|
1151
|
-
var id, owner, item, _opt$id2, _key, i, _yield$ar$httpmsg2, _p, new_slot, last_slot, _opt$item$id, _opt$item, _opt$owner, p, _opt$tags3, _yield$mem$getTx$tags4, _yield$mem$getTx5, pr, module, _yield$ar$dataitem3, _msg, _opt,
|
|
1152
|
-
return _regeneratorRuntime().wrap(function
|
|
1153
|
-
while (1) switch (
|
|
1255
|
+
var _ref13 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(opt) {
|
|
1256
|
+
var id, owner, item, _opt$id2, _key, i, _yield$ar$httpmsg2, _p, new_slot, last_slot, _opt$item$id, _opt$item, _opt$owner, p, _opt$tags3, _yield$mem$getTx$tags4, _yield$mem$getTx5, pr, module, _yield$ar$dataitem3, _msg, _opt, _ref14, _opt$from2, _opt$http_msg$data, from, data, _tags, msg, _env, _yield$mem$getTx6, _yield$mem$getWasm3, format, mod, wasm, wdrive, start, res, _msg2, key;
|
|
1257
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context7) {
|
|
1258
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
1154
1259
|
case 0:
|
|
1155
1260
|
id = "";
|
|
1156
1261
|
owner = "";
|
|
1157
1262
|
item = null;
|
|
1158
1263
|
if (!ar.isHttpMsg(opt.http_msg)) {
|
|
1159
|
-
|
|
1264
|
+
_context7.next = 35;
|
|
1160
1265
|
break;
|
|
1161
1266
|
}
|
|
1162
1267
|
id = (_opt$id2 = opt.id) !== null && _opt$id2 !== void 0 ? _opt$id2 : opt.http_msg.target;
|
|
1163
1268
|
_key = "".concat(opt.process, ":").concat(id, "}");
|
|
1164
1269
|
if (!ongoing[_key]) {
|
|
1165
|
-
|
|
1270
|
+
_context7.next = 17;
|
|
1166
1271
|
break;
|
|
1167
1272
|
}
|
|
1168
1273
|
i = 0;
|
|
1169
1274
|
case 8:
|
|
1170
1275
|
if (!(i < 30 && ongoing[_key])) {
|
|
1171
|
-
|
|
1276
|
+
_context7.next = 14;
|
|
1172
1277
|
break;
|
|
1173
1278
|
}
|
|
1174
|
-
|
|
1279
|
+
_context7.next = 11;
|
|
1175
1280
|
return (0, _utils.wait)(100);
|
|
1176
1281
|
case 11:
|
|
1177
1282
|
i++;
|
|
1178
|
-
|
|
1283
|
+
_context7.next = 8;
|
|
1179
1284
|
break;
|
|
1180
1285
|
case 14:
|
|
1181
|
-
return
|
|
1286
|
+
return _context7.abrupt("return", id);
|
|
1182
1287
|
case 17:
|
|
1183
1288
|
ongoing[_key] = true;
|
|
1184
|
-
|
|
1289
|
+
_context7.next = 20;
|
|
1185
1290
|
return ar.httpmsg(opt.http_msg, id);
|
|
1186
1291
|
case 20:
|
|
1187
|
-
_yield$ar$httpmsg2 =
|
|
1292
|
+
_yield$ar$httpmsg2 = _context7.sent;
|
|
1188
1293
|
owner = _yield$ar$httpmsg2.owner;
|
|
1189
1294
|
item = _yield$ar$httpmsg2.item;
|
|
1190
|
-
|
|
1295
|
+
_context7.next = 25;
|
|
1191
1296
|
return mem.get("env", opt.process);
|
|
1192
1297
|
case 25:
|
|
1193
|
-
_p =
|
|
1298
|
+
_p = _context7.sent;
|
|
1194
1299
|
new_slot = opt.slot * 1;
|
|
1195
1300
|
last_slot = !_p ? -1 : _p.results.length - 1;
|
|
1196
1301
|
if (!(last_slot + 1 < new_slot)) {
|
|
1197
|
-
|
|
1302
|
+
_context7.next = 33;
|
|
1198
1303
|
break;
|
|
1199
1304
|
}
|
|
1200
1305
|
if (!(!hb || opt.recovery)) {
|
|
1201
|
-
|
|
1306
|
+
_context7.next = 31;
|
|
1202
1307
|
break;
|
|
1203
1308
|
}
|
|
1204
|
-
return
|
|
1309
|
+
return _context7.abrupt("return", null);
|
|
1205
1310
|
case 31:
|
|
1206
|
-
|
|
1311
|
+
_context7.next = 33;
|
|
1207
1312
|
return _recover(opt.process);
|
|
1208
1313
|
case 33:
|
|
1209
|
-
|
|
1314
|
+
_context7.next = 38;
|
|
1210
1315
|
break;
|
|
1211
1316
|
case 35:
|
|
1212
1317
|
id = (_opt$item$id = opt === null || opt === void 0 || (_opt$item = opt.item) === null || _opt$item === void 0 ? void 0 : _opt$item.id) !== null && _opt$item$id !== void 0 ? _opt$item$id : "";
|
|
1213
1318
|
owner = (_opt$owner = opt.owner) !== null && _opt$owner !== void 0 ? _opt$owner : "";
|
|
1214
1319
|
item = opt.item;
|
|
1215
1320
|
case 38:
|
|
1216
|
-
|
|
1321
|
+
_context7.next = 40;
|
|
1217
1322
|
return mem.get("env", opt.process);
|
|
1218
1323
|
case 40:
|
|
1219
|
-
p =
|
|
1324
|
+
p = _context7.sent;
|
|
1220
1325
|
if (p) {
|
|
1221
|
-
|
|
1326
|
+
_context7.next = 43;
|
|
1222
1327
|
break;
|
|
1223
1328
|
}
|
|
1224
|
-
return
|
|
1329
|
+
return _context7.abrupt("return", null);
|
|
1225
1330
|
case 43:
|
|
1226
1331
|
if (!(!opt.item && opt.signer)) {
|
|
1227
|
-
|
|
1332
|
+
_context7.next = 78;
|
|
1228
1333
|
break;
|
|
1229
1334
|
}
|
|
1230
1335
|
opt.tags = (0, _utils.buildTags)(null, (0, _ramda.mergeLeft)((0, _utils.tags)((_opt$tags3 = opt.tags) !== null && _opt$tags3 !== void 0 ? _opt$tags3 : []), {
|
|
@@ -1233,7 +1338,7 @@ var _default = exports["default"] = function _default() {
|
|
|
1233
1338
|
Type: "Message"
|
|
1234
1339
|
}));
|
|
1235
1340
|
if (!opt["for"]) {
|
|
1236
|
-
|
|
1341
|
+
_context7.next = 71;
|
|
1237
1342
|
break;
|
|
1238
1343
|
}
|
|
1239
1344
|
opt.tags.push({
|
|
@@ -1244,46 +1349,46 @@ var _default = exports["default"] = function _default() {
|
|
|
1244
1349
|
name: "From-Process",
|
|
1245
1350
|
value: opt.from
|
|
1246
1351
|
});
|
|
1247
|
-
|
|
1352
|
+
_context7.next = 50;
|
|
1248
1353
|
return mem.getTx(opt.from);
|
|
1249
1354
|
case 50:
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
if (
|
|
1253
|
-
|
|
1355
|
+
_context7.t2 = _yield$mem$getTx5 = _context7.sent;
|
|
1356
|
+
_context7.t1 = _context7.t2 === null;
|
|
1357
|
+
if (_context7.t1) {
|
|
1358
|
+
_context7.next = 54;
|
|
1254
1359
|
break;
|
|
1255
1360
|
}
|
|
1256
|
-
|
|
1361
|
+
_context7.t1 = _yield$mem$getTx5 === void 0;
|
|
1257
1362
|
case 54:
|
|
1258
|
-
if (!
|
|
1259
|
-
|
|
1363
|
+
if (!_context7.t1) {
|
|
1364
|
+
_context7.next = 58;
|
|
1260
1365
|
break;
|
|
1261
1366
|
}
|
|
1262
|
-
|
|
1263
|
-
|
|
1367
|
+
_context7.t3 = void 0;
|
|
1368
|
+
_context7.next = 59;
|
|
1264
1369
|
break;
|
|
1265
1370
|
case 58:
|
|
1266
|
-
|
|
1371
|
+
_context7.t3 = _yield$mem$getTx5.tags;
|
|
1267
1372
|
case 59:
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
if (!
|
|
1271
|
-
|
|
1373
|
+
_context7.t4 = _yield$mem$getTx$tags4 = _context7.t3;
|
|
1374
|
+
_context7.t0 = _context7.t4 !== null;
|
|
1375
|
+
if (!_context7.t0) {
|
|
1376
|
+
_context7.next = 63;
|
|
1272
1377
|
break;
|
|
1273
1378
|
}
|
|
1274
|
-
|
|
1379
|
+
_context7.t0 = _yield$mem$getTx$tags4 !== void 0;
|
|
1275
1380
|
case 63:
|
|
1276
|
-
if (!
|
|
1277
|
-
|
|
1381
|
+
if (!_context7.t0) {
|
|
1382
|
+
_context7.next = 67;
|
|
1278
1383
|
break;
|
|
1279
1384
|
}
|
|
1280
|
-
|
|
1281
|
-
|
|
1385
|
+
_context7.t5 = _yield$mem$getTx$tags4;
|
|
1386
|
+
_context7.next = 68;
|
|
1282
1387
|
break;
|
|
1283
1388
|
case 67:
|
|
1284
|
-
|
|
1389
|
+
_context7.t5 = [];
|
|
1285
1390
|
case 68:
|
|
1286
|
-
pr =
|
|
1391
|
+
pr = _context7.t5;
|
|
1287
1392
|
module = (0, _utils.tags)(pr).Module;
|
|
1288
1393
|
if (module) opt.tags.push({
|
|
1289
1394
|
name: "From-Module",
|
|
@@ -1291,7 +1396,7 @@ var _default = exports["default"] = function _default() {
|
|
|
1291
1396
|
});
|
|
1292
1397
|
case 71:
|
|
1293
1398
|
;
|
|
1294
|
-
|
|
1399
|
+
_context7.next = 74;
|
|
1295
1400
|
return ar.dataitem({
|
|
1296
1401
|
data: opt.data,
|
|
1297
1402
|
signer: opt.signer,
|
|
@@ -1299,90 +1404,90 @@ var _default = exports["default"] = function _default() {
|
|
|
1299
1404
|
target: opt.process
|
|
1300
1405
|
});
|
|
1301
1406
|
case 74:
|
|
1302
|
-
_yield$ar$dataitem3 =
|
|
1407
|
+
_yield$ar$dataitem3 = _context7.sent;
|
|
1303
1408
|
item = _yield$ar$dataitem3.item;
|
|
1304
1409
|
id = _yield$ar$dataitem3.id;
|
|
1305
1410
|
owner = _yield$ar$dataitem3.owner;
|
|
1306
1411
|
case 78:
|
|
1307
1412
|
_msg = (0, _ramda.dissoc)("signer", opt);
|
|
1308
|
-
|
|
1413
|
+
_context7.next = 81;
|
|
1309
1414
|
return mem.set(_msg, "msgs", id);
|
|
1310
1415
|
case 81:
|
|
1311
1416
|
if (!ar.isHttpMsg(opt.http_msg)) {
|
|
1312
|
-
|
|
1417
|
+
_context7.next = 145;
|
|
1313
1418
|
break;
|
|
1314
1419
|
}
|
|
1315
1420
|
p.epochs.push([id]);
|
|
1316
1421
|
_opt = opt;
|
|
1317
|
-
|
|
1422
|
+
_context7.prev = 84;
|
|
1318
1423
|
// todo: not sure if this is correct
|
|
1319
|
-
from = (
|
|
1424
|
+
from = (_ref14 = (_opt$from2 = _opt.from) !== null && _opt$from2 !== void 0 ? _opt$from2 : opt.from) !== null && _ref14 !== void 0 ? _ref14 : owner;
|
|
1320
1425
|
data = (_opt$http_msg$data = opt.http_msg.data) !== null && _opt$http_msg$data !== void 0 ? _opt$http_msg$data : "";
|
|
1321
1426
|
_tags = _opt.http_msg.tags; // todo: check if owner=mu.addr right?
|
|
1322
|
-
|
|
1427
|
+
_context7.next = 90;
|
|
1323
1428
|
return genMsg(opt.http_msg, p, data, _tags, from, owner);
|
|
1324
1429
|
case 90:
|
|
1325
|
-
msg =
|
|
1326
|
-
|
|
1430
|
+
msg = _context7.sent;
|
|
1431
|
+
_context7.next = 93;
|
|
1327
1432
|
return genEnv({
|
|
1328
1433
|
pid: p.id,
|
|
1329
1434
|
owner: p.owner,
|
|
1330
1435
|
module: p.module
|
|
1331
1436
|
});
|
|
1332
1437
|
case 93:
|
|
1333
|
-
_env =
|
|
1438
|
+
_env = _context7.sent;
|
|
1334
1439
|
if (p.handle) {
|
|
1335
|
-
|
|
1440
|
+
_context7.next = 126;
|
|
1336
1441
|
break;
|
|
1337
1442
|
}
|
|
1338
|
-
|
|
1443
|
+
_context7.next = 97;
|
|
1339
1444
|
return mem.getWasm(p.modulea);
|
|
1340
1445
|
case 97:
|
|
1341
|
-
_yield$mem$getWasm3 =
|
|
1446
|
+
_yield$mem$getWasm3 = _context7.sent;
|
|
1342
1447
|
format = _yield$mem$getWasm3.format;
|
|
1343
1448
|
mod = _yield$mem$getWasm3.mod;
|
|
1344
1449
|
wasm = _yield$mem$getWasm3.wasm;
|
|
1345
1450
|
wdrive = extensions[p.extention];
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1451
|
+
_context7.t6 = AoLoader;
|
|
1452
|
+
_context7.t7 = wasm;
|
|
1453
|
+
_context7.t8 = format;
|
|
1454
|
+
_context7.t9 = wdrive;
|
|
1455
|
+
_context7.next = 108;
|
|
1351
1456
|
return mem.getTx(p.id);
|
|
1352
1457
|
case 108:
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
if (
|
|
1356
|
-
|
|
1458
|
+
_context7.t11 = _yield$mem$getTx6 = _context7.sent;
|
|
1459
|
+
_context7.t10 = _context7.t11 === null;
|
|
1460
|
+
if (_context7.t10) {
|
|
1461
|
+
_context7.next = 112;
|
|
1357
1462
|
break;
|
|
1358
1463
|
}
|
|
1359
|
-
|
|
1464
|
+
_context7.t10 = _yield$mem$getTx6 === void 0;
|
|
1360
1465
|
case 112:
|
|
1361
|
-
if (!
|
|
1362
|
-
|
|
1466
|
+
if (!_context7.t10) {
|
|
1467
|
+
_context7.next = 116;
|
|
1363
1468
|
break;
|
|
1364
1469
|
}
|
|
1365
|
-
|
|
1366
|
-
|
|
1470
|
+
_context7.t12 = void 0;
|
|
1471
|
+
_context7.next = 117;
|
|
1367
1472
|
break;
|
|
1368
1473
|
case 116:
|
|
1369
|
-
|
|
1474
|
+
_context7.t12 = _yield$mem$getTx6.item;
|
|
1370
1475
|
case 117:
|
|
1371
|
-
|
|
1372
|
-
|
|
1476
|
+
_context7.t13 = _context7.t12;
|
|
1477
|
+
_context7.next = 120;
|
|
1373
1478
|
return mem.getTx(mod);
|
|
1374
1479
|
case 120:
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
format:
|
|
1378
|
-
WeaveDrive:
|
|
1379
|
-
spawn:
|
|
1380
|
-
module:
|
|
1480
|
+
_context7.t14 = _context7.sent;
|
|
1481
|
+
_context7.t15 = {
|
|
1482
|
+
format: _context7.t8,
|
|
1483
|
+
WeaveDrive: _context7.t9,
|
|
1484
|
+
spawn: _context7.t13,
|
|
1485
|
+
module: _context7.t14
|
|
1381
1486
|
};
|
|
1382
|
-
|
|
1383
|
-
return (0,
|
|
1487
|
+
_context7.next = 124;
|
|
1488
|
+
return (0, _context7.t6)(_context7.t7, _context7.t15);
|
|
1384
1489
|
case 124:
|
|
1385
|
-
p.handle =
|
|
1490
|
+
p.handle = _context7.sent;
|
|
1386
1491
|
mem.env[opt.process].handle = p.handle;
|
|
1387
1492
|
case 126:
|
|
1388
1493
|
if (p.compressed) {
|
|
@@ -1390,34 +1495,34 @@ var _default = exports["default"] = function _default() {
|
|
|
1390
1495
|
p.memory = mem.decompress(p.memory, p.original_size);
|
|
1391
1496
|
p.compressed = false;
|
|
1392
1497
|
}
|
|
1393
|
-
|
|
1498
|
+
_context7.next = 129;
|
|
1394
1499
|
return p.handle(p.memory, msg, _env);
|
|
1395
1500
|
case 129:
|
|
1396
|
-
res =
|
|
1501
|
+
res = _context7.sent;
|
|
1397
1502
|
p.memory = res.Memory;
|
|
1398
1503
|
delete res.Memory;
|
|
1399
1504
|
p.results.push(id);
|
|
1400
|
-
|
|
1505
|
+
_context7.next = 135;
|
|
1401
1506
|
return mem.set(p, "env", opt.process);
|
|
1402
1507
|
case 135:
|
|
1403
1508
|
_msg2 = _objectSpread(_objectSpread({}, (0, _ramda.dissoc)("signer", _opt)), {}, {
|
|
1404
1509
|
res: res,
|
|
1405
1510
|
msg: msg
|
|
1406
1511
|
});
|
|
1407
|
-
|
|
1512
|
+
_context7.next = 138;
|
|
1408
1513
|
return mem.set(_msg2, "msgs", id);
|
|
1409
1514
|
case 138:
|
|
1410
|
-
|
|
1515
|
+
_context7.next = 143;
|
|
1411
1516
|
break;
|
|
1412
1517
|
case 140:
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
console.log(
|
|
1518
|
+
_context7.prev = 140;
|
|
1519
|
+
_context7.t16 = _context7["catch"](84);
|
|
1520
|
+
console.log(_context7.t16);
|
|
1416
1521
|
case 143:
|
|
1417
|
-
|
|
1522
|
+
_context7.next = 147;
|
|
1418
1523
|
break;
|
|
1419
1524
|
case 145:
|
|
1420
|
-
|
|
1525
|
+
_context7.next = 147;
|
|
1421
1526
|
return _assign({
|
|
1422
1527
|
message_item: item,
|
|
1423
1528
|
message: id,
|
|
@@ -1428,23 +1533,23 @@ var _default = exports["default"] = function _default() {
|
|
|
1428
1533
|
case 147:
|
|
1429
1534
|
key = "".concat(opt.process, ":").concat(id, "}");
|
|
1430
1535
|
delete ongoing[key];
|
|
1431
|
-
return
|
|
1536
|
+
return _context7.abrupt("return", id);
|
|
1432
1537
|
case 150:
|
|
1433
1538
|
case "end":
|
|
1434
|
-
return
|
|
1539
|
+
return _context7.stop();
|
|
1435
1540
|
}
|
|
1436
|
-
},
|
|
1541
|
+
}, _callee6, null, [[84, 140]]);
|
|
1437
1542
|
}));
|
|
1438
|
-
return function message(
|
|
1439
|
-
return
|
|
1543
|
+
return function message(_x10) {
|
|
1544
|
+
return _ref13.apply(this, arguments);
|
|
1440
1545
|
};
|
|
1441
1546
|
}();
|
|
1442
1547
|
var record = /*#__PURE__*/function () {
|
|
1443
|
-
var
|
|
1548
|
+
var _ref15 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(opt) {
|
|
1444
1549
|
var _opt$item$id2, _opt$item2, _opt$owner2, _opt$tags4;
|
|
1445
1550
|
var id, owner, item, _yield$mem$getTx$tags5, _yield$mem$getTx7, pr, module, _yield$ar$dataitem4, _msg;
|
|
1446
|
-
return _regeneratorRuntime().wrap(function
|
|
1447
|
-
while (1) switch (
|
|
1551
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context8) {
|
|
1552
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
1448
1553
|
case 0:
|
|
1449
1554
|
id = (_opt$item$id2 = opt === null || opt === void 0 || (_opt$item2 = opt.item) === null || _opt$item2 === void 0 ? void 0 : _opt$item2.id) !== null && _opt$item$id2 !== void 0 ? _opt$item$id2 : "";
|
|
1450
1555
|
owner = (_opt$owner2 = opt.owner) !== null && _opt$owner2 !== void 0 ? _opt$owner2 : "";
|
|
@@ -1455,7 +1560,7 @@ var _default = exports["default"] = function _default() {
|
|
|
1455
1560
|
Type: "Message"
|
|
1456
1561
|
}));
|
|
1457
1562
|
if (!opt["for"]) {
|
|
1458
|
-
|
|
1563
|
+
_context8.next = 30;
|
|
1459
1564
|
break;
|
|
1460
1565
|
}
|
|
1461
1566
|
opt.tags.push({
|
|
@@ -1466,46 +1571,46 @@ var _default = exports["default"] = function _default() {
|
|
|
1466
1571
|
name: "From-Process",
|
|
1467
1572
|
value: opt.from
|
|
1468
1573
|
});
|
|
1469
|
-
|
|
1574
|
+
_context8.next = 9;
|
|
1470
1575
|
return mem.getTx(opt.from);
|
|
1471
1576
|
case 9:
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
if (
|
|
1475
|
-
|
|
1577
|
+
_context8.t2 = _yield$mem$getTx7 = _context8.sent;
|
|
1578
|
+
_context8.t1 = _context8.t2 === null;
|
|
1579
|
+
if (_context8.t1) {
|
|
1580
|
+
_context8.next = 13;
|
|
1476
1581
|
break;
|
|
1477
1582
|
}
|
|
1478
|
-
|
|
1583
|
+
_context8.t1 = _yield$mem$getTx7 === void 0;
|
|
1479
1584
|
case 13:
|
|
1480
|
-
if (!
|
|
1481
|
-
|
|
1585
|
+
if (!_context8.t1) {
|
|
1586
|
+
_context8.next = 17;
|
|
1482
1587
|
break;
|
|
1483
1588
|
}
|
|
1484
|
-
|
|
1485
|
-
|
|
1589
|
+
_context8.t3 = void 0;
|
|
1590
|
+
_context8.next = 18;
|
|
1486
1591
|
break;
|
|
1487
1592
|
case 17:
|
|
1488
|
-
|
|
1593
|
+
_context8.t3 = _yield$mem$getTx7.tags;
|
|
1489
1594
|
case 18:
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
if (!
|
|
1493
|
-
|
|
1595
|
+
_context8.t4 = _yield$mem$getTx$tags5 = _context8.t3;
|
|
1596
|
+
_context8.t0 = _context8.t4 !== null;
|
|
1597
|
+
if (!_context8.t0) {
|
|
1598
|
+
_context8.next = 22;
|
|
1494
1599
|
break;
|
|
1495
1600
|
}
|
|
1496
|
-
|
|
1601
|
+
_context8.t0 = _yield$mem$getTx$tags5 !== void 0;
|
|
1497
1602
|
case 22:
|
|
1498
|
-
if (!
|
|
1499
|
-
|
|
1603
|
+
if (!_context8.t0) {
|
|
1604
|
+
_context8.next = 26;
|
|
1500
1605
|
break;
|
|
1501
1606
|
}
|
|
1502
|
-
|
|
1503
|
-
|
|
1607
|
+
_context8.t5 = _yield$mem$getTx$tags5;
|
|
1608
|
+
_context8.next = 27;
|
|
1504
1609
|
break;
|
|
1505
1610
|
case 26:
|
|
1506
|
-
|
|
1611
|
+
_context8.t5 = [];
|
|
1507
1612
|
case 27:
|
|
1508
|
-
pr =
|
|
1613
|
+
pr = _context8.t5;
|
|
1509
1614
|
module = (0, _utils.tags)(pr).Module;
|
|
1510
1615
|
if (module) opt.tags.push({
|
|
1511
1616
|
name: "From-Module",
|
|
@@ -1513,7 +1618,7 @@ var _default = exports["default"] = function _default() {
|
|
|
1513
1618
|
});
|
|
1514
1619
|
case 30:
|
|
1515
1620
|
;
|
|
1516
|
-
|
|
1621
|
+
_context8.next = 33;
|
|
1517
1622
|
return ar.dataitem({
|
|
1518
1623
|
data: opt.data,
|
|
1519
1624
|
signer: opt.signer,
|
|
@@ -1521,106 +1626,106 @@ var _default = exports["default"] = function _default() {
|
|
|
1521
1626
|
target: opt.process
|
|
1522
1627
|
});
|
|
1523
1628
|
case 33:
|
|
1524
|
-
_yield$ar$dataitem4 =
|
|
1629
|
+
_yield$ar$dataitem4 = _context8.sent;
|
|
1525
1630
|
item = _yield$ar$dataitem4.item;
|
|
1526
1631
|
id = _yield$ar$dataitem4.id;
|
|
1527
1632
|
owner = _yield$ar$dataitem4.owner;
|
|
1528
1633
|
_msg = (0, _ramda.dissoc)("signer", opt);
|
|
1529
|
-
|
|
1634
|
+
_context8.next = 40;
|
|
1530
1635
|
return mem.set(_msg, "msgs", id);
|
|
1531
1636
|
case 40:
|
|
1532
|
-
|
|
1637
|
+
_context8.next = 42;
|
|
1533
1638
|
return ar.postItems(item, su.jwk);
|
|
1534
1639
|
case 42:
|
|
1535
1640
|
case "end":
|
|
1536
|
-
return
|
|
1641
|
+
return _context8.stop();
|
|
1537
1642
|
}
|
|
1538
|
-
},
|
|
1643
|
+
}, _callee7);
|
|
1539
1644
|
}));
|
|
1540
|
-
return function record(
|
|
1541
|
-
return
|
|
1645
|
+
return function record(_x11) {
|
|
1646
|
+
return _ref15.apply(this, arguments);
|
|
1542
1647
|
};
|
|
1543
1648
|
}();
|
|
1544
1649
|
var _recover = /*#__PURE__*/function () {
|
|
1545
|
-
var
|
|
1650
|
+
var _ref16 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(pid, next) {
|
|
1546
1651
|
var count, success, _success, i, p, from, msgs, _iterator7, _step7, v, item, _k2, _tags;
|
|
1547
|
-
return _regeneratorRuntime().wrap(function
|
|
1548
|
-
while (1) switch (
|
|
1652
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context9) {
|
|
1653
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
1549
1654
|
case 0:
|
|
1550
1655
|
count = 0;
|
|
1551
1656
|
success = false;
|
|
1552
1657
|
if (!hb) {
|
|
1553
|
-
|
|
1658
|
+
_context9.next = 77;
|
|
1554
1659
|
break;
|
|
1555
1660
|
}
|
|
1556
1661
|
if (!onRecovery[pid]) {
|
|
1557
|
-
|
|
1662
|
+
_context9.next = 20;
|
|
1558
1663
|
break;
|
|
1559
1664
|
}
|
|
1560
1665
|
_success = false;
|
|
1561
1666
|
i = 0;
|
|
1562
1667
|
case 6:
|
|
1563
1668
|
if (!true) {
|
|
1564
|
-
|
|
1669
|
+
_context9.next = 17;
|
|
1565
1670
|
break;
|
|
1566
1671
|
}
|
|
1567
|
-
|
|
1672
|
+
_context9.next = 9;
|
|
1568
1673
|
return (0, _utils.wait)(1000);
|
|
1569
1674
|
case 9:
|
|
1570
1675
|
if (onRecovery[pid]) {
|
|
1571
|
-
|
|
1676
|
+
_context9.next = 12;
|
|
1572
1677
|
break;
|
|
1573
1678
|
}
|
|
1574
1679
|
_success = true;
|
|
1575
|
-
return
|
|
1680
|
+
return _context9.abrupt("break", 17);
|
|
1576
1681
|
case 12:
|
|
1577
1682
|
if (!(i > 10)) {
|
|
1578
|
-
|
|
1683
|
+
_context9.next = 14;
|
|
1579
1684
|
break;
|
|
1580
1685
|
}
|
|
1581
|
-
return
|
|
1686
|
+
return _context9.abrupt("break", 17);
|
|
1582
1687
|
case 14:
|
|
1583
1688
|
i++;
|
|
1584
|
-
|
|
1689
|
+
_context9.next = 6;
|
|
1585
1690
|
break;
|
|
1586
1691
|
case 17:
|
|
1587
|
-
return
|
|
1692
|
+
return _context9.abrupt("return", {
|
|
1588
1693
|
success: _success
|
|
1589
1694
|
});
|
|
1590
1695
|
case 20:
|
|
1591
1696
|
onRecovery[pid] = true;
|
|
1592
|
-
|
|
1593
|
-
|
|
1697
|
+
_context9.prev = 21;
|
|
1698
|
+
_context9.next = 24;
|
|
1594
1699
|
return mem.get("env", pid);
|
|
1595
1700
|
case 24:
|
|
1596
|
-
p =
|
|
1701
|
+
p = _context9.sent;
|
|
1597
1702
|
from = p ? p.results.length : 0;
|
|
1598
1703
|
if (!next) {
|
|
1599
|
-
|
|
1704
|
+
_context9.next = 32;
|
|
1600
1705
|
break;
|
|
1601
1706
|
}
|
|
1602
|
-
|
|
1707
|
+
_context9.next = 29;
|
|
1603
1708
|
return next();
|
|
1604
1709
|
case 29:
|
|
1605
|
-
|
|
1606
|
-
|
|
1710
|
+
_context9.t0 = _context9.sent;
|
|
1711
|
+
_context9.next = 35;
|
|
1607
1712
|
break;
|
|
1608
1713
|
case 32:
|
|
1609
|
-
|
|
1714
|
+
_context9.next = 34;
|
|
1610
1715
|
return hb.messages({
|
|
1611
1716
|
target: pid,
|
|
1612
1717
|
from: from
|
|
1613
1718
|
});
|
|
1614
1719
|
case 34:
|
|
1615
|
-
|
|
1720
|
+
_context9.t0 = _context9.sent;
|
|
1616
1721
|
case 35:
|
|
1617
|
-
msgs =
|
|
1722
|
+
msgs = _context9.t0;
|
|
1618
1723
|
_iterator7 = _createForOfIteratorHelper(msgs.edges);
|
|
1619
|
-
|
|
1724
|
+
_context9.prev = 37;
|
|
1620
1725
|
_iterator7.s();
|
|
1621
1726
|
case 39:
|
|
1622
1727
|
if ((_step7 = _iterator7.n()).done) {
|
|
1623
|
-
|
|
1728
|
+
_context9.next = 59;
|
|
1624
1729
|
break;
|
|
1625
1730
|
}
|
|
1626
1731
|
v = _step7.value;
|
|
@@ -1648,10 +1753,10 @@ var _default = exports["default"] = function _default() {
|
|
|
1648
1753
|
item.target = pid;
|
|
1649
1754
|
_tags = (0, _utils.tags)(item.tags);
|
|
1650
1755
|
if (!(_tags.Type === "Process")) {
|
|
1651
|
-
|
|
1756
|
+
_context9.next = 54;
|
|
1652
1757
|
break;
|
|
1653
1758
|
}
|
|
1654
|
-
|
|
1759
|
+
_context9.next = 52;
|
|
1655
1760
|
return spawn({
|
|
1656
1761
|
id: v.node.message.Id,
|
|
1657
1762
|
http_msg: item,
|
|
@@ -1661,10 +1766,10 @@ var _default = exports["default"] = function _default() {
|
|
|
1661
1766
|
recovery: true
|
|
1662
1767
|
});
|
|
1663
1768
|
case 52:
|
|
1664
|
-
|
|
1769
|
+
_context9.next = 56;
|
|
1665
1770
|
break;
|
|
1666
1771
|
case 54:
|
|
1667
|
-
|
|
1772
|
+
_context9.next = 56;
|
|
1668
1773
|
return message({
|
|
1669
1774
|
id: v.node.message.Id,
|
|
1670
1775
|
process: pid,
|
|
@@ -1675,134 +1780,134 @@ var _default = exports["default"] = function _default() {
|
|
|
1675
1780
|
case 56:
|
|
1676
1781
|
count++;
|
|
1677
1782
|
case 57:
|
|
1678
|
-
|
|
1783
|
+
_context9.next = 39;
|
|
1679
1784
|
break;
|
|
1680
1785
|
case 59:
|
|
1681
|
-
|
|
1786
|
+
_context9.next = 64;
|
|
1682
1787
|
break;
|
|
1683
1788
|
case 61:
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
_iterator7.e(
|
|
1789
|
+
_context9.prev = 61;
|
|
1790
|
+
_context9.t1 = _context9["catch"](37);
|
|
1791
|
+
_iterator7.e(_context9.t1);
|
|
1687
1792
|
case 64:
|
|
1688
|
-
|
|
1793
|
+
_context9.prev = 64;
|
|
1689
1794
|
_iterator7.f();
|
|
1690
|
-
return
|
|
1795
|
+
return _context9.finish(64);
|
|
1691
1796
|
case 67:
|
|
1692
1797
|
if (!msgs.next) {
|
|
1693
|
-
|
|
1798
|
+
_context9.next = 70;
|
|
1694
1799
|
break;
|
|
1695
1800
|
}
|
|
1696
|
-
|
|
1801
|
+
_context9.next = 70;
|
|
1697
1802
|
return _recover(pid, msgs.next);
|
|
1698
1803
|
case 70:
|
|
1699
|
-
|
|
1804
|
+
_context9.next = 75;
|
|
1700
1805
|
break;
|
|
1701
1806
|
case 72:
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
console.log(
|
|
1807
|
+
_context9.prev = 72;
|
|
1808
|
+
_context9.t2 = _context9["catch"](21);
|
|
1809
|
+
console.log(_context9.t2);
|
|
1705
1810
|
case 75:
|
|
1706
1811
|
delete onRecovery[pid];
|
|
1707
1812
|
case 76:
|
|
1708
1813
|
success = true;
|
|
1709
1814
|
case 77:
|
|
1710
|
-
return
|
|
1815
|
+
return _context9.abrupt("return", {
|
|
1711
1816
|
recovered: count,
|
|
1712
1817
|
pid: pid,
|
|
1713
1818
|
success: success
|
|
1714
1819
|
});
|
|
1715
1820
|
case 78:
|
|
1716
1821
|
case "end":
|
|
1717
|
-
return
|
|
1822
|
+
return _context9.stop();
|
|
1718
1823
|
}
|
|
1719
|
-
},
|
|
1824
|
+
}, _callee8, null, [[21, 72], [37, 61, 64, 67]]);
|
|
1720
1825
|
}));
|
|
1721
|
-
return function recover(
|
|
1722
|
-
return
|
|
1826
|
+
return function recover(_x12, _x13) {
|
|
1827
|
+
return _ref16.apply(this, arguments);
|
|
1723
1828
|
};
|
|
1724
1829
|
}();
|
|
1725
1830
|
var result = /*#__PURE__*/function () {
|
|
1726
|
-
var
|
|
1831
|
+
var _ref17 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(opt) {
|
|
1727
1832
|
var _yield$mem$get2;
|
|
1728
|
-
return _regeneratorRuntime().wrap(function
|
|
1729
|
-
while (1) switch (
|
|
1833
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context10) {
|
|
1834
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
1730
1835
|
case 0:
|
|
1731
|
-
|
|
1836
|
+
_context10.next = 2;
|
|
1732
1837
|
return mem.get("msgs", opt.message);
|
|
1733
1838
|
case 2:
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
if (
|
|
1737
|
-
|
|
1839
|
+
_context10.t1 = _yield$mem$get2 = _context10.sent;
|
|
1840
|
+
_context10.t0 = _context10.t1 === null;
|
|
1841
|
+
if (_context10.t0) {
|
|
1842
|
+
_context10.next = 6;
|
|
1738
1843
|
break;
|
|
1739
1844
|
}
|
|
1740
|
-
|
|
1845
|
+
_context10.t0 = _yield$mem$get2 === void 0;
|
|
1741
1846
|
case 6:
|
|
1742
|
-
if (!
|
|
1743
|
-
|
|
1847
|
+
if (!_context10.t0) {
|
|
1848
|
+
_context10.next = 10;
|
|
1744
1849
|
break;
|
|
1745
1850
|
}
|
|
1746
|
-
|
|
1747
|
-
|
|
1851
|
+
_context10.t2 = void 0;
|
|
1852
|
+
_context10.next = 11;
|
|
1748
1853
|
break;
|
|
1749
1854
|
case 10:
|
|
1750
|
-
|
|
1855
|
+
_context10.t2 = _yield$mem$get2.res;
|
|
1751
1856
|
case 11:
|
|
1752
|
-
return
|
|
1857
|
+
return _context10.abrupt("return", _context10.t2);
|
|
1753
1858
|
case 12:
|
|
1754
1859
|
case "end":
|
|
1755
|
-
return
|
|
1860
|
+
return _context10.stop();
|
|
1756
1861
|
}
|
|
1757
|
-
},
|
|
1862
|
+
}, _callee9);
|
|
1758
1863
|
}));
|
|
1759
|
-
return function result(
|
|
1760
|
-
return
|
|
1864
|
+
return function result(_x14) {
|
|
1865
|
+
return _ref17.apply(this, arguments);
|
|
1761
1866
|
};
|
|
1762
1867
|
}();
|
|
1763
1868
|
return {
|
|
1764
1869
|
message: message,
|
|
1765
1870
|
unmonitor: function () {
|
|
1766
|
-
var _unmonitor = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1871
|
+
var _unmonitor = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(opt) {
|
|
1767
1872
|
var p;
|
|
1768
|
-
return _regeneratorRuntime().wrap(function
|
|
1769
|
-
while (1) switch (
|
|
1873
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context11) {
|
|
1874
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
1770
1875
|
case 0:
|
|
1771
|
-
|
|
1876
|
+
_context11.next = 2;
|
|
1772
1877
|
return mem.get("env", opt.process);
|
|
1773
1878
|
case 2:
|
|
1774
|
-
p =
|
|
1879
|
+
p = _context11.sent;
|
|
1775
1880
|
try {
|
|
1776
1881
|
clearInterval(p.cron);
|
|
1777
1882
|
p.cron = null;
|
|
1778
1883
|
} catch (e) {}
|
|
1779
1884
|
case 4:
|
|
1780
1885
|
case "end":
|
|
1781
|
-
return
|
|
1886
|
+
return _context11.stop();
|
|
1782
1887
|
}
|
|
1783
|
-
},
|
|
1888
|
+
}, _callee10);
|
|
1784
1889
|
}));
|
|
1785
|
-
function unmonitor(
|
|
1890
|
+
function unmonitor(_x15) {
|
|
1786
1891
|
return _unmonitor.apply(this, arguments);
|
|
1787
1892
|
}
|
|
1788
1893
|
return unmonitor;
|
|
1789
1894
|
}(),
|
|
1790
1895
|
monitor: function () {
|
|
1791
|
-
var _monitor = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1896
|
+
var _monitor = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12(opt) {
|
|
1792
1897
|
var p;
|
|
1793
|
-
return _regeneratorRuntime().wrap(function
|
|
1794
|
-
while (1) switch (
|
|
1898
|
+
return _regeneratorRuntime().wrap(function _callee12$(_context13) {
|
|
1899
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
1795
1900
|
case 0:
|
|
1796
|
-
|
|
1901
|
+
_context13.next = 2;
|
|
1797
1902
|
return mem.get("env", opt.process);
|
|
1798
1903
|
case 2:
|
|
1799
|
-
p =
|
|
1904
|
+
p = _context13.sent;
|
|
1800
1905
|
if ((0, _ramda.isNil)(p.cron)) {
|
|
1801
|
-
p.cron = setInterval(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1802
|
-
return _regeneratorRuntime().wrap(function
|
|
1803
|
-
while (1) switch (
|
|
1906
|
+
p.cron = setInterval(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
|
|
1907
|
+
return _regeneratorRuntime().wrap(function _callee11$(_context12) {
|
|
1908
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
1804
1909
|
case 0:
|
|
1805
|
-
|
|
1910
|
+
_context12.next = 2;
|
|
1806
1911
|
return message({
|
|
1807
1912
|
tags: p.cronTags,
|
|
1808
1913
|
process: opt.process,
|
|
@@ -1811,18 +1916,18 @@ var _default = exports["default"] = function _default() {
|
|
|
1811
1916
|
});
|
|
1812
1917
|
case 2:
|
|
1813
1918
|
case "end":
|
|
1814
|
-
return
|
|
1919
|
+
return _context12.stop();
|
|
1815
1920
|
}
|
|
1816
|
-
},
|
|
1921
|
+
}, _callee11);
|
|
1817
1922
|
})), p.span);
|
|
1818
1923
|
}
|
|
1819
1924
|
case 4:
|
|
1820
1925
|
case "end":
|
|
1821
|
-
return
|
|
1926
|
+
return _context13.stop();
|
|
1822
1927
|
}
|
|
1823
|
-
},
|
|
1928
|
+
}, _callee12);
|
|
1824
1929
|
}));
|
|
1825
|
-
function monitor(
|
|
1930
|
+
function monitor(_x16) {
|
|
1826
1931
|
return _monitor.apply(this, arguments);
|
|
1827
1932
|
}
|
|
1828
1933
|
return monitor;
|
|
@@ -1832,135 +1937,135 @@ var _default = exports["default"] = function _default() {
|
|
|
1832
1937
|
ar: ar,
|
|
1833
1938
|
result: result,
|
|
1834
1939
|
results: function () {
|
|
1835
|
-
var _results = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1836
|
-
var p, results,
|
|
1837
|
-
return _regeneratorRuntime().wrap(function
|
|
1838
|
-
while (1) switch (
|
|
1940
|
+
var _results = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee13(opt) {
|
|
1941
|
+
var p, results, _ref19, _ref19$from, from, _ref19$to, to, _ref19$sort, sort, _ref19$limit, limit, _res, count, started, _iterator8, _step8, v;
|
|
1942
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context14) {
|
|
1943
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
1839
1944
|
case 0:
|
|
1840
|
-
|
|
1945
|
+
_context14.next = 2;
|
|
1841
1946
|
return mem.get("env", opt.process);
|
|
1842
1947
|
case 2:
|
|
1843
|
-
p =
|
|
1948
|
+
p = _context14.sent;
|
|
1844
1949
|
if (p) {
|
|
1845
|
-
|
|
1950
|
+
_context14.next = 5;
|
|
1846
1951
|
break;
|
|
1847
1952
|
}
|
|
1848
|
-
return
|
|
1953
|
+
return _context14.abrupt("return", {
|
|
1849
1954
|
edges: []
|
|
1850
1955
|
});
|
|
1851
1956
|
case 5:
|
|
1852
1957
|
results = (p === null || p === void 0 ? void 0 : p.results) || [];
|
|
1853
|
-
|
|
1958
|
+
_ref19 = opt || {}, _ref19$from = _ref19.from, from = _ref19$from === void 0 ? null : _ref19$from, _ref19$to = _ref19.to, to = _ref19$to === void 0 ? null : _ref19$to, _ref19$sort = _ref19.sort, sort = _ref19$sort === void 0 ? "ASC" : _ref19$sort, _ref19$limit = _ref19.limit, limit = _ref19$limit === void 0 ? 25 : _ref19$limit;
|
|
1854
1959
|
if (sort === "DESC") results = (0, _ramda.reverse)(results);
|
|
1855
1960
|
_res = [];
|
|
1856
1961
|
count = 0;
|
|
1857
1962
|
started = (0, _ramda.isNil)(from);
|
|
1858
1963
|
_iterator8 = _createForOfIteratorHelper(results);
|
|
1859
|
-
|
|
1964
|
+
_context14.prev = 12;
|
|
1860
1965
|
_iterator8.s();
|
|
1861
1966
|
case 14:
|
|
1862
1967
|
if ((_step8 = _iterator8.n()).done) {
|
|
1863
|
-
|
|
1968
|
+
_context14.next = 34;
|
|
1864
1969
|
break;
|
|
1865
1970
|
}
|
|
1866
1971
|
v = _step8.value;
|
|
1867
1972
|
if (!started) {
|
|
1868
|
-
|
|
1973
|
+
_context14.next = 31;
|
|
1869
1974
|
break;
|
|
1870
1975
|
}
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1976
|
+
_context14.t0 = _res;
|
|
1977
|
+
_context14.t1 = v;
|
|
1978
|
+
_context14.next = 21;
|
|
1874
1979
|
return result({
|
|
1875
1980
|
message: v
|
|
1876
1981
|
});
|
|
1877
1982
|
case 21:
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
cursor:
|
|
1881
|
-
node:
|
|
1983
|
+
_context14.t2 = _context14.sent;
|
|
1984
|
+
_context14.t3 = {
|
|
1985
|
+
cursor: _context14.t1,
|
|
1986
|
+
node: _context14.t2
|
|
1882
1987
|
};
|
|
1883
|
-
|
|
1988
|
+
_context14.t0.push.call(_context14.t0, _context14.t3);
|
|
1884
1989
|
count++;
|
|
1885
1990
|
if (!(!(0, _ramda.isNil)(to) && v === to)) {
|
|
1886
|
-
|
|
1991
|
+
_context14.next = 27;
|
|
1887
1992
|
break;
|
|
1888
1993
|
}
|
|
1889
|
-
return
|
|
1994
|
+
return _context14.abrupt("break", 34);
|
|
1890
1995
|
case 27:
|
|
1891
1996
|
if (!(limit <= count)) {
|
|
1892
|
-
|
|
1997
|
+
_context14.next = 29;
|
|
1893
1998
|
break;
|
|
1894
1999
|
}
|
|
1895
|
-
return
|
|
2000
|
+
return _context14.abrupt("break", 34);
|
|
1896
2001
|
case 29:
|
|
1897
|
-
|
|
2002
|
+
_context14.next = 32;
|
|
1898
2003
|
break;
|
|
1899
2004
|
case 31:
|
|
1900
2005
|
if (from === v) started = true;
|
|
1901
2006
|
case 32:
|
|
1902
|
-
|
|
2007
|
+
_context14.next = 14;
|
|
1903
2008
|
break;
|
|
1904
2009
|
case 34:
|
|
1905
|
-
|
|
2010
|
+
_context14.next = 39;
|
|
1906
2011
|
break;
|
|
1907
2012
|
case 36:
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
_iterator8.e(
|
|
2013
|
+
_context14.prev = 36;
|
|
2014
|
+
_context14.t4 = _context14["catch"](12);
|
|
2015
|
+
_iterator8.e(_context14.t4);
|
|
1911
2016
|
case 39:
|
|
1912
|
-
|
|
2017
|
+
_context14.prev = 39;
|
|
1913
2018
|
_iterator8.f();
|
|
1914
|
-
return
|
|
2019
|
+
return _context14.finish(39);
|
|
1915
2020
|
case 42:
|
|
1916
|
-
return
|
|
2021
|
+
return _context14.abrupt("return", {
|
|
1917
2022
|
edges: _res
|
|
1918
2023
|
});
|
|
1919
2024
|
case 43:
|
|
1920
2025
|
case "end":
|
|
1921
|
-
return
|
|
2026
|
+
return _context14.stop();
|
|
1922
2027
|
}
|
|
1923
|
-
},
|
|
2028
|
+
}, _callee13, null, [[12, 36, 39, 42]]);
|
|
1924
2029
|
}));
|
|
1925
|
-
function results(
|
|
2030
|
+
function results(_x17) {
|
|
1926
2031
|
return _results.apply(this, arguments);
|
|
1927
2032
|
}
|
|
1928
2033
|
return results;
|
|
1929
2034
|
}(),
|
|
1930
2035
|
dryrun: function () {
|
|
1931
|
-
var _dryrun = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2036
|
+
var _dryrun = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee14(opt) {
|
|
1932
2037
|
var _opt$id3, _opt$owner3;
|
|
1933
2038
|
var p, id, owner, _yield$ar$dataitem5, _opt$data3, cloneMemory, msg, _env, _yield$mem$getWasm4, format, mod, wasm, wdrive, start, res;
|
|
1934
|
-
return _regeneratorRuntime().wrap(function
|
|
1935
|
-
while (1) switch (
|
|
2039
|
+
return _regeneratorRuntime().wrap(function _callee14$(_context15) {
|
|
2040
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
1936
2041
|
case 0:
|
|
1937
|
-
|
|
2042
|
+
_context15.next = 2;
|
|
1938
2043
|
return mem.get("env", opt.process);
|
|
1939
2044
|
case 2:
|
|
1940
|
-
p =
|
|
2045
|
+
p = _context15.sent;
|
|
1941
2046
|
if (p) {
|
|
1942
|
-
|
|
2047
|
+
_context15.next = 5;
|
|
1943
2048
|
break;
|
|
1944
2049
|
}
|
|
1945
|
-
return
|
|
2050
|
+
return _context15.abrupt("return", null);
|
|
1946
2051
|
case 5:
|
|
1947
2052
|
id = (_opt$id3 = opt.id) !== null && _opt$id3 !== void 0 ? _opt$id3 : "";
|
|
1948
2053
|
owner = (_opt$owner3 = opt.owner) !== null && _opt$owner3 !== void 0 ? _opt$owner3 : mu.addr;
|
|
1949
2054
|
if (!(!opt.id && opt.signer)) {
|
|
1950
|
-
|
|
2055
|
+
_context15.next = 14;
|
|
1951
2056
|
break;
|
|
1952
2057
|
}
|
|
1953
2058
|
;
|
|
1954
|
-
|
|
2059
|
+
_context15.next = 11;
|
|
1955
2060
|
return ar.dataitem(_objectSpread(_objectSpread({}, opt), {}, {
|
|
1956
2061
|
target: opt.process
|
|
1957
2062
|
}));
|
|
1958
2063
|
case 11:
|
|
1959
|
-
_yield$ar$dataitem5 =
|
|
2064
|
+
_yield$ar$dataitem5 = _context15.sent;
|
|
1960
2065
|
id = _yield$ar$dataitem5.id;
|
|
1961
2066
|
owner = _yield$ar$dataitem5.owner;
|
|
1962
2067
|
case 14:
|
|
1963
|
-
|
|
2068
|
+
_context15.prev = 14;
|
|
1964
2069
|
cloneMemory = function cloneMemory(memory) {
|
|
1965
2070
|
var buffer = memory.buffer.slice(0);
|
|
1966
2071
|
return new WebAssembly.Memory({
|
|
@@ -1969,52 +2074,52 @@ var _default = exports["default"] = function _default() {
|
|
|
1969
2074
|
shared: memory.shared || false
|
|
1970
2075
|
});
|
|
1971
2076
|
};
|
|
1972
|
-
|
|
2077
|
+
_context15.next = 18;
|
|
1973
2078
|
return genMsg(id, p, (_opt$data3 = opt.data) !== null && _opt$data3 !== void 0 ? _opt$data3 : "", opt.tags, owner, owner, true);
|
|
1974
2079
|
case 18:
|
|
1975
|
-
msg =
|
|
1976
|
-
|
|
2080
|
+
msg = _context15.sent;
|
|
2081
|
+
_context15.next = 21;
|
|
1977
2082
|
return genEnv({
|
|
1978
2083
|
pid: p.id,
|
|
1979
2084
|
owner: p.owner,
|
|
1980
2085
|
module: p.module
|
|
1981
2086
|
});
|
|
1982
2087
|
case 21:
|
|
1983
|
-
_env =
|
|
2088
|
+
_env = _context15.sent;
|
|
1984
2089
|
if (p.handle) {
|
|
1985
|
-
|
|
2090
|
+
_context15.next = 45;
|
|
1986
2091
|
break;
|
|
1987
2092
|
}
|
|
1988
|
-
|
|
2093
|
+
_context15.next = 25;
|
|
1989
2094
|
return mem.getWasm(p.module);
|
|
1990
2095
|
case 25:
|
|
1991
|
-
_yield$mem$getWasm4 =
|
|
2096
|
+
_yield$mem$getWasm4 = _context15.sent;
|
|
1992
2097
|
format = _yield$mem$getWasm4.format;
|
|
1993
2098
|
mod = _yield$mem$getWasm4.mod;
|
|
1994
2099
|
wasm = _yield$mem$getWasm4.wasm;
|
|
1995
2100
|
wdrive = extensions[p.extention];
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2101
|
+
_context15.t0 = AoLoader;
|
|
2102
|
+
_context15.t1 = wasm;
|
|
2103
|
+
_context15.t2 = format;
|
|
2104
|
+
_context15.t3 = wdrive;
|
|
2105
|
+
_context15.next = 36;
|
|
2001
2106
|
return mem.getTx(p.id);
|
|
2002
2107
|
case 36:
|
|
2003
|
-
|
|
2004
|
-
|
|
2108
|
+
_context15.t4 = _context15.sent.item;
|
|
2109
|
+
_context15.next = 39;
|
|
2005
2110
|
return mem.getTx(mod);
|
|
2006
2111
|
case 39:
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
format:
|
|
2010
|
-
WeaveDrive:
|
|
2011
|
-
spawn:
|
|
2012
|
-
module:
|
|
2112
|
+
_context15.t5 = _context15.sent;
|
|
2113
|
+
_context15.t6 = {
|
|
2114
|
+
format: _context15.t2,
|
|
2115
|
+
WeaveDrive: _context15.t3,
|
|
2116
|
+
spawn: _context15.t4,
|
|
2117
|
+
module: _context15.t5
|
|
2013
2118
|
};
|
|
2014
|
-
|
|
2015
|
-
return (0,
|
|
2119
|
+
_context15.next = 43;
|
|
2120
|
+
return (0, _context15.t0)(_context15.t1, _context15.t6);
|
|
2016
2121
|
case 43:
|
|
2017
|
-
p.handle =
|
|
2122
|
+
p.handle = _context15.sent;
|
|
2018
2123
|
mem.env[opt.process].handle = p.handle;
|
|
2019
2124
|
case 45:
|
|
2020
2125
|
if (p.compressed) {
|
|
@@ -2022,25 +2127,25 @@ var _default = exports["default"] = function _default() {
|
|
|
2022
2127
|
p.memory = mem.decompress(p.memory, p.original_size);
|
|
2023
2128
|
p.compressed = false;
|
|
2024
2129
|
}
|
|
2025
|
-
|
|
2130
|
+
_context15.next = 48;
|
|
2026
2131
|
return p.handle(p.memory, msg, _env);
|
|
2027
2132
|
case 48:
|
|
2028
|
-
res =
|
|
2133
|
+
res = _context15.sent;
|
|
2029
2134
|
delete res.Memory;
|
|
2030
|
-
return
|
|
2135
|
+
return _context15.abrupt("return", res);
|
|
2031
2136
|
case 53:
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
console.log(
|
|
2137
|
+
_context15.prev = 53;
|
|
2138
|
+
_context15.t7 = _context15["catch"](14);
|
|
2139
|
+
console.log(_context15.t7);
|
|
2035
2140
|
case 56:
|
|
2036
|
-
return
|
|
2141
|
+
return _context15.abrupt("return", null);
|
|
2037
2142
|
case 57:
|
|
2038
2143
|
case "end":
|
|
2039
|
-
return
|
|
2144
|
+
return _context15.stop();
|
|
2040
2145
|
}
|
|
2041
|
-
},
|
|
2146
|
+
}, _callee14, null, [[14, 53]]);
|
|
2042
2147
|
}));
|
|
2043
|
-
function dryrun(
|
|
2148
|
+
function dryrun(_x18) {
|
|
2044
2149
|
return _dryrun.apply(this, arguments);
|
|
2045
2150
|
}
|
|
2046
2151
|
return dryrun;
|