Skip to content

Commit

Permalink
Update query.py (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
crosschainer authored Apr 23, 2024
1 parent 334711b commit 4725fbf
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/xian/methods/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,17 @@ def query(self, req) -> ResponseQuery:

# http://localhost:26657/abci_query?path="/contract/con_some_contract"
if path_parts[0] == "contract":
self.client.raw_driver.flush_cache()
result = self.client.raw_driver.get_contract(path_parts[1])

# http://localhost:26657/abci_query?path="/contract_methods/con_some_contract"
if path_parts[0] == "contract_methods":
self.client.raw_driver.flush_cache()

contract_code = self.client.raw_driver.get_contract(path_parts[1])
if contract_code is not None:
funcs = parser.methods_for_contract(contract_code)
result = {"methods": funcs}

# http://localhost:26657/abci_query?path="/contract_vars/con_some_contract"
if path_parts[0] == "contract_vars":
self.client.raw_driver.flush_cache()

contract_code = self.client.raw_driver.get_contract(path_parts[1])
if contract_code is not None:
result = parser.variables_for_contract(contract_code)
Expand Down

0 comments on commit 4725fbf

Please sign in to comment.