Skip to content

Commit

Permalink
fix: allow to set custom backends via a dictionary (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
yruej301 authored Sep 29, 2023
1 parent a40c289 commit 4e7e553
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions vertex_protocol/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,17 @@ def create_vertex_client(
)

if context_opts:
engine_endpoint_url = context_opts.engine_endpoint_url or engine_endpoint_url
indexer_endpoint_url = context_opts.indexer_endpoint_url or indexer_endpoint_url
rpc_node_url = context_opts.rpc_node_url or rpc_node_url
contracts_context = context_opts.contracts_context or contracts_context
parsed_context_opts: VertexClientContextOpts = (
VertexClientContextOpts.parse_obj(context_opts)
)
engine_endpoint_url = (
parsed_context_opts.engine_endpoint_url or engine_endpoint_url
)
indexer_endpoint_url = (
parsed_context_opts.indexer_endpoint_url or indexer_endpoint_url
)
rpc_node_url = parsed_context_opts.rpc_node_url or rpc_node_url
contracts_context = parsed_context_opts.contracts_context or contracts_context

context = create_vertex_client_context(
VertexClientContextOpts(
Expand Down

0 comments on commit 4e7e553

Please sign in to comment.