Add second work evidence post to example 6

This commit is contained in:
Ladd Hoffman 2023-03-13 21:12:07 -05:00
commit e6a0c22d3f
1 changed files with 11 additions and 0 deletions

View File

@ -52,6 +52,17 @@ describe('Forum', function tests() {
forum.getPost(posts[2]).value.should.equal(1);
forum.getPost(posts[3]).value.should.equal(95);
});
it('Post5: Work evidence using latest work SC', async () => {
await forumTest.addPost(experts[0], 100, [
{ postId: posts[2], weight: 0.05 },
]);
forum.getPost(posts[0]).value.should.equal(7.2);
forum.getPost(posts[1]).value.should.be.within(0.80 - EPSILON, 0.80 + EPSILON);
forum.getPost(posts[2]).value.should.equal(2);
forum.getPost(posts[3]).value.should.equal(95);
forum.getPost(posts[4]).value.should.equal(95);
});
});
});