mirror of https://github.com/nucypher/nucypher.git
Respond to RFCs in PR #951
parent
6f1fa31aa8
commit
c873ad8784
|
@ -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')
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue