Skip to content

Commit

Permalink
enable more evm chains
Browse files Browse the repository at this point in the history
  • Loading branch information
8ball030 authored Oct 13, 2023
1 parent 099751e commit 18e4fd0
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion packages/valory/connections/ledger/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,25 @@
from aea.protocols.base import Message
from aea.protocols.dialogue.base import Dialogue, Dialogues

ETHEREUM_LEDGER_ID = "ethereum"

EVM_LEDGERS = {
i: ETHEREUM_LEDGER_ID
for i in [
"matic",
"gnosis",
"bsc",
"optimism",
"arbitrum",
"celo",
"avalanche",
"fantom",
"base",
"zksync",
"canto",
]
}


class RequestDispatcher(ABC):
"""Base class for a request dispatcher."""
Expand Down Expand Up @@ -158,7 +177,11 @@ def dispatch(self, envelope: Envelope) -> Task:
ledger_id = self.get_ledger_id(message)
chain_id = self.get_chain_id(message)
self.set_extra_kwargs(message)
api = self.ledger_api_registry.make(ledger_id, **self.api_config(chain_id))
if ledger_id not in EVM_LEDGERS:
registry_ledger_id = ledger_id
else:
registry_ledger_id = ETHEREUM_LEDGER_ID
api = self.ledger_api_registry.make(registry_ledger_id, **self.api_config(chain_id))
dialogue = self.dialogues.update(message)
if dialogue is None:
raise ValueError( # pragma: nocover
Expand Down

0 comments on commit 18e4fd0

Please sign in to comment.