[busy old post edit test] Steem Python library sbd_to_rshares bugfixsteemCreated with Sketch.

in #utopian-io6 years ago (edited)

I've fixed the code to enable edit for posts older than 7 days. This 11 day old (as of Dec 23, 2018) post was picked for testing that feature before pull request.

(This original post wasn't accepted unfortunately because Steem official Python library isn't in the utopian whitelist. But I'm still happy to see my code was merged, which was my first open source contribution to Steem community.)

Hope this will be my second and much more impactful contribution to Steem. HF20 was a long time ago. Come on, posts should be editable now :)

ps. It worked like a charm :)

This is my Christmas gift to Steem community :) Hope that it'll be merged soon. Merry Christmas!

ps2. Since I gave you a present, please make Steem official Python library included in the Utopian whitelist (of course, in addition to generous voting :) So many people are using Busy. Enjoy editing!


Project Information

Expected behavior

sbd_to_rshares() should return rshares value for a given sbd.

Actual behavior

It raises TypeError exception as follows:

  File "/anaconda3/lib/python3.6/site-packages/steem/converter.py", line 101, in sbd_to_rshares
    steem_payout / total_reward_fund_steem) * total_reward_shares2
TypeError: unsupported operand type(s) for /: 'float' and 'Amount'

How to reproduce

  • Operating system: any OS that can use Steem Python library

It happens all the time.

get_dynamic_global_properties() no longer returns reward_fund info. Technically it still returns something but all zeros as follows.

'total_reward_fund_steem'={'amount': '0', 'precision': 3, 'nai': '@@000000021'}
'total_reward_shares2'= 0

How to fix

sbd_to_rshares() should use get_reward_fund() instead. I've made a pull request: https://github.com/steemit/steem-python/pull/274

Suggestion

While my pull request for the Python library has been merged already (as in PS below), I think Steem database API should also change for fields no longer supported. Just returning 0 may look like it might be due to temporary errors or even valid value (e.g., theoretically possible in this example). Please return special values for non-supported fields if those fields should still be kept for some reasons (e.g., compatibility).

GitHub Account

I made a pull request here: https://github.com/steemit/steem-python/pull/274

PS. Wow, @roadscape already merged it. Thanks a lot! I actually thought this library is no longer maintained, but I'm still using it since it's still official library. Go for Steemit again!

Sort:  

Hi @blockchainstudio, thanks for this contribution.

Kudos on fixing the bug and having your pull request merged. It is quite unfortunate that while this report is well written to meet the standards of the bug-hunting category, the repository which this contribution was made to, is not included in the whitelist.

If you are not aware, there is a whitelist that specifies projects that bug hunting contributions can be made to, this can be found here:

https://docs.google.com/spreadsheets/d/1S7ayFTEy5CBMyeJvFRgq5JUjlqZxFjWAWhhrBL0GC60/edit#gid=1954068373

I apologise for the incovenience experienced as a result, but do not be deterred by this :) . I look forward to your future contributions.

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

Hi @fego, thank you for your comments. Yes, I actually found that list after submitting this, but I hoped python library could be considered as a subset of steem :) since it's official library. I pointed out it's also a problem of steem itself, so it'd better if I could get some courtesy voting, but I'm absolutely fine with no voting. I'm very happy to see that mine was merged :) have a nice weekend!

ps. I strongly suggest that steem official python library should also be included in the whitelist. As I wrote, I thought this library is almost abandoned (I also use both this and beem). But it's still official. It should be maintained.

Thank you for your review, @fego! Keep up the good work!

Summary in Korean: 원래 다른 글을 쓰려고 준비하다가 해당 함수에 버그가 있길래 간단히 고칠 수 있는 거여서 직접 고쳐서 github pull request까지 했습니다. 사실 하도 업데이트가 없어서 버려진 라이브러리라고 생각했는데ㅎㅎ 누군가 고맙다고 이미 깃허브에 답장을 달고 허걱 merge까지 끝났네요.

우와 스팀 블록체인 코어는 아니더라도 공식 스팀잇 파이썬 라이브러리에 제 코드 수정한게 반영됐네요ㅎㅎ 뿌듯뿌듯ㅎㅎ

아니 진짜 머지? 이 머지(merge)는?ㅎㅎ 스팀잇이 일좀 하려나. 스팀잇 직원일수도 있고 그냥 권한 있는 개발자일 가능성이 더 높긴한데. 아무튼 아시겠지만 오픈소스라고 해서 다 해당 프로젝트에 수정권한이 있지 않거든요. 예를 들면 전 없죠ㅋㅋ 암튼 재밌네요 바로바로 되어서.

ps. 헉 이제보니 @roadscape steemd 관리자군요. 어쩐지 아이디가 눈에 익다 했더니.

