steemit / devportal

Steem Platform Developer Documentation.
https://developers.steem.io
MIT License
122 stars 74 forks source link

Document Which operations are broken or defunct #169

Closed relativityboy closed 6 years ago

relativityboy commented 6 years ago

It's terrible to not know what the api can do, it's almost as bad to be lied to by the documentation. ex condenser_api.verify_account_authority has been broken for a long time.... like.. since before Steem.

AC

inertia186 commented 6 years ago

Related to: #165

inertia186 commented 6 years ago

When in doubt, I go by the source code, e.g.:

https://github.com/steemit/steem/blob/1cfdf8101ec415156b155c9ec90b0a4d439a039f/libraries/plugins/apis/database_api/include/steem/plugins/database_api/database_api.hpp#L125

On the rare occasion I could not build a working curl, like in this case apparently, I document what is available in steemd source and what is reflected by jsonrpc.

inertia186 commented 6 years ago

The broken ones

I wrote a quick rake task that tries out each curl example. If it returns without an error key, it shows a √ check mark. Otherwise, it shows the error message. However, just because it has an error message doesn't mean the curl is a bad example. The example might say:

    Assert Exception:_account_history_api: account_history_api_plugin not enabled.

... which is a valid response for the example. Or it might say:

    Assert Exception:start_c != c_idx.end(): Comment is not in account's comments

... which is also valid.

I ran it for just condenser_api (full result below). I feel that these are pretty good results.

twiki:devportal (169-test-curl)$ bundle exec rake test:curl[condenser_api]
Testing condenser_api.broadcast_block ...
    Assert Exception:item->num > std::max<int64_t>( 0, int64_t(_head->num) - (_max_size) ): attempting to push a block that is too old

Testing condenser_api.broadcast_transaction ...
    Assert Exception:var.is_object(): Asset has to treated as object.

Testing condenser_api.broadcast_transaction_synchronous ...
    Assert Exception:var.is_object(): Asset has to treated as object.

Testing condenser_api.get_account_bandwidth ... √√
Testing condenser_api.get_account_count ... √
Testing condenser_api.get_account_history ... √√
Testing condenser_api.get_account_reputations ... √√
Testing condenser_api.get_account_votes ... √√
Testing condenser_api.get_accounts ... √√
Testing condenser_api.get_active_votes ... √
    unknown key:unknown key:

Testing condenser_api.get_active_witnesses ... √
Testing condenser_api.get_block ... √√√
Testing condenser_api.get_block_header ... √√√
Testing condenser_api.get_blog ... √√
Testing condenser_api.get_blog_authors ... √√
Testing condenser_api.get_blog_entries ... √√
Testing condenser_api.get_chain_properties ... √
Testing condenser_api.get_comment_discussions_by_payout ... √√
Testing condenser_api.get_config ... √
Testing condenser_api.get_content ... √√
Testing condenser_api.get_content_replies ... √√
Testing condenser_api.get_conversion_requests ... √
Testing condenser_api.get_current_median_history_price ... √
Testing condenser_api.get_discussions_by_active ... √√
Testing condenser_api.get_discussions_by_author_before_date ... √
Testing condenser_api.get_discussions_by_blog ... √√
Testing condenser_api.get_discussions_by_cashout ... √√
Testing condenser_api.get_discussions_by_children ... √√
Testing condenser_api.get_discussions_by_comments ... √
    Assert Exception:start_c != c_idx.end(): Comment is not in account's comments

