diff --git a/ethereum/contracts/core/Forum.sol b/ethereum/contracts/core/Forum.sol index 209c87a..41fe854 100644 --- a/ethereum/contracts/core/Forum.sol +++ b/ethereum/contracts/core/Forum.sol @@ -22,12 +22,6 @@ struct Post { // TODO: timestamp } -// struct PostParams { -// string contentId; -// Author[] authors; -// Citation[] citations; -// } - contract Forum is Reputation { mapping(string => Post) public posts; string[] public postIds; @@ -93,16 +87,6 @@ contract Forum is Reputation { emit PostAdded(contentId); } - // function addPosts(PostParams[] calldata postParams) external { - // for (uint i = 0; i < postParams.length; i++) { - // this.addPost( - // postParams[i].authors, - // postParams[i].contentId, - // postParams[i].citations - // ); - // } - // } - function getPostAuthors( string calldata postId ) external view returns (Author[] memory) { diff --git a/ethereum/test/Forum.js b/ethereum/test/Forum.js index 7d5697a..7dcfe35 100644 --- a/ethereum/test/Forum.js +++ b/ethereum/test/Forum.js @@ -63,37 +63,6 @@ describe('Forum', () => { expect(postAuthors[0].authorAddress).to.equal(account1); }); - // it('should be able to add multiple posts', async () => { - // await expect(dao.addPost([{ - // authors: [{ weightPPM: 100, authorAddress: account1 }], - // contentId: 'some-id', - // citations: [], - // }, { - // authors: [{ weightPPM: 100, authorAddress: account2 }], - // contentId: 'some-other-id', - // citations: [], - - // }, - // ])) - // .to.emit(dao, 'PostAdded').withArgs('some-id') - // .to.emit(dao, 'PostAdded').withArgs('some-other-id'); - // let post = await dao.posts('some-id'); - // expect(post.sender).to.equal(account1); - // expect(post.id).to.equal('some-id'); - // let postAuthors = await dao.getPostAuthors('some-id'); - // expect(postAuthors).to.have.length(1); - // expect(postAuthors[0].weightPPM).to.equal(1000000); - // expect(postAuthors[0].authorAddress).to.equal(account1); - - // post = await dao.posts('some-other-id'); - // expect(post.sender).to.equal(account2); - // expect(post.id).to.equal('some-other-id'); - // postAuthors = await dao.getPostAuthors('some-other-id'); - // expect(postAuthors).to.have.length(1); - // expect(postAuthors[0].weightPPM).to.equal(1000000); - // expect(postAuthors[0].authorAddress).to.equal(account2); - // }); - it('should be able to add a post on behalf of another account', async () => { const contentId = 'some-id'; await addPost(account2, contentId, []);