-
Notifications
You must be signed in to change notification settings - Fork 68
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
fix(search): adds utils for hash test + fix search issue #52
Conversation
Also fixes #36 |
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.
This modification works for most of the cases.
Note: If the transaction starts with 0x0000. The regex will catch it as a block and you will not be able to search for the transaction.
Hey @jsheng08, There is two way I can solve this, either we reput the check as before, but only with the two conflicting elements (hashtx and blocktx). In 2014, we expected 5 leading zeroes (0x00), so we could makes detection over (4) 0x00000000 as BlockHash. Thanks again for the review, was really helpful ! |
Good Day @Alex-Werner , Take Block number 20,000 mined on Feb 2014 as an example, there are 10 leading zeros for the blockhash. And ever since then, the hash rate has been increasing. We can implement something like #54 where if there are more than 10 leading zeros, it is a block. Otherwise, check for tx first and if it is not, then check that if it is a block. If it fails again, then we will assume that it is not found. Hope that this helps you a little, Happy Halloween. |
This makes sense to me, I agree more w/this approach. Still like the idea of being a "dumb client" and just passing to the API to resolve, but this should work too I guess, and probably less round-tripping. |
The problem of passing it to backend is that for each input will ask for stupid query to the backend to some input (especially when searching anything that is not a valid input like random string). I continue with the discuted agreed changes we had here (so basically up the leading zero for hash, add exception backfall for tx with leading zeroes). |
Circa 2014, we don't see any less than 10 trailing zeroes due to increase on difficulty
We should not need those logs anymore.
Testnet will be used by default (ensuring working fallback for all)
Small mistakes makes me forgot to include testnet with previous change
ce6f7f9
to
659029c
Compare
When status is 4**, it do not triggers callbackOnError but instead returns its with data output of the api.
Some updates here on some recent changes :
As per compatibility, everything defaults to 'testnet' so :
P.S : mind a new Also founds out that insight-ui code expects method to fail on status being 4** (such as 404 no tx). But in reality it actually goes into the successCallback, where we have no such logic. I added a quickfix for our substring error, but this doesn't touch / fix really anything. Leading to a white page on some tx displayed (when tx do not exist). Creating an issue (#55) |
c949eae
to
1457623
Compare
Fixed test as much as I could, it seems there was an issue with xbvf as Trusty is not supported and xenial travis usage requires it to have as addons, which we have (see here : https://stackoverflow.com/a/55674747/2941361). We seems to have another problem related with @dashevo/dp-services-ctl and it's image usage. Not sure I can do much about it right now. |
The dashevo/dp-services-ctl has circular dependencies w/other repos and I don't think it should affect this. Not sure if it should exist in that manner, but 🤷♂ . |
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.
slightly tested ACK
Issue being fixed or implemented
Search being broken on address and transaction hash considered as block hash.
What was done
Notes