wao 0.14.0 → 0.14.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 +161 -125
- package/cjs/bao.js +4 -0
- package/cjs/tao.js +0 -3
- package/esm/aoconnect-base.js +3 -4
- package/esm/bao.js +2 -0
- package/esm/tao.js +0 -1
- package/package.json +1 -1
package/cjs/aoconnect-base.js
CHANGED
|
@@ -639,7 +639,7 @@ var _default = exports["default"] = function _default() {
|
|
|
639
639
|
var _assign = /*#__PURE__*/function () {
|
|
640
640
|
var _ref9 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(opt) {
|
|
641
641
|
var _opt$tags2;
|
|
642
|
-
var p, _opt, hash, _yield$ar$dataitem2, id, owner, item, _opt$data2, _ref10, _opt$from, _res$Messages, _res$Spawns, _res$Assignments, data, _tags, from, raw_owner, hashBuffer, msg, _env, _yield$mem$getWasm2, format, mod, wasm, wdrive, res, _msg, _iterator3, _step3, v, _iterator4, _step4, _v, __tags, _iterator5, _step5, _v2, _iterator6, _step6, v2;
|
|
642
|
+
var p, _opt, hash, _yield$ar$dataitem2, id, owner, item, _opt$data2, _ref10, _opt$from, _res$Messages, _res$Spawns, _res$Assignments, data, _tags, from, raw_owner, hashBuffer, msg, _env, _yield$mem$getTx3, _yield$mem$getWasm2, format, mod, wasm, wdrive, res, _msg, _iterator3, _step3, v, _iterator4, _step4, _v, __tags, _iterator5, _step5, _v2, _iterator6, _step6, v2;
|
|
643
643
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
644
644
|
while (1) switch (_context4.prev = _context4.next) {
|
|
645
645
|
case 0:
|
|
@@ -756,7 +756,7 @@ var _default = exports["default"] = function _default() {
|
|
|
756
756
|
case 64:
|
|
757
757
|
_env = _context4.sent;
|
|
758
758
|
if (p.handle) {
|
|
759
|
-
_context4.next =
|
|
759
|
+
_context4.next = 97;
|
|
760
760
|
break;
|
|
761
761
|
}
|
|
762
762
|
_context4.next = 68;
|
|
@@ -774,56 +774,74 @@ var _default = exports["default"] = function _default() {
|
|
|
774
774
|
_context4.next = 79;
|
|
775
775
|
return mem.getTx(p.id);
|
|
776
776
|
case 79:
|
|
777
|
-
_context4.
|
|
778
|
-
_context4.
|
|
777
|
+
_context4.t19 = _yield$mem$getTx3 = _context4.sent;
|
|
778
|
+
_context4.t18 = _context4.t19 === null;
|
|
779
|
+
if (_context4.t18) {
|
|
780
|
+
_context4.next = 83;
|
|
781
|
+
break;
|
|
782
|
+
}
|
|
783
|
+
_context4.t18 = _yield$mem$getTx3 === void 0;
|
|
784
|
+
case 83:
|
|
785
|
+
if (!_context4.t18) {
|
|
786
|
+
_context4.next = 87;
|
|
787
|
+
break;
|
|
788
|
+
}
|
|
789
|
+
_context4.t20 = void 0;
|
|
790
|
+
_context4.next = 88;
|
|
791
|
+
break;
|
|
792
|
+
case 87:
|
|
793
|
+
_context4.t20 = _yield$mem$getTx3.item;
|
|
794
|
+
case 88:
|
|
795
|
+
_context4.t21 = _context4.t20;
|
|
796
|
+
_context4.next = 91;
|
|
779
797
|
return mem.getTx(mod);
|
|
780
|
-
case
|
|
781
|
-
_context4.
|
|
782
|
-
_context4.
|
|
798
|
+
case 91:
|
|
799
|
+
_context4.t22 = _context4.sent;
|
|
800
|
+
_context4.t23 = {
|
|
783
801
|
format: _context4.t16,
|
|
784
802
|
WeaveDrive: _context4.t17,
|
|
785
|
-
spawn: _context4.
|
|
786
|
-
module: _context4.
|
|
803
|
+
spawn: _context4.t21,
|
|
804
|
+
module: _context4.t22
|
|
787
805
|
};
|
|
788
|
-
_context4.next =
|
|
789
|
-
return (0, _context4.t14)(_context4.t15, _context4.
|
|
790
|
-
case
|
|
806
|
+
_context4.next = 95;
|
|
807
|
+
return (0, _context4.t14)(_context4.t15, _context4.t23);
|
|
808
|
+
case 95:
|
|
791
809
|
p.handle = _context4.sent;
|
|
792
810
|
mem.env[opt.process].handle = p.handle;
|
|
793
|
-
case
|
|
794
|
-
_context4.next =
|
|
811
|
+
case 97:
|
|
812
|
+
_context4.next = 99;
|
|
795
813
|
return p.handle(p.memory, msg, _env);
|
|
796
|
-
case
|
|
814
|
+
case 99:
|
|
797
815
|
res = _context4.sent;
|
|
798
816
|
p.memory = res.Memory;
|
|
799
817
|
delete res.Memory;
|
|
800
818
|
p.results.push(opt.message);
|
|
801
|
-
_context4.next =
|
|
819
|
+
_context4.next = 105;
|
|
802
820
|
return mem.set(p, "env", opt.process);
|
|
803
|
-
case
|
|
821
|
+
case 105:
|
|
804
822
|
_msg = _objectSpread(_objectSpread({}, (0, _ramda.dissoc)("signer", _opt)), {}, {
|
|
805
823
|
res: res
|
|
806
824
|
});
|
|
807
|
-
_context4.next =
|
|
825
|
+
_context4.next = 108;
|
|
808
826
|
return mem.set(_msg, "msgs", opt.message);
|
|
809
|
-
case
|
|
827
|
+
case 108:
|
|
810
828
|
_iterator3 = _createForOfIteratorHelper((_res$Messages = res.Messages) !== null && _res$Messages !== void 0 ? _res$Messages : []);
|
|
811
|
-
_context4.prev =
|
|
829
|
+
_context4.prev = 109;
|
|
812
830
|
_iterator3.s();
|
|
813
|
-
case
|
|
831
|
+
case 111:
|
|
814
832
|
if ((_step3 = _iterator3.n()).done) {
|
|
815
|
-
_context4.next =
|
|
833
|
+
_context4.next = 120;
|
|
816
834
|
break;
|
|
817
835
|
}
|
|
818
836
|
v = _step3.value;
|
|
819
|
-
_context4.next =
|
|
837
|
+
_context4.next = 115;
|
|
820
838
|
return mem.get("env", v.Target);
|
|
821
|
-
case
|
|
839
|
+
case 115:
|
|
822
840
|
if (!_context4.sent) {
|
|
823
|
-
_context4.next =
|
|
841
|
+
_context4.next = 118;
|
|
824
842
|
break;
|
|
825
843
|
}
|
|
826
|
-
_context4.next =
|
|
844
|
+
_context4.next = 118;
|
|
827
845
|
return message({
|
|
828
846
|
"for": opt.message,
|
|
829
847
|
process: v.Target,
|
|
@@ -832,32 +850,32 @@ var _default = exports["default"] = function _default() {
|
|
|
832
850
|
signer: mu.signer,
|
|
833
851
|
from: opt.process
|
|
834
852
|
});
|
|
835
|
-
case
|
|
836
|
-
_context4.next =
|
|
853
|
+
case 118:
|
|
854
|
+
_context4.next = 111;
|
|
837
855
|
break;
|
|
838
|
-
case
|
|
839
|
-
_context4.next =
|
|
856
|
+
case 120:
|
|
857
|
+
_context4.next = 125;
|
|
840
858
|
break;
|
|
841
|
-
case
|
|
842
|
-
_context4.prev =
|
|
843
|
-
_context4.
|
|
844
|
-
_iterator3.e(_context4.
|
|
845
|
-
case
|
|
846
|
-
_context4.prev =
|
|
859
|
+
case 122:
|
|
860
|
+
_context4.prev = 122;
|
|
861
|
+
_context4.t24 = _context4["catch"](109);
|
|
862
|
+
_iterator3.e(_context4.t24);
|
|
863
|
+
case 125:
|
|
864
|
+
_context4.prev = 125;
|
|
847
865
|
_iterator3.f();
|
|
848
|
-
return _context4.finish(
|
|
849
|
-
case
|
|
866
|
+
return _context4.finish(125);
|
|
867
|
+
case 128:
|
|
850
868
|
_iterator4 = _createForOfIteratorHelper((_res$Spawns = res.Spawns) !== null && _res$Spawns !== void 0 ? _res$Spawns : []);
|
|
851
|
-
_context4.prev =
|
|
869
|
+
_context4.prev = 129;
|
|
852
870
|
_iterator4.s();
|
|
853
|
-
case
|
|
871
|
+
case 131:
|
|
854
872
|
if ((_step4 = _iterator4.n()).done) {
|
|
855
|
-
_context4.next =
|
|
873
|
+
_context4.next = 138;
|
|
856
874
|
break;
|
|
857
875
|
}
|
|
858
876
|
_v = _step4.value;
|
|
859
877
|
__tags = (0, _utils.tags)(_v.Tags);
|
|
860
|
-
_context4.next =
|
|
878
|
+
_context4.next = 136;
|
|
861
879
|
return spawn({
|
|
862
880
|
"for": opt.message,
|
|
863
881
|
module: __tags.Module,
|
|
@@ -867,87 +885,87 @@ var _default = exports["default"] = function _default() {
|
|
|
867
885
|
from: __tags["From-Process"],
|
|
868
886
|
signer: mu.signer
|
|
869
887
|
});
|
|
870
|
-
case
|
|
871
|
-
_context4.next =
|
|
888
|
+
case 136:
|
|
889
|
+
_context4.next = 131;
|
|
872
890
|
break;
|
|
873
|
-
case
|
|
874
|
-
_context4.next =
|
|
891
|
+
case 138:
|
|
892
|
+
_context4.next = 143;
|
|
875
893
|
break;
|
|
876
|
-
case
|
|
877
|
-
_context4.prev =
|
|
878
|
-
_context4.
|
|
879
|
-
_iterator4.e(_context4.
|
|
880
|
-
case
|
|
881
|
-
_context4.prev =
|
|
894
|
+
case 140:
|
|
895
|
+
_context4.prev = 140;
|
|
896
|
+
_context4.t25 = _context4["catch"](129);
|
|
897
|
+
_iterator4.e(_context4.t25);
|
|
898
|
+
case 143:
|
|
899
|
+
_context4.prev = 143;
|
|
882
900
|
_iterator4.f();
|
|
883
|
-
return _context4.finish(
|
|
884
|
-
case
|
|
901
|
+
return _context4.finish(143);
|
|
902
|
+
case 146:
|
|
885
903
|
_iterator5 = _createForOfIteratorHelper((_res$Assignments = res.Assignments) !== null && _res$Assignments !== void 0 ? _res$Assignments : []);
|
|
886
|
-
_context4.prev =
|
|
904
|
+
_context4.prev = 147;
|
|
887
905
|
_iterator5.s();
|
|
888
|
-
case
|
|
906
|
+
case 149:
|
|
889
907
|
if ((_step5 = _iterator5.n()).done) {
|
|
890
|
-
_context4.next =
|
|
908
|
+
_context4.next = 170;
|
|
891
909
|
break;
|
|
892
910
|
}
|
|
893
911
|
_v2 = _step5.value;
|
|
894
912
|
_iterator6 = _createForOfIteratorHelper(_v2.Processes);
|
|
895
|
-
_context4.prev =
|
|
913
|
+
_context4.prev = 152;
|
|
896
914
|
_iterator6.s();
|
|
897
|
-
case
|
|
915
|
+
case 154:
|
|
898
916
|
if ((_step6 = _iterator6.n()).done) {
|
|
899
|
-
_context4.next =
|
|
917
|
+
_context4.next = 160;
|
|
900
918
|
break;
|
|
901
919
|
}
|
|
902
920
|
v2 = _step6.value;
|
|
903
|
-
_context4.next =
|
|
921
|
+
_context4.next = 158;
|
|
904
922
|
return _assign({
|
|
905
923
|
message: _v2.Message,
|
|
906
924
|
process: v2,
|
|
907
925
|
from: opt.process,
|
|
908
926
|
signer: mu.signer
|
|
909
927
|
});
|
|
910
|
-
case
|
|
911
|
-
_context4.next =
|
|
928
|
+
case 158:
|
|
929
|
+
_context4.next = 154;
|
|
912
930
|
break;
|
|
913
|
-
case
|
|
914
|
-
_context4.next =
|
|
931
|
+
case 160:
|
|
932
|
+
_context4.next = 165;
|
|
915
933
|
break;
|
|
916
|
-
case
|
|
917
|
-
_context4.prev =
|
|
918
|
-
_context4.
|
|
919
|
-
_iterator6.e(_context4.
|
|
920
|
-
case
|
|
921
|
-
_context4.prev =
|
|
934
|
+
case 162:
|
|
935
|
+
_context4.prev = 162;
|
|
936
|
+
_context4.t26 = _context4["catch"](152);
|
|
937
|
+
_iterator6.e(_context4.t26);
|
|
938
|
+
case 165:
|
|
939
|
+
_context4.prev = 165;
|
|
922
940
|
_iterator6.f();
|
|
923
|
-
return _context4.finish(
|
|
924
|
-
case
|
|
925
|
-
_context4.next =
|
|
941
|
+
return _context4.finish(165);
|
|
942
|
+
case 168:
|
|
943
|
+
_context4.next = 149;
|
|
926
944
|
break;
|
|
927
|
-
case
|
|
928
|
-
_context4.next =
|
|
945
|
+
case 170:
|
|
946
|
+
_context4.next = 175;
|
|
929
947
|
break;
|
|
930
|
-
case 163:
|
|
931
|
-
_context4.prev = 163;
|
|
932
|
-
_context4.t24 = _context4["catch"](138);
|
|
933
|
-
_iterator5.e(_context4.t24);
|
|
934
|
-
case 166:
|
|
935
|
-
_context4.prev = 166;
|
|
936
|
-
_iterator5.f();
|
|
937
|
-
return _context4.finish(166);
|
|
938
|
-
case 169:
|
|
939
|
-
return _context4.abrupt("return", id);
|
|
940
948
|
case 172:
|
|
941
949
|
_context4.prev = 172;
|
|
942
|
-
_context4.
|
|
943
|
-
|
|
950
|
+
_context4.t27 = _context4["catch"](147);
|
|
951
|
+
_iterator5.e(_context4.t27);
|
|
944
952
|
case 175:
|
|
953
|
+
_context4.prev = 175;
|
|
954
|
+
_iterator5.f();
|
|
955
|
+
return _context4.finish(175);
|
|
956
|
+
case 178:
|
|
957
|
+
return _context4.abrupt("return", id);
|
|
958
|
+
case 181:
|
|
959
|
+
_context4.prev = 181;
|
|
960
|
+
_context4.t28 = _context4["catch"](38);
|
|
961
|
+
console.log(_context4.t28);
|
|
962
|
+
case 184:
|
|
945
963
|
return _context4.abrupt("return", null);
|
|
946
|
-
case
|
|
964
|
+
case 185:
|
|
947
965
|
case "end":
|
|
948
966
|
return _context4.stop();
|
|
949
967
|
}
|
|
950
|
-
}, _callee4, null, [[38,
|
|
968
|
+
}, _callee4, null, [[38, 181], [43, 56], [109, 122, 125, 128], [129, 140, 143, 146], [147, 172, 175, 178], [152, 162, 165, 168]]);
|
|
951
969
|
}));
|
|
952
970
|
return function assign(_x8) {
|
|
953
971
|
return _ref9.apply(this, arguments);
|
|
@@ -955,7 +973,7 @@ var _default = exports["default"] = function _default() {
|
|
|
955
973
|
}();
|
|
956
974
|
var message = /*#__PURE__*/function () {
|
|
957
975
|
var _ref11 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(opt) {
|
|
958
|
-
var id, owner, item, _yield$ar$httpmsg2, _p, new_slot, last_slot, _opt$item$id, _opt$item, _opt$owner, _id, _owner, _item, p, _opt$tags3, _yield$mem$getTx$tags3, _yield$mem$
|
|
976
|
+
var id, owner, item, _yield$ar$httpmsg2, _p, new_slot, last_slot, _opt$item$id, _opt$item, _opt$owner, _id, _owner, _item, p, _opt$tags3, _yield$mem$getTx$tags3, _yield$mem$getTx4, pr, module, _yield$ar$dataitem3, _msg, _opt, _ref12, _opt$from2, _opt$http_msg$data, from, data, _tags, msg, _env, _yield$mem$getTx5, _yield$mem$getWasm3, format, mod, wasm, wdrive, res, _msg2;
|
|
959
977
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
960
978
|
while (1) switch (_context5.prev = _context5.next) {
|
|
961
979
|
case 0:
|
|
@@ -979,7 +997,7 @@ var _default = exports["default"] = function _default() {
|
|
|
979
997
|
_p = _context5.sent;
|
|
980
998
|
new_slot = opt.slot * 1;
|
|
981
999
|
last_slot = !_p ? -1 : _p.results.length - 1;
|
|
982
|
-
if (!(last_slot + 1
|
|
1000
|
+
if (!(last_slot + 1 < new_slot)) {
|
|
983
1001
|
_context5.next = 20;
|
|
984
1002
|
break;
|
|
985
1003
|
}
|
|
@@ -1034,13 +1052,13 @@ var _default = exports["default"] = function _default() {
|
|
|
1034
1052
|
_context5.next = 37;
|
|
1035
1053
|
return mem.getTx(opt.from);
|
|
1036
1054
|
case 37:
|
|
1037
|
-
_context5.t2 = _yield$mem$
|
|
1055
|
+
_context5.t2 = _yield$mem$getTx4 = _context5.sent;
|
|
1038
1056
|
_context5.t1 = _context5.t2 === null;
|
|
1039
1057
|
if (_context5.t1) {
|
|
1040
1058
|
_context5.next = 41;
|
|
1041
1059
|
break;
|
|
1042
1060
|
}
|
|
1043
|
-
_context5.t1 = _yield$mem$
|
|
1061
|
+
_context5.t1 = _yield$mem$getTx4 === void 0;
|
|
1044
1062
|
case 41:
|
|
1045
1063
|
if (!_context5.t1) {
|
|
1046
1064
|
_context5.next = 45;
|
|
@@ -1050,7 +1068,7 @@ var _default = exports["default"] = function _default() {
|
|
|
1050
1068
|
_context5.next = 46;
|
|
1051
1069
|
break;
|
|
1052
1070
|
case 45:
|
|
1053
|
-
_context5.t3 = _yield$mem$
|
|
1071
|
+
_context5.t3 = _yield$mem$getTx4.tags;
|
|
1054
1072
|
case 46:
|
|
1055
1073
|
_context5.t4 = _yield$mem$getTx$tags3 = _context5.t3;
|
|
1056
1074
|
_context5.t0 = _context5.t4 !== null;
|
|
@@ -1096,7 +1114,7 @@ var _default = exports["default"] = function _default() {
|
|
|
1096
1114
|
return mem.set(_msg, "msgs", id);
|
|
1097
1115
|
case 68:
|
|
1098
1116
|
if (!ar.isHttpMsg(opt.http_msg)) {
|
|
1099
|
-
_context5.next =
|
|
1117
|
+
_context5.next = 132;
|
|
1100
1118
|
break;
|
|
1101
1119
|
}
|
|
1102
1120
|
p.epochs.push([id]);
|
|
@@ -1119,7 +1137,7 @@ var _default = exports["default"] = function _default() {
|
|
|
1119
1137
|
case 80:
|
|
1120
1138
|
_env = _context5.sent;
|
|
1121
1139
|
if (p.handle) {
|
|
1122
|
-
_context5.next =
|
|
1140
|
+
_context5.next = 113;
|
|
1123
1141
|
break;
|
|
1124
1142
|
}
|
|
1125
1143
|
_context5.next = 84;
|
|
@@ -1137,49 +1155,67 @@ var _default = exports["default"] = function _default() {
|
|
|
1137
1155
|
_context5.next = 95;
|
|
1138
1156
|
return mem.getTx(p.id);
|
|
1139
1157
|
case 95:
|
|
1140
|
-
_context5.
|
|
1141
|
-
_context5.
|
|
1158
|
+
_context5.t11 = _yield$mem$getTx5 = _context5.sent;
|
|
1159
|
+
_context5.t10 = _context5.t11 === null;
|
|
1160
|
+
if (_context5.t10) {
|
|
1161
|
+
_context5.next = 99;
|
|
1162
|
+
break;
|
|
1163
|
+
}
|
|
1164
|
+
_context5.t10 = _yield$mem$getTx5 === void 0;
|
|
1165
|
+
case 99:
|
|
1166
|
+
if (!_context5.t10) {
|
|
1167
|
+
_context5.next = 103;
|
|
1168
|
+
break;
|
|
1169
|
+
}
|
|
1170
|
+
_context5.t12 = void 0;
|
|
1171
|
+
_context5.next = 104;
|
|
1172
|
+
break;
|
|
1173
|
+
case 103:
|
|
1174
|
+
_context5.t12 = _yield$mem$getTx5.item;
|
|
1175
|
+
case 104:
|
|
1176
|
+
_context5.t13 = _context5.t12;
|
|
1177
|
+
_context5.next = 107;
|
|
1142
1178
|
return mem.getTx(mod);
|
|
1143
|
-
case
|
|
1144
|
-
_context5.
|
|
1145
|
-
_context5.
|
|
1179
|
+
case 107:
|
|
1180
|
+
_context5.t14 = _context5.sent;
|
|
1181
|
+
_context5.t15 = {
|
|
1146
1182
|
format: _context5.t8,
|
|
1147
1183
|
WeaveDrive: _context5.t9,
|
|
1148
|
-
spawn: _context5.
|
|
1149
|
-
module: _context5.
|
|
1184
|
+
spawn: _context5.t13,
|
|
1185
|
+
module: _context5.t14
|
|
1150
1186
|
};
|
|
1151
|
-
_context5.next =
|
|
1152
|
-
return (0, _context5.t6)(_context5.t7, _context5.
|
|
1153
|
-
case
|
|
1187
|
+
_context5.next = 111;
|
|
1188
|
+
return (0, _context5.t6)(_context5.t7, _context5.t15);
|
|
1189
|
+
case 111:
|
|
1154
1190
|
p.handle = _context5.sent;
|
|
1155
1191
|
mem.env[opt.process].handle = p.handle;
|
|
1156
|
-
case
|
|
1157
|
-
_context5.next =
|
|
1192
|
+
case 113:
|
|
1193
|
+
_context5.next = 115;
|
|
1158
1194
|
return p.handle(p.memory, msg, _env);
|
|
1159
|
-
case
|
|
1195
|
+
case 115:
|
|
1160
1196
|
res = _context5.sent;
|
|
1161
1197
|
p.memory = res.Memory;
|
|
1162
1198
|
delete res.Memory;
|
|
1163
1199
|
p.results.push(id);
|
|
1164
|
-
_context5.next =
|
|
1200
|
+
_context5.next = 121;
|
|
1165
1201
|
return mem.set(p, "env", opt.process);
|
|
1166
|
-
case
|
|
1202
|
+
case 121:
|
|
1167
1203
|
_msg2 = _objectSpread(_objectSpread({}, (0, _ramda.dissoc)("signer", _opt)), {}, {
|
|
1168
1204
|
res: res
|
|
1169
1205
|
});
|
|
1170
|
-
_context5.next =
|
|
1206
|
+
_context5.next = 124;
|
|
1171
1207
|
return mem.set(_msg2, "msgs", id);
|
|
1172
|
-
case
|
|
1208
|
+
case 124:
|
|
1173
1209
|
return _context5.abrupt("return", id);
|
|
1174
|
-
case
|
|
1175
|
-
_context5.prev =
|
|
1176
|
-
_context5.
|
|
1177
|
-
console.log(_context5.
|
|
1178
|
-
case
|
|
1179
|
-
_context5.next =
|
|
1210
|
+
case 127:
|
|
1211
|
+
_context5.prev = 127;
|
|
1212
|
+
_context5.t16 = _context5["catch"](71);
|
|
1213
|
+
console.log(_context5.t16);
|
|
1214
|
+
case 130:
|
|
1215
|
+
_context5.next = 134;
|
|
1180
1216
|
break;
|
|
1181
|
-
case
|
|
1182
|
-
_context5.next =
|
|
1217
|
+
case 132:
|
|
1218
|
+
_context5.next = 134;
|
|
1183
1219
|
return _assign({
|
|
1184
1220
|
message_item: item,
|
|
1185
1221
|
message: id,
|
|
@@ -1187,13 +1223,13 @@ var _default = exports["default"] = function _default() {
|
|
|
1187
1223
|
from: owner,
|
|
1188
1224
|
signer: mu.signer
|
|
1189
1225
|
});
|
|
1190
|
-
case
|
|
1226
|
+
case 134:
|
|
1191
1227
|
return _context5.abrupt("return", id);
|
|
1192
|
-
case
|
|
1228
|
+
case 135:
|
|
1193
1229
|
case "end":
|
|
1194
1230
|
return _context5.stop();
|
|
1195
1231
|
}
|
|
1196
|
-
}, _callee5, null, [[71,
|
|
1232
|
+
}, _callee5, null, [[71, 127]]);
|
|
1197
1233
|
}));
|
|
1198
1234
|
return function message(_x9) {
|
|
1199
1235
|
return _ref11.apply(this, arguments);
|
package/cjs/bao.js
CHANGED
|
@@ -9,6 +9,7 @@ var _ao = _interopRequireDefault(require("./ao.js"));
|
|
|
9
9
|
var _aoconnect = require("@permaweb/aoconnect");
|
|
10
10
|
var _utils = require("./utils.js");
|
|
11
11
|
var _ramda = require("ramda");
|
|
12
|
+
var _hb = _interopRequireDefault(require("./hb.js"));
|
|
12
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
13
14
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
14
15
|
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
@@ -73,6 +74,9 @@ var AO = /*#__PURE__*/function (_MAO) {
|
|
|
73
74
|
var _this;
|
|
74
75
|
var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
75
76
|
_classCallCheck(this, AO);
|
|
77
|
+
if (opt.hb_url) opt.hb = new _hb["default"]({
|
|
78
|
+
url: opt.hb_url
|
|
79
|
+
});
|
|
76
80
|
_this = _callSuper(this, AO, [_objectSpread(_objectSpread({}, opt), {}, {
|
|
77
81
|
in_memory: true
|
|
78
82
|
})]);
|
package/cjs/tao.js
CHANGED
|
@@ -29,9 +29,6 @@ var AO = /*#__PURE__*/function (_BAO) {
|
|
|
29
29
|
function AO() {
|
|
30
30
|
var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
31
31
|
_classCallCheck(this, AO);
|
|
32
|
-
if (opt.hb_url) opt.hb = new _hb["default"]({
|
|
33
|
-
url: opt.hb_url
|
|
34
|
-
});
|
|
35
32
|
return _callSuper(this, AO, [_objectSpread(_objectSpread({}, opt), {}, {
|
|
36
33
|
connect: _aoconnect.connect,
|
|
37
34
|
AR: _tar["default"]
|
package/esm/aoconnect-base.js
CHANGED
|
@@ -318,7 +318,7 @@ export default ({ AR, scheduler, mu, su, cu, acc, AoLoader, ArMem } = {}) => {
|
|
|
318
318
|
p.handle = await AoLoader(wasm, {
|
|
319
319
|
format,
|
|
320
320
|
WeaveDrive: wdrive,
|
|
321
|
-
spawn: (await mem.getTx(p.id))
|
|
321
|
+
spawn: (await mem.getTx(p.id))?.item,
|
|
322
322
|
module: await mem.getTx(mod),
|
|
323
323
|
})
|
|
324
324
|
mem.env[opt.process].handle = p.handle
|
|
@@ -382,7 +382,7 @@ export default ({ AR, scheduler, mu, su, cu, acc, AoLoader, ArMem } = {}) => {
|
|
|
382
382
|
const p = await mem.get("env", opt.process)
|
|
383
383
|
const new_slot = opt.slot * 1
|
|
384
384
|
const last_slot = !p ? -1 : p.results.length - 1
|
|
385
|
-
if (last_slot + 1
|
|
385
|
+
if (last_slot + 1 < new_slot) {
|
|
386
386
|
if (!hb || opt.recovery) return null
|
|
387
387
|
await recover(opt.process)
|
|
388
388
|
}
|
|
@@ -394,7 +394,6 @@ export default ({ AR, scheduler, mu, su, cu, acc, AoLoader, ArMem } = {}) => {
|
|
|
394
394
|
|
|
395
395
|
const p = await mem.get("env", opt.process)
|
|
396
396
|
if (!p) return null
|
|
397
|
-
|
|
398
397
|
if (!opt.item && opt.signer) {
|
|
399
398
|
opt.tags = buildTags(
|
|
400
399
|
null,
|
|
@@ -442,7 +441,7 @@ export default ({ AR, scheduler, mu, su, cu, acc, AoLoader, ArMem } = {}) => {
|
|
|
442
441
|
p.handle = await AoLoader(wasm, {
|
|
443
442
|
format,
|
|
444
443
|
WeaveDrive: wdrive,
|
|
445
|
-
spawn: (await mem.getTx(p.id))
|
|
444
|
+
spawn: (await mem.getTx(p.id))?.item,
|
|
446
445
|
module: await mem.getTx(mod),
|
|
447
446
|
})
|
|
448
447
|
mem.env[opt.process].handle = p.handle
|
package/esm/bao.js
CHANGED
|
@@ -2,6 +2,7 @@ import MAO from "./ao.js"
|
|
|
2
2
|
import { createDataItemSigner } from "@permaweb/aoconnect"
|
|
3
3
|
import { srcs, buildTags } from "./utils.js"
|
|
4
4
|
import { mergeLeft, is, map } from "ramda"
|
|
5
|
+
import HB from "./hb.js"
|
|
5
6
|
|
|
6
7
|
const wait = ms => new Promise(res => setTimeout(() => res(), ms))
|
|
7
8
|
let log = `
|
|
@@ -49,6 +50,7 @@ const renderLogs = logs => {
|
|
|
49
50
|
|
|
50
51
|
class AO extends MAO {
|
|
51
52
|
constructor(opt = {}) {
|
|
53
|
+
if (opt.hb_url) opt.hb = new HB({ url: opt.hb_url })
|
|
52
54
|
super({ ...opt, in_memory: true })
|
|
53
55
|
this.in_memory = true
|
|
54
56
|
this.createDataItemSigner = opt.createDataItemSigner ?? createDataItemSigner
|
package/esm/tao.js
CHANGED