Skip to content

Commit 2caab98

Browse files
committed
fix: ai feedback
Signed-off-by: exploreriii <133720349+exploreriii@users.noreply.github.com>
1 parent f9b8bf2 commit 2caab98

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

tests/tck/contract_handler_test.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import pytest
66

7-
from tck.errors import JsonRpcError
7+
from tck.errors import INVALID_PARAMS, JsonRpcError
88
from tck.handlers import contract as contract_handlers
99
from tck.param.contract import CreateContractParams
1010

@@ -29,12 +29,16 @@ def test_bytecode_file_id_wins_when_both_sources_supplied(self):
2929
def test_invalid_gas_raises_invalid_params(self):
3030
params = CreateContractParams(sessionId="session-1", gas="not-a-number")
3131

32-
with pytest.raises(JsonRpcError):
32+
with pytest.raises(JsonRpcError) as excinfo:
3333
contract_handlers._build_create_contract_transaction(params)
3434

35+
assert excinfo.value.code == INVALID_PARAMS
36+
3537
@pytest.mark.parametrize("gas", ["9223372036854775808", "-9223372036854775809"])
3638
def test_gas_out_of_int64_range_raises_invalid_params(self, gas):
3739
params = CreateContractParams(sessionId="session-1", gas=gas)
3840

39-
with pytest.raises(JsonRpcError):
41+
with pytest.raises(JsonRpcError) as excinfo:
4042
contract_handlers._build_create_contract_transaction(params)
43+
44+
assert excinfo.value.code == INVALID_PARAMS

0 commit comments

Comments
 (0)