Pass --sync flag value to Stakeholder initialization

pull/1167/head
David Núñez 2019-07-28 00:55:58 +02:00 committed by Kieran Prasch
parent bd12cc9977
commit 9ce48d6e89
No known key found for this signature in database
GPG Key ID: 199AB839D4125A62
2 changed files with 4 additions and 3 deletions

View File

@ -788,14 +788,14 @@ class StakeHolder(BaseConfiguration):
return payload
@classmethod
def from_configuration_file(cls, filepath: str = None, **overrides) -> 'StakeHolder':
def from_configuration_file(cls, filepath: str = None, sync_now: bool = True, **overrides) -> 'StakeHolder':
filepath = filepath or cls.default_filepath()
payload = cls._read_configuration_file(filepath=filepath)
# Sub config
blockchain_payload = payload.pop('blockchain')
blockchain = BlockchainInterface.from_dict(payload=blockchain_payload)
blockchain.connect() # TODO: Leave this here?
blockchain.connect(sync_now=sync_now) # TODO: Leave this here?
payload.update(dict(blockchain=blockchain))

View File

@ -118,7 +118,8 @@ def stake(click_config,
STAKEHOLDER = StakeHolder.from_configuration_file(filepath=config_file,
provider_uri=provider_uri,
registry_filepath=registry_filepath,
offline=offline)
offline=offline,
sync_now=sync)
#
# Eager Actions
#