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
Conversation
- 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
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.
- 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)
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.
Smooth.
buycoins/wallets.py
Outdated
try: | ||
response = self._execute_request(query=self.__query, variables=__variables) | ||
check_response(WalletError, response) | ||
except WalletError as e: |
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 should be except (WalletError, ClientError) as e:
.
Effect the changes for the other try...except
block.
buycoins/wallets.py
Outdated
try: | ||
response = self._execute_request(query=self.__query, variables=__variables) | ||
check_response(WalletError, response) | ||
except WalletError as e: |
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 should be except (WalletError, ClientError) as e:
.
Effect the changes for the other try...except
block.
buycoins/wallets.py
Outdated
if len(address) == 34: | ||
raise WalletError("Invalid address") |
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.
How does this work?
… 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