Respond to RFCs in PR #951

pull/951/head
Kieran Prasch 2019-06-05 08:54:44 -07:00
parent 6f1fa31aa8
commit c873ad8784
No known key found for this signature in database
GPG Key ID: 199AB839D4125A62
6 changed files with 5 additions and 18 deletions

View File

@ -18,6 +18,7 @@ along with nucypher. If not, see <https://www.gnu.org/licenses/>.
import json
import os
from datetime import datetime
from decimal import Decimal
from json import JSONDecodeError
from typing import Tuple, List, Dict, Union
@ -102,7 +103,7 @@ class NucypherTokenActor:
return r
@property
def eth_balance(self) -> int:
def eth_balance(self) -> Decimal:
"""Return this actors's current ETH balance"""
balance = self.blockchain.interface.get_balance(self.checksum_public_address)
return self.blockchain.interface.fromWei(balance, 'ether')

View File

@ -128,7 +128,7 @@ def deploy(click_config,
# Verify ETH Balance
click.secho(f"\n\nDeployer ETH balance: {deployer.eth_balance}")
if deployer.eth_balance is 0:
if deployer.eth_balance == 0:
click.secho("Deployer address has no ETH.", fg='red', bold=True)
raise click.Abort()

View File

@ -28,10 +28,7 @@ class ChecksumAddress(click.ParamType):
name = 'checksum_public_address'
def convert(self, value, param, ctx):
# if is_checksum_address(value):
# return value
return to_checksum_address(value=value)
# self.fail('{} is not a valid EIP-55 checksum address'.format(value, param, ctx))
return to_checksum_address(value=value) # TODO: More robust validation here?
class IPv4Address(click.ParamType):

View File

@ -45,16 +45,6 @@ SeednodeMetadata = namedtuple('seednode', ['checksum_public_address', 'rest_host
SEEDNODES = tuple()
"""
=======
DOMAINS
=======
If this domain is among those being learned or served, then domain checking is skipped.
A Learner learning about the GLOBAL_DOMAIN will learn about all nodes.
A Teacher serving the GLOBAL_DOMAIN will teach about all nodes.
"""
# Sentry
NUCYPHER_SENTRY_PUBLIC_KEY = "d8af7c4d692e4692a455328a280d845e"
NUCYPHER_SENTRY_USER_ID = '1310685'

View File

@ -661,7 +661,6 @@ class NodeConfiguration(ABC):
# Addresses read from some node keyrings (clients) are *not* returned in checksum format.
checksum_address = to_checksum_address(checksum_address)
assert is_checksum_address(checksum_address), f"INVALID ETH ADDRESS {checksum_address}"
# Use explicit address
elif self.checksum_public_address:

View File

@ -740,7 +740,7 @@ class Learner:
# Deserialize
#
# TODO: Causes protocol versioning checks to fail in-test when using an unsigned Response
# TODO #1039 - Causes protocol versioning checks to fail in-test when using an unsigned Response
try:
signature, node_payload = signature_splitter(response.content, return_remainder=True)
except BytestringSplittingError as e: