Skip to content

Commit

Permalink
chore(dist): CI build
Browse files Browse the repository at this point in the history
  • Loading branch information
estebanabaroa authored and github-actions[bot] committed Jun 9, 2024
1 parent 876a0c5 commit 813128a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
6 changes: 2 additions & 4 deletions dist/lib/plebbit-js/plebbit-js-mock-content.js
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ const getCommentUpdateContent = (comment) => __awaiter(void 0, void 0, void 0, f
// console.log({replyLoopCount: replyLoopCount++, replyCount: commentUpdateContent.replyCount, depth: comment.depth, cid: comment.cid, index: replyCount})
const cid = yield seedToCid(yield getNumberHash(comment.cid + replyCount));
const replyContent = yield getReplyContent(getReplyContentOptions, cid + 'replycontent' + replyCount);
const reply = Object.assign(Object.assign({ cid, shortCid: cid.substring(2, 14), ipnsName: yield seedToCid(commentUpdateSeedNumber.increment()), timestamp: yield getNumberBetween(comment.timestamp, NOW, commentUpdateSeedNumber.increment()) }, replyContent), { subplebbitAddress: comment.subplebbitAddress || 'memes.eth' });
const reply = Object.assign(Object.assign({ cid, shortCid: cid.substring(2, 14), timestamp: yield getNumberBetween(comment.timestamp, NOW, commentUpdateSeedNumber.increment()) }, replyContent), { subplebbitAddress: comment.subplebbitAddress || 'memes.eth' });
if (replyCids.has(reply.cid)) {
console.error(`mock content error: duplicate reply cid '${reply.cid}'`);
}
Expand Down Expand Up @@ -703,7 +703,7 @@ class Plebbit extends EventEmitter {
const getReplyContentOptions = { depth, parentCid, postCid };
commentContent = yield getReplyContent(getReplyContentOptions, commentCid + 'replycontent');
}
const createCommentOptions = Object.assign({ cid: commentCid, ipnsName: yield seedToCid(commentSeedNumber.increment()), timestamp: yield getNumberBetween(NOW - DAY * 30, NOW, commentSeedNumber.increment()), subplebbitAddress: 'memes.eth' }, commentContent);
const createCommentOptions = Object.assign({ cid: commentCid, timestamp: yield getNumberBetween(NOW - DAY * 30, NOW, commentSeedNumber.increment()), subplebbitAddress: 'memes.eth' }, commentContent);
const comment = new Comment(createCommentOptions);
// add missing props from createCommentOptions
for (const prop in createCommentOptions) {
Expand Down Expand Up @@ -839,7 +839,6 @@ class Subplebbit extends EventEmitter {
}
update() {
return __awaiter(this, void 0, void 0, function* () {
// is ipnsName is known, look for updates and emit updates immediately after creation
if (!this.address) {
throw Error(`can't update without subplebbit.address`);
}
Expand Down Expand Up @@ -955,7 +954,6 @@ class Comment extends Publication {
constructor(createCommentOptions) {
super();
this._getCommentOnFirstUpdate = false;
this.ipnsName = createCommentOptions === null || createCommentOptions === void 0 ? void 0 : createCommentOptions.ipnsName;
this.cid = createCommentOptions === null || createCommentOptions === void 0 ? void 0 : createCommentOptions.cid;
this.upvoteCount = createCommentOptions === null || createCommentOptions === void 0 ? void 0 : createCommentOptions.upvoteCount;
this.downvoteCount = createCommentOptions === null || createCommentOptions === void 0 ? void 0 : createCommentOptions.downvoteCount;
Expand Down
1 change: 0 additions & 1 deletion dist/lib/plebbit-js/plebbit-js-mock.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ export declare class Comment extends Publication {
updateCalledTimes: number;
updating: boolean;
author: any;
ipnsName: string | undefined;
upvoteCount: number | undefined;
downvoteCount: number | undefined;
content: string | undefined;
Expand Down
5 changes: 1 addition & 4 deletions dist/lib/plebbit-js/plebbit-js-mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export class Plebbit extends EventEmitter {
getComment(commentCid) {
return __awaiter(this, void 0, void 0, function* () {
yield simulateLoadingTime();
const createCommentOptions = Object.assign({ cid: commentCid, ipnsName: commentCid + ' ipns name',
const createCommentOptions = Object.assign({ cid: commentCid,
// useComment() requires timestamp or will use account comment instead of comment from store
timestamp: 1670000000 }, this.commentToGet(commentCid));
return new Comment(createCommentOptions);
Expand Down Expand Up @@ -202,7 +202,6 @@ export class Subplebbit extends EventEmitter {
if (this.updateCalledTimes > 1) {
throw Error('with the current hooks, subplebbit.update() should be called maximum 1 times, this number might change if the hooks change and is only there to catch bugs, the real comment.update() can be called infinite times');
}
// is ipnsName is known, look for updates and emit updates immediately after creation
if (!this.address) {
throw Error(`can't update without subplebbit.address`);
}
Expand Down Expand Up @@ -397,7 +396,6 @@ export class Comment extends Publication {
super();
this.updateCalledTimes = 0;
this.updating = false;
this.ipnsName = createCommentOptions === null || createCommentOptions === void 0 ? void 0 : createCommentOptions.ipnsName;
this.cid = createCommentOptions === null || createCommentOptions === void 0 ? void 0 : createCommentOptions.cid;
this.upvoteCount = createCommentOptions === null || createCommentOptions === void 0 ? void 0 : createCommentOptions.upvoteCount;
this.downvoteCount = createCommentOptions === null || createCommentOptions === void 0 ? void 0 : createCommentOptions.downvoteCount;
Expand Down Expand Up @@ -452,7 +450,6 @@ export class Comment extends Publication {
return __awaiter(this, void 0, void 0, function* () {
// use plebbit.getComment() so mocking Plebbit.prototype.getComment works
const commentIpfs = yield new Plebbit().getComment(this.cid || '');
this.ipnsName = commentIpfs.ipnsName;
this.content = commentIpfs.content;
this.author = commentIpfs.author;
this.timestamp = commentIpfs.timestamp;
Expand Down

0 comments on commit 813128a

Please sign in to comment.