Skip to content
This repository has been archived by the owner on Sep 30, 2023. It is now read-only.

Commit

Permalink
Merge pull request #303 from orbitdb/ipfs-0.43
Browse files Browse the repository at this point in the history
wip: upgrade to js-ipfs 0.43.0 and go-ipfs 0.5.0
  • Loading branch information
aphelionz authored May 11, 2020
2 parents 882673b + 5ad315d commit dcf934d
Show file tree
Hide file tree
Showing 25 changed files with 184 additions and 251 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ ipfs-log-benchmarks/
examples/browser/bundle.js.map
examples/browser/ipfs.min.js
examples/browser/ipfslog.min.js
.nyc_output
8 changes: 2 additions & 6 deletions lib/es5/default-access-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,15 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var AccessController =
/*#__PURE__*/
function () {
var AccessController = /*#__PURE__*/function () {
function AccessController() {
(0, _classCallCheck2.default)(this, AccessController);
}

(0, _createClass2.default)(AccessController, [{
key: "canAppend",
value: function () {
var _canAppend = (0, _asyncToGenerator2.default)(
/*#__PURE__*/
_regenerator.default.mark(function _callee(entry, identityProvider) {
var _canAppend = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(entry, identityProvider) {
return _regenerator.default.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
Expand Down
4 changes: 1 addition & 3 deletions lib/es5/entry-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var EntryIndex =
/*#__PURE__*/
function () {
var EntryIndex = /*#__PURE__*/function () {
function EntryIndex() {
var entries = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
(0, _classCallCheck2.default)(this, EntryIndex);
Expand Down
44 changes: 11 additions & 33 deletions lib/es5/entry-io.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ var hasItems = function hasItems(arr) {
return arr && arr.length > 0;
};

var EntryIO =
/*#__PURE__*/
function () {
var EntryIO = /*#__PURE__*/function () {
function EntryIO() {
(0, _classCallCheck2.default)(this, EntryIO);
}
Expand All @@ -31,9 +29,7 @@ function () {
key: "fetchParallel",
// Fetch log graphs in parallel
value: function () {
var _fetchParallel = (0, _asyncToGenerator2.default)(
/*#__PURE__*/
_regenerator.default.mark(function _callee2(ipfs, hashes, _ref) {
var _fetchParallel = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(ipfs, hashes, _ref) {
var length, _ref$exclude, exclude, timeout, concurrency, onProgressCallback, fetchOne, concatArrays, flatten, res;

return _regenerator.default.wrap(function _callee2$(_context2) {
Expand All @@ -42,12 +38,8 @@ function () {
case 0:
length = _ref.length, _ref$exclude = _ref.exclude, exclude = _ref$exclude === void 0 ? [] : _ref$exclude, timeout = _ref.timeout, concurrency = _ref.concurrency, onProgressCallback = _ref.onProgressCallback;

fetchOne =
/*#__PURE__*/
function () {
var _ref2 = (0, _asyncToGenerator2.default)(
/*#__PURE__*/
_regenerator.default.mark(function _callee(hash) {
fetchOne = /*#__PURE__*/function () {
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(hash) {
return _regenerator.default.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
Expand Down Expand Up @@ -120,9 +112,7 @@ function () {
}, {
key: "fetchAll",
value: function () {
var _fetchAll = (0, _asyncToGenerator2.default)(
/*#__PURE__*/
_regenerator.default.mark(function _callee6(ipfs, hashes) {
var _fetchAll = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(ipfs, hashes) {
var _ref3,
_ref3$length,
length,
Expand Down Expand Up @@ -215,12 +205,8 @@ function () {
}; // Fetch one entry and add it to the results


fetchEntry =
/*#__PURE__*/
function () {
var _ref4 = (0, _asyncToGenerator2.default)(
/*#__PURE__*/
_regenerator.default.mark(function _callee4(hash) {
fetchEntry = /*#__PURE__*/function () {
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(hash) {
return _regenerator.default.wrap(function _callee4$(_context4) {
while (1) {
switch (_context4.prev = _context4.next) {
Expand All @@ -233,12 +219,8 @@ function () {
return _context4.abrupt("return");

case 2:
return _context4.abrupt("return", new Promise(
/*#__PURE__*/
function () {
var _ref5 = (0, _asyncToGenerator2.default)(
/*#__PURE__*/
_regenerator.default.mark(function _callee3(resolve, reject) {
return _context4.abrupt("return", new Promise( /*#__PURE__*/function () {
var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(resolve, reject) {
var timer, addToResults, entry, sleep;
return _regenerator.default.wrap(function _callee3$(_context3) {
while (1) {
Expand Down Expand Up @@ -369,12 +351,8 @@ function () {
}(); // One loop of processing the loading queue


_processQueue =
/*#__PURE__*/
function () {
var _ref6 = (0, _asyncToGenerator2.default)(
/*#__PURE__*/
_regenerator.default.mark(function _callee5() {
_processQueue = /*#__PURE__*/function () {
var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
var nexts;
return _regenerator.default.wrap(function _callee5$(_context5) {
while (1) {
Expand Down
20 changes: 5 additions & 15 deletions lib/es5/entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ var getWriteFormat = function getWriteFormat(e) {
return Entry.isEntry(e) ? getWriteFormatForVersion(e.v) : getWriteFormatForVersion(e);
};

var Entry =
/*#__PURE__*/
function () {
var Entry = /*#__PURE__*/function () {
function Entry() {
(0, _classCallCheck2.default)(this, Entry);
}
Expand All @@ -57,9 +55,7 @@ function () {
* // { hash: null, payload: "hello", next: [] }
*/
value: function () {
var _create = (0, _asyncToGenerator2.default)(
/*#__PURE__*/
_regenerator.default.mark(function _callee(ipfs, identity, logId, data) {
var _create = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(ipfs, identity, logId, data) {
var next,
clock,
refs,
Expand Down Expand Up @@ -178,9 +174,7 @@ function () {
}, {
key: "verify",
value: function () {
var _verify = (0, _asyncToGenerator2.default)(
/*#__PURE__*/
_regenerator.default.mark(function _callee2(identityProvider, entry) {
var _verify = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(identityProvider, entry) {
var e, verifier;
return _regenerator.default.wrap(function _callee2$(_context2) {
while (1) {
Expand Down Expand Up @@ -265,9 +259,7 @@ function () {
}, {
key: "toMultihash",
value: function () {
var _toMultihash = (0, _asyncToGenerator2.default)(
/*#__PURE__*/
_regenerator.default.mark(function _callee3(ipfs, entry) {
var _toMultihash = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(ipfs, entry) {
var pin,
e,
_args3 = arguments;
Expand Down Expand Up @@ -365,9 +357,7 @@ function () {
}, {
key: "fromMultihash",
value: function () {
var _fromMultihash = (0, _asyncToGenerator2.default)(
/*#__PURE__*/
_regenerator.default.mark(function _callee4(ipfs, hash) {
var _fromMultihash = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(ipfs, hash) {
var e, entry;
return _regenerator.default.wrap(function _callee4$(_context4) {
while (1) {
Expand Down
4 changes: 1 addition & 3 deletions lib/es5/g-set.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var GSet =
/*#__PURE__*/
function () {
var GSet = /*#__PURE__*/function () {
function GSet(values) {
(0, _classCallCheck2.default)(this, GSet);
} // eslint-disable-line
Expand Down
4 changes: 1 addition & 3 deletions lib/es5/lamport-clock.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var LamportClock =
/*#__PURE__*/
function () {
var LamportClock = /*#__PURE__*/function () {
function LamportClock(id, time) {
(0, _classCallCheck2.default)(this, LamportClock);
this.id = id;
Expand Down
24 changes: 6 additions & 18 deletions lib/es5/log-io.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ var last = function last(arr, n) {
return arr.slice(arr.length - Math.min(arr.length, n), arr.length);
};

var LogIO =
/*#__PURE__*/
function () {
var LogIO = /*#__PURE__*/function () {
function LogIO() {
(0, _classCallCheck2.default)(this, LogIO);
}
Expand All @@ -52,9 +50,7 @@ function () {
* @deprecated
*/
value: function () {
var _toMultihash = (0, _asyncToGenerator2.default)(
/*#__PURE__*/
_regenerator.default.mark(function _callee(ipfs, log) {
var _toMultihash = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(ipfs, log) {
var _ref,
format,
_args = arguments;
Expand Down Expand Up @@ -122,9 +118,7 @@ function () {
}, {
key: "fromMultihash",
value: function () {
var _fromMultihash = (0, _asyncToGenerator2.default)(
/*#__PURE__*/
_regenerator.default.mark(function _callee2(ipfs, hash, _ref2) {
var _fromMultihash = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(ipfs, hash, _ref2) {
var _ref2$length, length, _ref2$exclude, exclude, timeout, concurrency, sortFn, onProgressCallback, logData, isHead, all, logId, entries, heads;

return _regenerator.default.wrap(function _callee2$(_context2) {
Expand Down Expand Up @@ -219,9 +213,7 @@ function () {
}, {
key: "fromEntryHash",
value: function () {
var _fromEntryHash = (0, _asyncToGenerator2.default)(
/*#__PURE__*/
_regenerator.default.mark(function _callee3(ipfs, hash, _ref3) {
var _fromEntryHash = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(ipfs, hash, _ref3) {
var _ref3$length, length, _ref3$exclude, exclude, timeout, concurrency, sortFn, onProgressCallback, hashes, all, entries;

return _regenerator.default.wrap(function _callee3$(_context3) {
Expand Down Expand Up @@ -296,9 +288,7 @@ function () {
}, {
key: "fromJSON",
value: function () {
var _fromJSON = (0, _asyncToGenerator2.default)(
/*#__PURE__*/
_regenerator.default.mark(function _callee4(ipfs, json, _ref4) {
var _fromJSON = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(ipfs, json, _ref4) {
var _ref4$length, length, timeout, concurrency, onProgressCallback, id, heads, headHashes, all, entries;

return _regenerator.default.wrap(function _callee4$(_context4) {
Expand Down Expand Up @@ -363,9 +353,7 @@ function () {
}, {
key: "fromEntry",
value: function () {
var _fromEntry = (0, _asyncToGenerator2.default)(
/*#__PURE__*/
_regenerator.default.mark(function _callee5(ipfs, sourceEntries, _ref5) {
var _fromEntry = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(ipfs, sourceEntries, _ref5) {
var _ref5$length, length, _ref5$exclude, exclude, timeout, concurrency, onProgressCallback, hashes, all, combined, uniques, sliced, missingSourceEntries, replaceInFront, entries, logId;

return _regenerator.default.wrap(function _callee5$(_context5) {
Expand Down
Loading

0 comments on commit dcf934d

Please sign in to comment.