Respond to RFCs in #1664: Remove some straggler keyfile references wrt Signers.

pull/1664/head
Kieran R. Prasch 2020-02-27 11:33:59 -07:00 committed by Kieran Prasch
parent 4e972b994e
commit a01fea1cbc
No known key found for this signature in database
GPG Key ID: 199AB839D4125A62
2 changed files with 1 additions and 16 deletions

View File

@ -1482,10 +1482,8 @@ class StakeHolder(Staker):
def __init__(self,
registry: BaseContractRegistry,
client_addresses: set = None,
keyfiles: List[str] = None,
signer=None):
self.__keyfiles = keyfiles or list()
self.__local_accounts = dict()
self.__client_accounts = set() # Note: Account index is meaningless here
self.__transacting_powers = dict()
@ -1512,12 +1510,6 @@ class StakeHolder(Staker):
if self.__signer:
signer_accounts = self.__signer.accounts()
self.__client_accounts.update(signer_accounts)
for keyfile in self.__keyfiles:
try:
account = to_checksum_address(keyfile.split('--')[-1])
self.__local_accounts[account] = keyfile
except ValueError:
raise ValueError(f"Key files must be in the geth wallet format; {keyfile} is invalid.")
client_accounts = self.blockchain.client.accounts # Accounts via connected provider
self.__client_accounts.update(client_accounts)
@ -1555,7 +1547,6 @@ class StakeHolder(Staker):
is_me: bool = True,
initial_address: str = None,
checksum_addresses: set = None,
keyfiles: List[str] = None,
signer: str = None,
password: str = None,
*args, **kwargs):
@ -1568,7 +1559,6 @@ class StakeHolder(Staker):
# Wallet
self.wallet = self.StakingWallet(registry=self.registry,
client_addresses=checksum_addresses,
keyfiles=keyfiles,
signer=signer)
if initial_address:
# If an initial address was passed,

View File

@ -23,7 +23,6 @@ from nucypher.blockchain.eth.constants import MAX_UINT16
from nucypher.blockchain.eth.events import EventRecord
from nucypher.blockchain.eth.interfaces import BlockchainInterfaceFactory
from nucypher.blockchain.eth.registry import IndividualAllocationRegistry
from nucypher.blockchain.eth.signers import Signer
from nucypher.blockchain.eth.token import NU, StakeList
from nucypher.blockchain.eth.utils import datetime_at_period
from nucypher.cli import painting, actions
@ -183,12 +182,11 @@ class TransactingStakerOptions:
__option_name__ = 'transacting_staker_options'
def __init__(self, staker_options, hw_wallet, beneficiary_address, allocation_filepath, keyfile):
def __init__(self, staker_options, hw_wallet, beneficiary_address, allocation_filepath):
self.staker_options = staker_options
self.hw_wallet = hw_wallet
self.beneficiary_address = beneficiary_address
self.allocation_filepath = allocation_filepath
self.keyfile = keyfile
def create_character(self, emitter, config_file):
@ -229,7 +227,6 @@ class TransactingStakerOptions:
config_file,
individual_allocation=individual_allocation,
initial_address=initial_address,
keyfiles=[self.keyfile] if self.keyfile else None, # TODO: Accept multiple?,
)
def get_blockchain(self):
@ -248,8 +245,6 @@ group_transacting_staker_options = group_options(
hw_wallet=option_hw_wallet,
beneficiary_address=click.option('--beneficiary-address', help="Address of a pre-allocation beneficiary", type=EIP55_CHECKSUM_ADDRESS),
allocation_filepath=click.option('--allocation-filepath', help="Path to individual allocation file", type=EXISTING_READABLE_FILE),
keyfile=click.option('--keyfile', default=None, type=EXISTING_READABLE_FILE),
)