All checks were successful
Publish to PyPI Registry / publish (release) Successful in 23s
transaction.get_interchain / block.get_interchain take per_chain= and chains= kwargs mapping to prime-node's ?perChain=&chains= params. Default (no kwargs) returns one anchor per chain. Shared interchain_query() helper, exported; pytest.
23 lines
634 B
Python
23 lines
634 B
Python
"""Offline tests for the interchain-trace query builder."""
|
|
|
|
from prime_sdk import interchain_query
|
|
|
|
|
|
def test_empty_when_nothing_set():
|
|
assert interchain_query() == ""
|
|
assert interchain_query(None, None) == ""
|
|
assert interchain_query(chains=[]) == ""
|
|
|
|
|
|
def test_per_chain_including_zero():
|
|
assert interchain_query(per_chain=1) == "?perChain=1"
|
|
assert interchain_query(per_chain=0) == "?perChain=0"
|
|
|
|
|
|
def test_chains_joined_with_commas():
|
|
assert interchain_query(chains=["1", "0"]) == "?chains=1,0"
|
|
|
|
|
|
def test_combined():
|
|
assert interchain_query(per_chain=2, chains=["1", "0"]) == "?perChain=2&chains=1,0"
|