I discovered a Bug in D.Buzz
While testing features added to Steemfiles, I discovered a flaw in d.buzz. In order to get 50% in dollars. As you know, 50% in dollars often means much more than 50% in dollars and you still get 50% in Steem Power.
Now if the maximum is 3 HBD worth, this is not going to be a lot on one buzz. But this is probably not what the developer wanted to do. Maybe among thousands of users, this adds up to something significant in aggregate. The bug comes from a lack of testing, and a lack of good documentation on the part of the Hive base-layer.
Observe this screenshot piece that had the dbuzz tag in it:
Unfortunately, for DBUZZ users only 25% will be converted in HBD. To understand why this bug happened read on.
You might expect that a programmer will specify '50' in order to specify that its post should receive 50% in dollars somewhere. The documentation should tell you something about that but it doesn't. The field for this is called percent_hbd. So percent is in the name so you must put 50, shouldn't it be? But it isn't like that.
Actually, in votes the 'percent fields' require you to interpret the value as a per ten thousand value rather than a percentage. Like when reading the weight in the active_votes field of a post object:
export interface Opinion {
voter: string;
rshares: number;
percent: number;
reputation: number;
time?: string;
weight?: number;
}
"Percent" is actually a "PerTenThousand". Why didn't they name it "pertenthousand"? That's what it really is.
Okay, so we should specify 5,000 for the hbd_percent, right? Wrong.
Believe it enough it has to be 10 000 in order to get 50% in HBD. So I think the dev put 5,000 into the API thinking it would split the reward 50%/50%.
Were the developer to record the price of HBD at the time of conversion and the breakdown of the author rewards as it comes in, he would have noticed this problem. If the API had specified that it had to be 10,000 in order to specify 50%, the error probably would not have happened to begin with, however.
Other Posts by @leprechaun
Twenty Video Sites to Upload Content To
See How Videos Embed on this site
See How Videos Embed on Steemfiles
See How Videos Embed on hive.blog, on peakd, on steemit, on LeoFinance, or on Ecency