Skip to content

Commit b4bfa78

Browse files
chore: fix mypy findings in scval decoding and the server fixture
1 parent e67a8c1 commit b4bfa78

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

src/komet_node/scval.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,8 @@ def scvalue_from_xdr(xdr: SCVal) -> SCValue:
253253

254254
case SCValType.SCV_VEC:
255255
assert xdr.vec is not None
256-
return SCVec(tuple(scvalue_from_xdr(v) for v in xdr.vec.sc_vec))
256+
# komet annotates SCVec.val as tuple[SCValue] instead of tuple[SCValue, ...]
257+
return SCVec(tuple(scvalue_from_xdr(v) for v in xdr.vec.sc_vec)) # type: ignore[arg-type]
257258

258259
case SCValType.SCV_MAP:
259260
assert xdr.map is not None

src/tests/integration/test_server.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@
88
import time
99
import urllib.request
1010
from pathlib import Path
11-
from typing import Any
11+
from typing import TYPE_CHECKING, Any
1212

1313
import pytest
1414
from stellar_sdk import Account, Address, Keypair, Network, StrKey, TransactionBuilder, xdr
1515
from stellar_sdk.xdr.sc_val_type import SCValType
1616

1717
from komet_node.server import StellarRpcServer
1818

19+
if TYPE_CHECKING:
20+
from collections.abc import Iterator
21+
1922
EMPTY_CONTRACT_WAT = (Path(__file__).parent / 'data' / 'wasm' / 'empty.wat').resolve(strict=True)
2023
ARGS_CONTRACT_WAT = (Path(__file__).parent / 'data' / 'wasm' / 'args.wat').resolve(strict=True)
2124
ADDER_CONTRACT_WAT = (Path(__file__).parent / 'data' / 'wasm' / 'adder.wat').resolve(strict=True)
@@ -60,7 +63,7 @@ def _post(port: int, body: bytes) -> dict[str, Any]:
6063

6164

6265
@pytest.fixture
63-
def server(tmp_path: Path):
66+
def server(tmp_path: Path) -> Iterator[StellarRpcServer]:
6467
port = _find_free_port()
6568
srv = StellarRpcServer(
6669
host='localhost',

0 commit comments

Comments
 (0)