Skip to content

Commit

Permalink
Merge branch 'v118' into gp/tx_pool_info
Browse files Browse the repository at this point in the history
  • Loading branch information
gpBlockchain authored Aug 21, 2024
2 parents bf84188 + 7311d64 commit a4c2cbe
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 26 deletions.
4 changes: 2 additions & 2 deletions framework/test_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class CkbNodeConfigPath(Enum):
)

CURRENT_MAIN = (
"source/template/ckb/v117/ckb.toml.j2",
"source/template/ckb/v117/ckb-miner.toml.j2",
"source/template/ckb/v118/ckb.toml.j2",
"source/template/ckb/v118/ckb-miner.toml.j2",
"source/template/specs/mainnet.toml.j2",
"download/0.118.0",
)
Expand Down
31 changes: 19 additions & 12 deletions test_cases/config/test_request_limit.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,30 +40,37 @@ def test_request_limit(self):
with pytest.raises(Exception) as exc_info:
self.node.getClient().get_cells(
{
"script": {"code_hash": "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8",
"hash_type": "type",
"args": "0x"},

"script": {
"code_hash": "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8",
"hash_type": "type",
"args": "0x",
},
"script_type": "lock",
"script_search_mode": "prefix"
"script_search_mode": "prefix",
},
"asc",
"0xff", None
"0xff",
None,
)
expected_error_message = "Invalid params limit must be less than 10"
assert (
expected_error_message in exc_info.value.args[0]
expected_error_message in exc_info.value.args[0]
), f"Expected substring '{expected_error_message}' not found in actual string '{exc_info.value.args[0]}'"

# 3. get_cells(len:10) => cells.length = 10
cells = self.node.getClient().get_cells(
{
"script": {"code_hash": "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8",
"hash_type": "type",
"args": "0x"},
"script": {
"code_hash": "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8",
"hash_type": "type",
"args": "0x",
},
"script_type": "lock",
"script_search_mode": "prefix"
"script_search_mode": "prefix",
},
"asc",
"0xa", None
"0xa",
None,
)
assert len(cells['objects']) == 10
assert len(cells["objects"]) == 10
20 changes: 10 additions & 10 deletions test_cases/config/test_rpc_batch_limit.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ def test_rpc_batch_limit(self):
requestBody = ""
for i in range(11):
requestBody = (
requestBody
+ """{"jsonrpc": "2.0", "method": "get_block_by_number", "params": ["0x0"],
requestBody
+ """{"jsonrpc": "2.0", "method": "get_block_by_number", "params": ["0x0"],
"id": "1"},"""
)
requestBody = requestBody[:-1]
requests = (
"""curl -X POST -H "Content-Type: application/json" -d '["""
+ str(requestBody)
+ f"""]' {self.node.rpcUrl} """
"""curl -X POST -H "Content-Type: application/json" -d '["""
+ str(requestBody)
+ f"""]' {self.node.rpcUrl} """
)
response = run_command(requests)
assert "batch size is too large, expect it less than: 10" in response
Expand All @@ -55,15 +55,15 @@ def test_rpc_batch_limit(self):
requestBody = ""
for i in range(10):
requestBody = (
requestBody
+ """{"jsonrpc": "2.0", "method": "get_block_by_number", "params": ["0x0"],
requestBody
+ """{"jsonrpc": "2.0", "method": "get_block_by_number", "params": ["0x0"],
"id": "1"},"""
)
requestBody = requestBody[:-1]
requests = (
"""curl -X POST -H "Content-Type: application/json" -d '["""
+ str(requestBody)
+ f"""]' {self.node.rpcUrl} """
"""curl -X POST -H "Content-Type: application/json" -d '["""
+ str(requestBody)
+ f"""]' {self.node.rpcUrl} """
)
response = run_command(requests)
assert "batch size is too large, expect it less than: 10" not in response
2 changes: 0 additions & 2 deletions test_cases/feature/test_get_transaction.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from framework.basic import CkbTest
import pytest


class TestGetTransaction(CkbTest):
Expand Down Expand Up @@ -32,7 +31,6 @@ def teardown_class(cls):
cls.node.stop()
cls.node.clean()

# @pytest.mark.skip("util v118")
def test_get_transaction_by_tx_index(self):
"""
1. new tx in block
Expand Down

0 comments on commit a4c2cbe

Please sign in to comment.