@eluvio/elv-client-js 4.0.92 → 4.0.93
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.
|
@@ -1761,14 +1761,14 @@ exports.PublishContentVersion = /*#__PURE__*/function () {
|
|
|
1761
1761
|
throw Error("Pending version hash mismatch on ".concat(objectId, ": expected ").concat(objectHash, ", currently ").concat(pendingHash));
|
|
1762
1762
|
case 19:
|
|
1763
1763
|
if (!awaitCommitConfirmation) {
|
|
1764
|
-
_context21.next =
|
|
1764
|
+
_context21.next = 48;
|
|
1765
1765
|
break;
|
|
1766
1766
|
}
|
|
1767
1767
|
this.Log("Awaiting commit confirmation for ".concat(objectHash));
|
|
1768
1768
|
pollingInterval = this.ethClient.Provider().pollingInterval || 500; // eslint-disable-next-line no-constant-condition
|
|
1769
1769
|
case 22:
|
|
1770
1770
|
if (!true) {
|
|
1771
|
-
_context21.next =
|
|
1771
|
+
_context21.next = 48;
|
|
1772
1772
|
break;
|
|
1773
1773
|
}
|
|
1774
1774
|
_context21.next = 25;
|
|
@@ -1776,15 +1776,37 @@ exports.PublishContentVersion = /*#__PURE__*/function () {
|
|
|
1776
1776
|
return setTimeout(resolve, pollingInterval);
|
|
1777
1777
|
});
|
|
1778
1778
|
case 25:
|
|
1779
|
-
_context21.
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1779
|
+
_context21.t0 = this;
|
|
1780
|
+
_context21.t1 = this.utils.HashToAddress(objectId);
|
|
1781
|
+
_context21.t2 = abi;
|
|
1782
|
+
_context21.t3 = fromBlock;
|
|
1783
|
+
_context21.next = 31;
|
|
1784
|
+
return this.authClient.IsV3({
|
|
1785
|
+
id: objectId
|
|
1786
1786
|
});
|
|
1787
|
-
case
|
|
1787
|
+
case 31:
|
|
1788
|
+
if (!_context21.sent) {
|
|
1789
|
+
_context21.next = 35;
|
|
1790
|
+
break;
|
|
1791
|
+
}
|
|
1792
|
+
_context21.t4 = Ethers.utils.id("VersionConfirm(address,address,string)");
|
|
1793
|
+
_context21.next = 36;
|
|
1794
|
+
break;
|
|
1795
|
+
case 35:
|
|
1796
|
+
_context21.t4 = Ethers.utils.id("VersionConfirm(address,string)");
|
|
1797
|
+
case 36:
|
|
1798
|
+
_context21.t5 = _context21.t4;
|
|
1799
|
+
_context21.t6 = [_context21.t5];
|
|
1800
|
+
_context21.t7 = {
|
|
1801
|
+
contractAddress: _context21.t1,
|
|
1802
|
+
abi: _context21.t2,
|
|
1803
|
+
fromBlock: _context21.t3,
|
|
1804
|
+
topics: _context21.t6,
|
|
1805
|
+
count: 1000
|
|
1806
|
+
};
|
|
1807
|
+
_context21.next = 41;
|
|
1808
|
+
return _context21.t0.ContractEvents.call(_context21.t0, _context21.t7);
|
|
1809
|
+
case 41:
|
|
1788
1810
|
events = _context21.sent;
|
|
1789
1811
|
confirmEvent = events.find(function (blockEvents) {
|
|
1790
1812
|
return blockEvents.find(function (event) {
|
|
@@ -1792,72 +1814,72 @@ exports.PublishContentVersion = /*#__PURE__*/function () {
|
|
|
1792
1814
|
});
|
|
1793
1815
|
});
|
|
1794
1816
|
if (!confirmEvent) {
|
|
1795
|
-
_context21.next =
|
|
1817
|
+
_context21.next = 46;
|
|
1796
1818
|
break;
|
|
1797
1819
|
}
|
|
1798
1820
|
// Found confirmation
|
|
1799
1821
|
this.Log("Commit confirmed on chain: ".concat(objectHash));
|
|
1800
|
-
return _context21.abrupt("break",
|
|
1801
|
-
case
|
|
1822
|
+
return _context21.abrupt("break", 48);
|
|
1823
|
+
case 46:
|
|
1802
1824
|
_context21.next = 22;
|
|
1803
1825
|
break;
|
|
1804
|
-
case
|
|
1826
|
+
case 48:
|
|
1805
1827
|
if (!awaitCommitConfirmation) {
|
|
1806
|
-
_context21.next =
|
|
1828
|
+
_context21.next = 76;
|
|
1807
1829
|
break;
|
|
1808
1830
|
}
|
|
1809
1831
|
_pollingInterval = 500; // ms
|
|
1810
1832
|
tries = 20;
|
|
1811
|
-
case
|
|
1833
|
+
case 51:
|
|
1812
1834
|
if (!(tries > 0)) {
|
|
1813
|
-
_context21.next =
|
|
1835
|
+
_context21.next = 76;
|
|
1814
1836
|
break;
|
|
1815
1837
|
}
|
|
1816
1838
|
h = void 0;
|
|
1817
|
-
_context21.prev =
|
|
1818
|
-
_context21.next =
|
|
1839
|
+
_context21.prev = 53;
|
|
1840
|
+
_context21.next = 56;
|
|
1819
1841
|
return this.LatestVersionHashV2({
|
|
1820
1842
|
objectId: objectId
|
|
1821
1843
|
});
|
|
1822
|
-
case
|
|
1844
|
+
case 56:
|
|
1823
1845
|
h = _context21.sent;
|
|
1824
1846
|
if (!(h === versionHash)) {
|
|
1825
|
-
_context21.next =
|
|
1847
|
+
_context21.next = 62;
|
|
1826
1848
|
break;
|
|
1827
1849
|
}
|
|
1828
1850
|
this.Log("Commit confirmed on fabric node: ".concat(versionHash));
|
|
1829
|
-
return _context21.abrupt("break",
|
|
1830
|
-
case
|
|
1851
|
+
return _context21.abrupt("break", 76);
|
|
1852
|
+
case 62:
|
|
1831
1853
|
tries--;
|
|
1832
|
-
_context21.next =
|
|
1854
|
+
_context21.next = 65;
|
|
1833
1855
|
return new Promise(function (resolve) {
|
|
1834
1856
|
return setTimeout(resolve, _pollingInterval);
|
|
1835
1857
|
});
|
|
1836
|
-
case
|
|
1837
|
-
_context21.next =
|
|
1858
|
+
case 65:
|
|
1859
|
+
_context21.next = 74;
|
|
1838
1860
|
break;
|
|
1839
|
-
case
|
|
1840
|
-
_context21.prev =
|
|
1841
|
-
_context21.
|
|
1842
|
-
if (!(_context21.
|
|
1843
|
-
_context21.next =
|
|
1861
|
+
case 67:
|
|
1862
|
+
_context21.prev = 67;
|
|
1863
|
+
_context21.t8 = _context21["catch"](53);
|
|
1864
|
+
if (!(_context21.t8.status !== 404)) {
|
|
1865
|
+
_context21.next = 71;
|
|
1844
1866
|
break;
|
|
1845
1867
|
}
|
|
1846
|
-
throw _context21.
|
|
1847
|
-
case
|
|
1868
|
+
throw _context21.t8;
|
|
1869
|
+
case 71:
|
|
1848
1870
|
tries--;
|
|
1849
|
-
_context21.next =
|
|
1871
|
+
_context21.next = 74;
|
|
1850
1872
|
return new Promise(function (resolve) {
|
|
1851
1873
|
return setTimeout(resolve, _pollingInterval);
|
|
1852
1874
|
});
|
|
1853
|
-
case
|
|
1854
|
-
_context21.next =
|
|
1875
|
+
case 74:
|
|
1876
|
+
_context21.next = 51;
|
|
1855
1877
|
break;
|
|
1856
|
-
case
|
|
1878
|
+
case 76:
|
|
1857
1879
|
case "end":
|
|
1858
1880
|
return _context21.stop();
|
|
1859
1881
|
}
|
|
1860
|
-
}, _callee21, this, [[
|
|
1882
|
+
}, _callee21, this, [[53, 67]]);
|
|
1861
1883
|
}));
|
|
1862
1884
|
return function (_x20) {
|
|
1863
1885
|
return _ref38.apply(this, arguments);
|
package/package.json
CHANGED
|
@@ -1050,7 +1050,11 @@ exports.PublishContentVersion = async function({objectId, versionHash, awaitComm
|
|
|
1050
1050
|
contractAddress: this.utils.HashToAddress(objectId),
|
|
1051
1051
|
abi,
|
|
1052
1052
|
fromBlock,
|
|
1053
|
-
topics: [
|
|
1053
|
+
topics: [
|
|
1054
|
+
await this.authClient.IsV3({id: objectId}) ?
|
|
1055
|
+
Ethers.utils.id("VersionConfirm(address,address,string)") :
|
|
1056
|
+
Ethers.utils.id("VersionConfirm(address,string)")
|
|
1057
|
+
],
|
|
1054
1058
|
count: 1000
|
|
1055
1059
|
});
|
|
1056
1060
|
|