Testing condenser_api.get_discussions_by_created ... √√
Testing condenser_api.get_discussions_by_feed ... √√
Testing condenser_api.get_discussions_by_hot ... √√
Testing condenser_api.get_discussions_by_promoted ... √√
Testing condenser_api.get_discussions_by_trending ... √√
Testing condenser_api.get_discussions_by_votes ... √√
Testing condenser_api.get_dynamic_global_properties ... √
Testing condenser_api.get_escrow ... √
Testing condenser_api.get_expiring_vesting_delegations ... √√
Testing condenser_api.get_feed ... √√
Testing condenser_api.get_feed_entries ... √√
Testing condenser_api.get_feed_history ... √
Testing condenser_api.get_follow_count ... √√
Testing condenser_api.get_followers ... √√
Testing condenser_api.get_following ... √√
Testing condenser_api.get_hardfork_version ... √
Testing condenser_api.get_key_references ... √
Testing condenser_api.get_market_history ... √√√√√
Testing condenser_api.get_market_history_buckets ... √
Testing condenser_api.get_next_scheduled_hardfork ... √
Testing condenser_api.get_open_orders ... √√
Testing condenser_api.get_ops_in_block ... √√
Testing condenser_api.get_order_book ... √√
Testing condenser_api.get_owner_history ... √
Testing condenser_api.get_post_discussions_by_payout ... √√
Testing condenser_api.get_potential_signatures ...
    Assert Exception:var.is_object(): Asset has to treated as object.

Testing condenser_api.get_reblogged_by ... √
    unknown key:unknown key:

Testing condenser_api.get_recent_trades ... √√
Testing condenser_api.get_recovery_request ... √
Testing condenser_api.get_replies_by_last_update ... √
Testing condenser_api.get_required_signatures ...
    Assert Exception:var.is_object(): Asset has to treated as object.

Testing condenser_api.get_reward_fund ... √
Testing condenser_api.get_savings_withdraw_from ... √
Testing condenser_api.get_savings_withdraw_to ... √
Testing condenser_api.get_state ... √
Testing condenser_api.get_tags_used_by_author ... √
Testing condenser_api.get_ticker ... √
Testing condenser_api.get_trade_history ... √
Testing condenser_api.get_transaction ...
    Assert Exception:_account_history_api: account_history_api_plugin not enabled.

Testing condenser_api.get_transaction_hex ...
    Assert Exception:var.is_object(): Asset has to treated as object.

Testing condenser_api.get_trending_tags ... √√
Testing condenser_api.get_version ... √
Testing condenser_api.get_vesting_delegations ... √
Testing condenser_api.get_volume ... √
Testing condenser_api.get_withdraw_routes ... √√√
Testing condenser_api.get_witness_by_account ... √
Testing condenser_api.get_witness_count ... √
Testing condenser_api.get_witness_schedule ... √
Testing condenser_api.get_witnesses ... √
Testing condenser_api.get_witnesses_by_vote ... √√
Testing condenser_api.lookup_account_names ... √
Testing condenser_api.lookup_accounts ... √
Testing condenser_api.lookup_witness_accounts ... √
Testing condenser_api.verify_account_authority ...
    missing required active authority:Missing Active Authority steemit

Testing condenser_api.verify_authority ...
    Assert Exception:var.is_object(): Asset has to treated as object.

twiki:devportal (169-test-curl)$
relativityboy commented 6 years ago

verify_account_authority has never worked in Steem.

This is good work. Now to decide the best way to automate this and build it into our site.

And to point the story...

inertia186 commented 6 years ago

With the latest commit, running this task will result in all methods passing:

bundle exec rake test:curl[condenser_api]

For reference, when using staging, some tests fail due to changes to operation structure, or something:

TEST_NODE=https://api.steemitstage.com rake test:curl[condenser_api]

So, on the one hand, it's good that the tests only fail on staging and not production. On the other hand, it's worrisome that staging is failing when testing condenser_api.

inertia186 commented 6 years ago

That last commit would be nice to have, if we wanted to run the rake task periodically.

relativityboy commented 6 years ago

@inertia186 please add your commit to the branch 169-redux and create a PR. This should fix some bumps we ran into with the merge of #163.

roadscape commented 5 years ago

@inertia186 that's quite the list. Do we have issues filed for these items on the steem repo?

inertia186 commented 5 years ago

The worst of the problems were related to appbase transition. So most of them have been dealt with by updating the curl examples.

Fast forward to HF20, we had to remove a small number of methods because of the adoption of RC.

Right now, I think it's stable.