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

Sourcery refactored master branch #1

Merged
merged 1 commit into from
Nov 27, 2023
Merged

Sourcery refactored master branch #1

merged 1 commit into from
Nov 27, 2023

Conversation

sourcery-ai[bot]
Copy link

@sourcery-ai sourcery-ai bot commented Nov 27, 2023

Branch master refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the master branch, then run:

git fetch origin sourcery/master
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

Comment on lines -4 to +5
ip_list = []
ais = socket.getaddrinfo(hostname,0,0,0,0)
for result in ais:
ip_list.append(result[-1][0])
# ip_list = list(set(ip_list))
return ip_list
return [result[-1][0] for result in ais]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function nslookup refactored with the following changes:

This removes the following comments ( why? ):

# ip_list = list(set(ip_list))

Comment on lines -48 to +50
fp = open('/tmp/nodes.txt')
for node in fp:
nodes = addnode(nodes, node)
fp.close()
with open('/tmp/nodes.txt') as fp:
for node in fp:
nodes = addnode(nodes, node)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function loadnodes refactored with the following changes:

Comment on lines -71 to +70
nodes = nodes[0:limit]
nodes = nodes[:limit]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function prepare refactored with the following changes:

Comment on lines -90 to +91
for i in range(0, 4):
for _ in range(0, 4):
# print(tx)
newthread(target = broadcast, args = (nodes, tx, ))
newthread(target = broadcast, args = (nodes, tx, ))
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function main refactored with the following changes:

checksum = hashlib.sha256(hashlib.sha256(payload).digest()).digest()[0:4]
checksum = hashlib.sha256(hashlib.sha256(payload).digest()).digest()[:4]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function makeMessage refactored with the following changes:

Comment on lines -74 to +73
time = payload[0:0:4].encode('hex')
time = payload[:0:4].encode('hex')
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function disect_netaddress refactored with the following changes:

Comment on lines -82 to +81
version = payload[0:0 + 4].encode('hex')
version = payload[:0 + 4].encode('hex')
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function disect_version refactored with the following changes:

Comment on lines -100 to +99
s = [r[0:4], r[4:4 + 12], r[16:16 + 4], r[20:20 + 4], r[24:]]
s = [r[:4], r[4:4 + 12], r[16:16 + 4], r[20:20 + 4], r[24:]]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function disect_msg refactored with the following changes:

checksum = hashlib.sha256(hashlib.sha256(s).digest()).digest()[0:4]
checksum = hashlib.sha256(hashlib.sha256(s).digest()).digest()[:4]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function base58CheckEncode refactored with the following changes:

checksum = hashlib.sha256(hashlib.sha256(result).digest()).digest()[0:4]
checksum = hashlib.sha256(hashlib.sha256(result).digest()).digest()[:4]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function base58CheckDecode refactored with the following changes:

@daedalus daedalus merged commit e2dee34 into master Nov 27, 2023
2 checks passed
@daedalus daedalus deleted the sourcery/master branch November 27, 2023 21:06
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

Successfully merging this pull request may close these issues.

1 participant