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

Implemented wallet class for buying, selling, creating and retrieving… #4

Merged
merged 10 commits into from Jan 31, 2021

Conversation

gabbyprecious
Copy link
Collaborator

… wallet address and also checking network fee

Wallet Class:

Creating a receiving address for a cryptocurrency
Allowing the purchase of a cryptocurrency
Allowing the sale of a cryptocurrency.
Calculating the network fee for a currency's amount

Youngestdev and others added 4 commits January 31, 2021 01:15
- Improved the exceptions check for methods.
- Fixed typos in some methods.
- Updated response object to direct values.
Invalid auth keys can be passed or any client error can occur. First step is to catch HTTPErrors :+!:
Check for errors against a response and exception. If there's an error, raise the appropriate exception.
… wallet address and also checking network fee
@gabbyprecious gabbyprecious self-assigned this Jan 31, 2021
@gabbyprecious gabbyprecious linked an issue Jan 31, 2021 that may be closed by this pull request
Copy link
Owner

@Youngestdev Youngestdev left a comment

Choose a reason for hiding this comment

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

  • Method names should be in camelCase.
  • queries should be executed in a try...except block. ClientError exception should also be included in the except block.
  • Uniformity: should be
self._execute_request(self.query=self.__query, variables=__variables)

Not

self._execute_request(self.__query, variables=__variables)

Or

self._execute_request(self.query=self.__query, __variables)

buycoins/exceptions/exceptions.py Outdated Show resolved Hide resolved
buycoins/wallets.py Outdated Show resolved Hide resolved
buycoins/wallets.py Outdated Show resolved Hide resolved
buycoins/wallets.py Outdated Show resolved Hide resolved
buycoins/wallets.py Outdated Show resolved Hide resolved
buycoins/wallets.py Outdated Show resolved Hide resolved
buycoins/wallets.py Outdated Show resolved Hide resolved
buycoins/wallets.py Outdated Show resolved Hide resolved
buycoins/wallets.py Outdated Show resolved Hide resolved
Copy link
Owner

@Youngestdev Youngestdev left a comment

Choose a reason for hiding this comment

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

Smooth.

try:
response = self._execute_request(query=self.__query, variables=__variables)
check_response(WalletError, response)
except WalletError as e:
Copy link
Owner

Choose a reason for hiding this comment

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

This should be except (WalletError, ClientError) as e:.

Effect the changes for the other try...except block.

try:
response = self._execute_request(query=self.__query, variables=__variables)
check_response(WalletError, response)
except WalletError as e:
Copy link
Owner

Choose a reason for hiding this comment

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

This should be except (WalletError, ClientError) as e:.

Effect the changes for the other try...except block.

Comment on lines 223 to 224
if len(address) == 34:
raise WalletError("Invalid address")
Copy link
Owner

Choose a reason for hiding this comment

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

How does this work?

@Youngestdev Youngestdev merged commit a8d5324 into development Jan 31, 2021
@Youngestdev Youngestdev deleted the wallet branch January 31, 2021 19:06
Repository owner locked and limited conversation to collaborators Feb 1, 2021
Repository owner unlocked this conversation Feb 1, 2021
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.

Build wallet class.
2 participants