MCPcopy Create free account
hub / github.com/canopy-network/canopy / check_tx_not_failed

Function check_tx_not_failed

plugin/python/tutorial/rpc_test.py:143–148  ·  view source on GitHub ↗

Check that a transaction is not in the failed transactions list.

(rpc_url: str, sender_addr: str)

Source from the content-addressed store, hash-verified

141
142
143def check_tx_not_failed(rpc_url: str, sender_addr: str) -> int:
144 """Check that a transaction is not in the failed transactions list."""
145 req_json = json.dumps({"address": sender_addr, "perPage": 20})
146 resp_body = post_raw_json(f"{rpc_url}/v1/query/failed-txs", req_json)
147 result = json.loads(resp_body)
148 return result.get('totalCount', 0)
149
150
151def sign_bls(private_key_hex: str, message: bytes) -> bytes:

Callers 1

test_plugin_transactionsFunction · 0.85

Calls 2

post_raw_jsonFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected