-
Notifications
You must be signed in to change notification settings - Fork 27
bchsvexplorer: partially fix client #82
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
Conversation
|
unfortunately duplicating work of #78 but I think there are a few things this PR got right-- I'll comment on the other PR |
|
At first glance looks good to me. |
|
This differs from #78 because it doesn't include https://github.com/AustEcon/bitsv/pull/78/files#diff-94bb32bc0d347563bc1d3f5169d0c048fef96975c9d641dc96c7a0f324aa10b9R26 (the changed endpoint url) and hence connects to a different service. @kcentrifugal so you know, I emailed bchsvexplorer to ask about a query issue and they said that host is no longer maintained and the bsvbook.guarda service replaces it. That was some months ago. Sorry I haven't dealt with the concerns on my PR yet, feel free to favor this one or combine them or whatnot. |
|
Thanks a million @kcentrifugal Sorry for lagging behind on this... I have been trying to push another BSV project to its first milestone... Will get onto this as soon as I can. |
No, https://bchsvexplorer.com/ and https://bsvbook.guarda.co/ are the same service on different domains. They serve the same content. Servers can respond to multiple domains. Anyway, I think it's a minor point. |
|
Posting this here: https://github.com/guardaco/blockbook/blob/guarda-changes/docs/api.md Because the documentation is not very easy to find with a simple google search... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't worry about updating this PR. I will sort it and then I'll see about what can be taken from #78
| r = requests.get(cls.MAIN_ADDRESS_TX_IDS.format(address), timeout=DEFAULT_TIMEOUT) | ||
| r.raise_for_status() # pragma: no cover | ||
| return r.json()['transactions'] | ||
| return r.json()['txids'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will change this to:
txs = r.json().get('txids') # if there are no txs in history the 'txids' key doesn't exist
if txs:
return txs
return []
Because wierdly their api drops the 'txids' key if there is no history for they key/address...
| def test_get_transactions_main_equal(self): | ||
| results = [api.get_transactions(MAIN_ADDRESS_USED1) for api in network_api_main.list_of_apis] | ||
| assert all_items_common(results[:100]) | ||
| assert all_items_common(results) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree
|
maybe something changed since my support email, or i missed something. thanks for addressing this. |
This PR fixes the bchsvexplorer client partially, enough to pass current tests.
More time will be needed to fully bring it in line with the current API. But clearly no one is using this client-- is it worth the work?