Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create NetworkBroadcastApi#broadcast_transaction_synchronous helper method #16

Open
2 tasks
inertia186 opened this issue Dec 2, 2018 · 0 comments
Open
2 tasks

Comments

@inertia186
Copy link
Contributor

inertia186 commented Dec 2, 2018

In steem-ruby, the method Steem::NetworkBroadcastApi#broadcast_transaction_synchronous was never officially available as an RPC. Early versions of AppBase provided this method and steem-ruby would pass it along, but when AppBase dropped it, it also became unavailable in steem-ruby.

Prior to this, steem-ruby didn't even need a concrete class for Steem::NetworkBroadcastApi because it is dynamically defined at runtime with all available methods.

For now, the workaround is to use Steem::CondenserApi#broadcast_transaction_synchronous, but this is not a good long-term solution.

Instead, we should actually add the concrete class called Steem::NetworkBroadcastApi with an instance method of broadcast_transaction_synchronous to simulate the desired behavior by internally polling broadcasts with Steem::TransactionStatusApi#find_transaction.

https://developers.steem.io/apidefinitions/#apidefinitions-transaction-status-api

When the new Steem::NetworkBroadcastApi#broadcast_transaction_synchronous method polls for the transaction, it should poll for within_reversible_block and include block_num in the result like Steem::CondenserApi#broadcast_transaction_synchronous currently does.

AC

  • Create concrete class lib/steem/network_broadcast_api.rb with an instance method broadcast_transaction_synchronous that handles polling
  • Define tests in test/steem/network_broadcast_api_test.rb
@inertia186 inertia186 changed the title Create helper method: NetworkBroadcastApi#broadcast_transaction_synchronous Create NetworkBroadcastApi#broadcast_transaction_synchronous helper method Dec 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant