wao 0.10.7 → 0.10.8
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/ao.js +10 -2
- package/esm/ao.js +11 -2
- package/package.json +1 -1
package/cjs/ao.js
CHANGED
|
@@ -32,6 +32,14 @@ function _asyncToGenerator(n) { return function () { var t = this, e = arguments
|
|
|
32
32
|
var pkg = (_WarpArBundles$defaul = WarpArBundles["default"]) !== null && _WarpArBundles$defaul !== void 0 ? _WarpArBundles$defaul : WarpArBundles;
|
|
33
33
|
var createData = pkg.createData,
|
|
34
34
|
ArweaveSigner = pkg.ArweaveSigner;
|
|
35
|
+
var getHash = function getHash(res) {
|
|
36
|
+
var _res$Messages, _res$Spawns, _res$Assignments;
|
|
37
|
+
return (0, _md["default"])(JSON.stringify({
|
|
38
|
+
Messages: (_res$Messages = res.Messages) !== null && _res$Messages !== void 0 ? _res$Messages : [],
|
|
39
|
+
Spawns: (_res$Spawns = res.Spawns) !== null && _res$Spawns !== void 0 ? _res$Spawns : [],
|
|
40
|
+
Assignments: (_res$Assignments = res.Assignments) !== null && _res$Assignments !== void 0 ? _res$Assignments : []
|
|
41
|
+
}));
|
|
42
|
+
};
|
|
35
43
|
function createDataItemSigner2(wallet) {
|
|
36
44
|
var signer = /*#__PURE__*/function () {
|
|
37
45
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref) {
|
|
@@ -700,7 +708,7 @@ var AO = /*#__PURE__*/function () {
|
|
|
700
708
|
try {
|
|
701
709
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
702
710
|
_v = _step3.value;
|
|
703
|
-
hash2 = (
|
|
711
|
+
hash2 = getHash(_v);
|
|
704
712
|
if (!exists) {
|
|
705
713
|
if (hash2 === hash) exists = true;
|
|
706
714
|
} else {
|
|
@@ -828,7 +836,7 @@ var AO = /*#__PURE__*/function () {
|
|
|
828
836
|
});
|
|
829
837
|
case 30:
|
|
830
838
|
res = _context11.sent;
|
|
831
|
-
hash = (
|
|
839
|
+
hash = getHash(res);
|
|
832
840
|
_txmap = _defineProperty({}, mid, {
|
|
833
841
|
checked: false,
|
|
834
842
|
res: res
|
package/esm/ao.js
CHANGED
|
@@ -53,6 +53,15 @@ import {
|
|
|
53
53
|
optAO,
|
|
54
54
|
} from "./utils.js"
|
|
55
55
|
|
|
56
|
+
const getHash = res =>
|
|
57
|
+
md5(
|
|
58
|
+
JSON.stringify({
|
|
59
|
+
Messages: res.Messages ?? [],
|
|
60
|
+
Spawns: res.Spawns ?? [],
|
|
61
|
+
Assignments: res.Assignments ?? [],
|
|
62
|
+
}),
|
|
63
|
+
)
|
|
64
|
+
|
|
56
65
|
function createDataItemSigner2(wallet) {
|
|
57
66
|
const signer = async ({ data, tags, target, anchor }) => {
|
|
58
67
|
const signer = new ArweaveSigner(wallet)
|
|
@@ -415,7 +424,7 @@ class AO {
|
|
|
415
424
|
}
|
|
416
425
|
} else {
|
|
417
426
|
for (let v of reverse(await this.res({ pid, limit }))) {
|
|
418
|
-
const hash2 =
|
|
427
|
+
const hash2 = getHash(v)
|
|
419
428
|
if (!exists) {
|
|
420
429
|
if (hash2 === hash) exists = true
|
|
421
430
|
} else {
|
|
@@ -456,7 +465,7 @@ class AO {
|
|
|
456
465
|
if (!is(Array, check)) check = [check]
|
|
457
466
|
let _txs = [{ id: mid, from: await this.ar.toAddr(jwk) }]
|
|
458
467
|
res = await this.res({ pid, mid })
|
|
459
|
-
hash =
|
|
468
|
+
hash = getHash(res)
|
|
460
469
|
let _txmap = { [mid]: { checked: false, res } }
|
|
461
470
|
results.push({ mid, res })
|
|
462
471
|
let checked = false
|