Updates Smart Contract For Better Flow

I added the `posts.length` to `numPosts()` because it does not appear in the instructions and removed 2 `return` statements that I know will confuse people if left in, based on experience with a similar set up for the one function from DTwitter in India.
This commit is contained in:
Andy Tudhope 2018-08-25 10:29:07 +02:00 committed by GitHub
parent 0d78c99dc3
commit c57f1ac60d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 5 deletions

View File

@ -35,8 +35,7 @@ contract DReddit {
view
returns(uint)
{
// TODO:
return 1;
return posts.length;
}
// @notice Create Post
@ -65,7 +64,6 @@ contract DReddit {
returns (bool)
{
// TODO:
return true;
}
// @notice Obtain vote for specific post
@ -77,7 +75,6 @@ contract DReddit {
returns (uint8)
{
// TODO:
return 1;
}
}