Implementing delete_comment operation in steem-python

Words
108
Reading
1 min
Listen
Play
9y

I'm working heavily with steem-python. (1, 2, 3, 4, 5)

What I needed in my latest steem project is to make delete_comment operations via steem-python but unluckily it wasn't implemented.

steem-python covers most of the blockchain operations but it's missing some of them.

Missing operations in steem-python

After seeing delete_comment is not implemented, I quickly implemented it in my version of steem-python. After initial tests, it works fine.

Usage

s = Steem(
    nodes=["RELIABLE_RPC_NODE"], 
    keys=["POSTING_KEY"]
)
c = Commit()
c.delete_comment("emrebeyler/testpost", account="emrebeyler")

Note that, first parameter is the identifier convention steem-python uses already. it's $username/$perm-link.

Unit tests

Also, added related unit tests and they ran perfectly fine. Waiting for upstream review.

$ pytest steem/test_transactions.py -k test_delete_comment
platform darwin -- Python 3.6.3, pytest-3.2.5, py-1.5.2, pluggy-0.4.0
collected 21 items
steem/test_transactions.py .
====================20 tests deselected===========
==== 1 passed, 20 deselected in 3.14 seconds =====

Pull Request

https://github.com/steemit/steem-python/pull/105



Posted on Utopian.io - Rewarding Open Source Contributors

Implementing delete_comment operation in steem-python | Ecency