Skip to content

Commit

Permalink
Merge pull request #1912 from fetchai/fix/ledger-api-config-override
Browse files Browse the repository at this point in the history
Fix ledger api config override
  • Loading branch information
DavidMinarsch authored Nov 9, 2020
2 parents 2209b79 + c9e1f2c commit 58e4dba
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions aea/cli/utils/package_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,11 +526,15 @@ def is_distributed_item(item_public_id: PublicId) -> bool:
def _override_ledger_configurations(agent_config: AgentConfig) -> None:
"""Override LedgerApis configurations with agent override configurations."""
ledger_component_id = ComponentId(ComponentType.CONNECTION, LEDGER_CONNECTION)
if ledger_component_id not in agent_config.component_configurations:
prefix_to_component_configuration = {
key.component_prefix: value
for key, value in agent_config.component_configurations.items()
}
if ledger_component_id.component_prefix not in prefix_to_component_configuration:
return
ledger_apis_config = agent_config.component_configurations[ledger_component_id][
"config"
].get("ledger_apis", {})
ledger_apis_config = prefix_to_component_configuration[
ledger_component_id.component_prefix
]["config"].get("ledger_apis", {})
recursive_update(LedgerApis.ledger_api_configs, ledger_apis_config)


Expand Down

0 comments on commit 58e4dba

Please sign in to comment.