Broadcast a new post + bug fixes

Words
160
Reading
1 min
Listen
Play
9y

Link to PR here

Solves issues:

Bug Fixes

  • Leaderboard sorting incorrectly
    The leaderboard had a bug where it was sorting users alphabetically by a.username > b.username and this evaluates to a boolean. The sort function needs a number -1, 0, 1 and therefore didn't sort correctly. Instead I simply let the algorithm sort by first posts, then votes.

image

  • Not error handling broadcast issues correctly
    Made these async functions with try/catch blocks to cover any exceptions.

New Features

Added the ability to post. Simply submit a valid Post object which is defined as:

export class Post {
    // STEEM Blockchain
    author: string;
    permlink: string;
    created: string;
    title: string;
    body: string;
    votes: number;
    jsonMetadata: JsonMetadata;

    // SQL
    did_comment: boolean;
    did_vote: boolean;
}

It ignores the author variable and uses the STEEM_USERNAME environment variable with the STEEM_PASSWORD environment variable. This basically finishes up the "Broadcast" file as you can now post, comment, and vote. Posting can be thought of as simply commenting on a null object.

Now Playing

Check out the #nowplaying community and bot in action here



Posted on Utopian.io - Rewarding Open Source Contributors

Broadcast a new post + bug fixes | Ecency