-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Put human readable function signatures in the transaction confirmation screen. #962
Put human readable function signatures in the transaction confirmation screen. #962
Conversation
I would ❤️ feedback on this. I'm utterly new to this codebase and would like to do things "the right way". Also won't be offended if someone more familiar wants to take this across the finish line at whatever point they feel that is appropriate. |
Im at a conference the next two days, but would surely take a look at the code.. Can you please wait until friday? |
Code looks good from the first sight, would need to test it though. |
Ideally it would also show not only the function, but the actual values inside the function. Maybe its better to put this then above the bytes data field e.g.
|
Missing a label. |
Ah, my mouse acted weird - having its own will lately.. sorry |
I am moving forward with this PR, and @pipermerriam I have a question: Is there a way to get updated versions of the whole dictionary, just like your Gist? I'm thinking of downloading it on every Mist build. |
The easiest thing might be for me to provide you with a script that scrapes On Thu, Aug 4, 2016, 1:15 PM Everton Fraga notifications@github.com wrote:
|
@evertonfraga Here is a python script that demonstrates scraping the API for all signatures. I imagine it should be easy to transform into something import requests
import json
URL = "https://www.4byte.directory/api/v1/signatures/"
def get_all_signatures():
page = 1
while True:
response = requests.get(URL, {'page': page}, headers={'Content-Type': 'application/json'})
# if there are no results for the requested page, the API returns a 404
try:
response.raise_for_status()
except requests.exceptions.HTTPError:
break
response_data = response.json()
if response_data['count'] == 0:
break
# The api returns a json hash, with the actual signatures in an array under the key 'results'
for result in response_data['results']:
yield result
page += 1
def write_all_signatures():
with open('signatures.json', 'w') as f:
signatures = list(get_all_signatures())
json.dump(signatures, f)
if __name__ == '__main__':
write_all_signatures() |
replaced by #1141 |
This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread. |
#955
What was wrong
When sending a transaction, the user will be better informed if they are able to see more data about the transaction.
How was this improved
Now the function signature is queried against the
4byte.directory
api to try and lookup the human readable signature.Cute animal picture