Skip to content

Commit 84be035

Browse files
author
Roman
committed
tests
1 parent 7285a6c commit 84be035

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

tests/unit_tests/test_async_subtensor.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3845,10 +3845,10 @@ async def test_get_subnet_price(subtensor, mocker):
38453845
# preps
38463846
netuid = 123
38473847
mocked_determine_block_hash = mocker.patch.object(subtensor, "determine_block_hash")
3848-
fake_price = {"bits": 3155343338053956962}
3848+
fake_price = 29258617
38493849
expected_price = Balance.from_tao(0.029258617)
38503850
mocked_query = mocker.patch.object(
3851-
subtensor.substrate, "query", return_value=fake_price
3851+
subtensor.substrate, "runtime_call", return_value=mocker.Mock(value=fake_price)
38523852
)
38533853

38543854
# Call
@@ -3857,10 +3857,10 @@ async def test_get_subnet_price(subtensor, mocker):
38573857
)
38583858

38593859
# Asserts
3860-
mocked_determine_block_hash.assert_awaited_once_with(block=None)
3860+
mocked_determine_block_hash.assert_awaited_once()
38613861
mocked_query.assert_awaited_once_with(
3862-
module="Swap",
3863-
storage_function="AlphaSqrtPrice",
3862+
api="SwapRuntimeApi",
3863+
method="current_alpha_price",
38643864
params=[netuid],
38653865
block_hash=mocked_determine_block_hash.return_value,
38663866
)

tests/unit_tests/test_subtensor.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4056,10 +4056,10 @@ def test_get_subnet_price(subtensor, mocker):
40564056
# preps
40574057
netuid = 123
40584058
mocked_determine_block_hash = mocker.patch.object(subtensor, "determine_block_hash")
4059-
fake_price = {"bits": 3155343338053956962}
4059+
fake_price = 29258617
40604060
expected_price = Balance.from_tao(0.029258617)
40614061
mocked_query = mocker.patch.object(
4062-
subtensor.substrate, "query", return_value=fake_price
4062+
subtensor.substrate, "runtime_call", return_value=mocker.Mock(value=fake_price)
40634063
)
40644064

40654065
# Call
@@ -4070,8 +4070,8 @@ def test_get_subnet_price(subtensor, mocker):
40704070
# Asserts
40714071
mocked_determine_block_hash.assert_called_once_with(block=None)
40724072
mocked_query.assert_called_once_with(
4073-
module="Swap",
4074-
storage_function="AlphaSqrtPrice",
4073+
api="SwapRuntimeApi",
4074+
method="current_alpha_price",
40754075
params=[netuid],
40764076
block_hash=mocked_determine_block_hash.return_value,
40774077
)

0 commit comments

Comments
 (0)