ps2. 이제보니 스팀파이썬 라이브러리가 유토피안 버그리포트에 해당이 안될지도 모르겠네요ㅠㅠ 하긴 이게 되면 지금까지 이렇게 업데이트가 안되고 있을리가. 큰틀에서 스팀잇 일부로 봐서 당연히 되는 것으로 보는 것일지도 모르겠고. 어찌될지ㅎㅎ

ps3. 아 역시 스팀 파이썬 라이브러리는 해당사항이 없다고ㅠㅠ ps2에 써둔것처럼 저도 포스팅하고 whitelist체크해보니 없길래 불길해서 steem core api의 문제이기도 하다고 뒤늦게 약간 수정했는데 역시 그걸로는 안되는군요. 애초에 steem의 문제다라고 했어야ㅎㅎ 그래도 이 일은 제 코드가 올라간 것으로 이미 너무나 보람있습니다. bug report 할때는 해당되는 오픈소스 프로젝트인지 반드시 확인하세요^^ 가이드라인에 리스트 링크가 있습니다. 정작 대체 라이브러리인 beem은 되고 official library는 안되는 이 우스운 상황ㅎㅎ

대단하십니다 ㅎㅎ

사실 정말 단순한 버그라서 민망하지만 그래도 처음해보는 일이라 신기해서 기분은 좋네요^^ 감사합니다!

곰돌이가 @lostmine27님의 소중한 댓글에 $0.017을 보팅해서 $0.006을 살려드리고 가요. 곰돌이가 지금까지 총 2008번 $26.011을 보팅해서 $24.856을 구했습니다. @gomdory 곰도뤼~

스팀잇 파이썬 라이브러리 오픈소스에 기여하셨군요. #274번째로 머지가 되었네요.ㅎㅎ 신기합니다.

감사합니다^^ 이렇게 스샷으로도 보니까 보기좋네요ㅎㅎ

곰돌이가 @anpigon님의 소중한 댓글에 $0.017을 보팅해서 $0.006을 살려드리고 가요. 곰돌이가 지금까지 총 2006번 $25.976을 보팅해서 $24.845을 구했습니다. @gomdory 곰도뤼~

존경합니다. ㅋ

ㅎㅎ이거 정말 별거 아닌건데 부끄럽네요ㅎㅎ

곰돌이가 @jisoooh0202님의 소중한 댓글에 $0.017을 보팅해서 $0.006을 살려드리고 가요. 곰돌이가 지금까지 총 2016번 $26.091을 보팅해서 $24.960을 구했습니다. @gomdory 곰도뤼~


@blockchainstudio님 곰돌이가 최대 두배로 보팅해드리고 가요~! 영차~

아우 곰도뤼 완전 귀욤~♥

Posted using Partiko Android

요새 busy가 잘안되어서 오늘 특히ㅠㅠ 모처럼 스팀잇으로 와보니 또 색다르네요ㅎㅎ 그림이 더 작게 보이는데.

노드 업데이트 영향인거 같아요~ㅠㅠ
비지 3개월전 포스팅 먼저 보이고 난리 ㅠㅠ

오늘의 영화여행 어제 포스팅 글
비지 임시저장으로 작성 했었는데
포스팅 올리려니 임시저장 최신글은 저장도 안되고 모두 날아가 다시 작성해야 하는...으아아아아아~앙~!

파티코앱도 포스팅 콘텐츠 태그 오류 주르르르륵 떠서 글도 읽지 못하고 있어요~!

뭔가 업데이트 할때마다 영향이 있네요
행복한 불금 보내셔용~^^

Posted using Partiko Android

곰돌이가 @bluengel님의 소중한 댓글에 $0.017을 보팅해서 $0.006을 살려드리고 가요. 곰돌이가 지금까지 총 2011번 $26.045을 보팅해서 $24.891을 구했습니다. @gomdory 곰도뤼~

곰도뤼 고마워용~♥
행복한 수욜 보내셔용~^^

Posted using Partiko Android

짱짱맨 호출에 응답하여 보팅하였습니다.

Congratulations @blockchainstudio! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You got more than 2000 replies. Your next target is to reach 2250 replies.

Click here to view your Board of Honor
If you no longer want to receive notifications, reply to this comment with the word STOP

Support SteemitBoard's project! Vote for its witness and get one more award!

브람디님께서 블루엔젤 포스팅에도 들려주심
좋겠어욤~! ㅋㅋ

행복한 목욜 보내셔용~^^

Posted using Partiko Android

Hi @blockchainstudio!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your UA account score is currently 4.232 which ranks you at #2774 across all Steem accounts.
Your rank has dropped 2 places in the last three days (old rank 2772).

In our last Algorithmic Curation Round, consisting of 253 contributions, your post is ranked at #129.

Evaluation of your UA score:
  • Some people are already following you, keep going!
  • The readers like your work!
  • You have already shown user engagement, try to improve it further.

Feel free to join our @steem-ua Discord server

Coin Marketplace

STEEM 0.19
TRX 0.17
JST 0.033
BTC 63989.15
ETH 2749.61
USDT 1.00
SBD 2.66