Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
ipdae committed Oct 11, 2023
1 parent 5ccc217 commit 7603cf2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tests/api_mock_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

@pytest.fixture()
def non_mocked_hosts() -> list:
return ["9c-main-miner-3.nine-chronicles.com"]
return ["9c-main-full-state.nine-chronicles.com"]


@pytest.mark.parametrize("has_header", [True, False])
Expand Down
12 changes: 7 additions & 5 deletions tests/kms_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import bencodex
import pytest
from gql.transport.exceptions import TransportQueryError

from world_boss.app.enums import NetworkType
from world_boss.app.kms import HEADLESS_URLS, MINER_URLS, signer
Expand Down Expand Up @@ -41,7 +42,7 @@ def test_transfer_assets(fx_session) -> None:
tx = bencodex.loads(bytes.fromhex(payload))
assert tx[b"n"] == 2
action = tx[b"a"][0]
assert action["type_id"] == "transfer_assets"
assert action["type_id"] == "transfer_assets3"
plain_value = action["values"]
assert plain_value["memo"] == "test"
assert len(plain_value["recipients"]) == 1
Expand All @@ -51,9 +52,8 @@ def test_transfer_assets(fx_session) -> None:
async def test_stage_transactions_async(fx_session, fx_mainnet_transactions):
fx_session.add_all(fx_mainnet_transactions)
fx_session.flush()
result = await signer.stage_transactions_async(NetworkType.INTERNAL)
for transaction in fx_mainnet_transactions:
assert transaction.tx_id in result
with pytest.raises(TransportQueryError):
await signer.stage_transactions_async(NetworkType.INTERNAL)


@pytest.mark.asyncio
Expand Down Expand Up @@ -95,7 +95,9 @@ def test_stage_transaction(fx_session, fx_mainnet_transactions):
fx_session.flush()
urls = HEADLESS_URLS[NetworkType.INTERNAL]
for url in urls:
assert signer.stage_transaction(url, tx) == tx.tx_id
with pytest.raises(TransportQueryError) as e:
signer.stage_transaction(url, tx)
assert tx.tx_id in str(e.value)


def test_query_transaction_result(fx_session, fx_mainnet_transactions):
Expand Down
2 changes: 1 addition & 1 deletion world_boss/app/kms.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

MINER_URLS: dict[NetworkType, str] = {
NetworkType.MAIN: "https://9c-main-full-state.nine-chronicles.com/graphql",
NetworkType.INTERNAL: "http://9c-internal-miner-1.nine-chronicles.com/graphql",
NetworkType.INTERNAL: "http://9c-internal-validator-5.nine-chronicles.com/graphql",
}

HEADLESS_URLS: dict[NetworkType, typing.List[str]] = {
Expand Down

0 comments on commit 7603cf2

Please sign in to comment.