Skip to content

Commit

Permalink
fix: remove the hardcoding of localnet (#254)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasmatt authored Sep 22, 2023
1 parent 9a20cb5 commit ffc71ce
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pysdk/jsonrpc/jsonrpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def ok(self) -> bool:

def do_jsonrpc_request(
data: Union[JsonRPCRequest, RawJsonRPCRequest],
endpoint: str = "http://localhost:26657",
endpoint: str,
headers: Dict[str, str] = {"Content-Type": "application/json"},
) -> JsonRPCResponse:
return JsonRPCResponse.from_raw_dict(
Expand All @@ -233,7 +233,7 @@ def do_jsonrpc_request(

def do_jsonrpc_request_raw(
data: Union[JsonRPCRequest, RawJsonRPCRequest],
endpoint: str = "http://localhost:26657",
endpoint: str,
headers: Dict[str, str] = {"Content-Type": "application/json"},
) -> RawJsonRPCResponse:
if isinstance(data, dict):
Expand Down
2 changes: 1 addition & 1 deletion pysdk/tmrpc/broadcast_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,6 @@ def test_do_BroadcastTxSync():
)

jsonrpc_resp: jsonrpc.JsonRPCResponse = jsonrpc.do_jsonrpc_request(
data=jsonrpc_req,
data=jsonrpc_req, endpoint=sdk_val.network.tendermint_rpc_endpoint
)
assert jsonrpc_resp.ok()
4 changes: 3 additions & 1 deletion pysdk/tx.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,9 @@ def _broadcast_tx_jsonrpc(
tx_raw_bytes=tx_raw_bytes,
id=420,
)
return jsonrpc.jsonrpc.do_jsonrpc_request(data=jsonrpc_req)
return jsonrpc.jsonrpc.do_jsonrpc_request(
data=jsonrpc_req, endpoint=self.network.tendermint_rpc_endpoint
)

def _broadcast_tx_grpc(
self,
Expand Down

0 comments on commit ffc71ce

Please sign in to comment.