Skip to content
Merged

V120 #77

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/ci_integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ permissions:
jobs:
build:

runs-on: ubuntu-22.04
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04]

# os: [ubuntu-22.04, macos-latest]


steps:
- uses: actions/checkout@v3
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ test_cases := \
test_cases/feature \
test_cases/config \
test_cases/miner \
test_cases/get_fee_rate_statistics
test_cases/get_fee_rate_statistics \
test_cases/ws


test:
Expand Down
1 change: 1 addition & 0 deletions download.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"0.117.0",
"0.118.0",
"0.119.0",
"0.120.0",
] # Replace with your versions

DOWNLOAD_DIR = "download"
Expand Down
1 change: 1 addition & 0 deletions download_ckb_light_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"0.3.4",
"0.3.5",
"0.3.6",
"0.4.1",
] # Replace with your versions

DOWNLOAD_DIR = "download"
Expand Down
7 changes: 6 additions & 1 deletion framework/test_light_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,14 @@ class CkbLightClientConfigPath(Enum):
"download/0.3.6/ckb-light-client",
)

V0_4_1 = (
"source/template/ckb_light_client/0.3.0/testnet.toml.j2",
"download/0.4.2/ckb-light-client",
)

CURRENT_TEST = (
"source/template/ckb_light_client/0.3.0/testnet.toml.j2",
"download/0.3.6/ckb-light-client",
"download/0.4.1/ckb-light-client",
)

def __init__(self, ckb_light_client_config_path, ckb_light_bin_path):
Expand Down
53 changes: 40 additions & 13 deletions framework/test_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,37 @@

class CkbNodeConfigPath(Enum):
CURRENT_TEST = (
"source/template/ckb/v118/ckb.toml.j2",
"source/template/ckb/v118/ckb-miner.toml.j2",
"source/template/ckb/v118/specs/dev.toml",
"download/0.119.0",
"source/template/ckb/v120/ckb.toml.j2",
"source/template/ckb/v120/ckb-miner.toml.j2",
"source/template/ckb/v120/specs/dev.toml",
"download/0.120.0",
)
TESTNET = (
"source/template/ckb/v118/ckb.toml.j2",
"source/template/ckb/v118/ckb-miner.toml.j2",
"source/template/ckb/v120/ckb.toml.j2",
"source/template/ckb/v120/ckb-miner.toml.j2",
"source/template/specs/testnet.toml.j2",
"download/0.119.0",
"download/0.120.0",
)

CURRENT_MAIN = (
"source/template/ckb/v118/ckb.toml.j2",
"source/template/ckb/v118/ckb-miner.toml.j2",
"source/template/ckb/v120/ckb.toml.j2",
"source/template/ckb/v120/ckb-miner.toml.j2",
"source/template/specs/mainnet.toml.j2",
"download/0.119.0",
"download/0.120.0",
)

PREVIEW_DUMMY = (
"source/template/ckb/v118/ckb.toml.j2",
"source/template/ckb/v118/ckb-miner.toml.j2",
"source/template/ckb/v120/ckb.toml.j2",
"source/template/ckb/v120/ckb-miner.toml.j2",
"source/template/specs/preview_dev.toml",
"download/0.119.0",
"download/0.120.0",
)

v120 = (
"source/template/ckb/v120/ckb.toml.j2",
"source/template/ckb/v120/ckb-miner.toml.j2",
"source/template/ckb/v120/specs/dev.toml",
"download/0.120.0",
)

v119 = (
Expand Down Expand Up @@ -211,6 +218,22 @@ def connected(self, node):
peer_address = node.get_peer_address()
print("add node response:", self.getClient().add_node(peer_id, peer_address))

def connected_ws(self, node):
peer_id = node.get_peer_id()
peer_address = node.get_peer_address()
if "ws" not in peer_address:
peer_address = peer_address + "/ws"
print("add node response:", self.getClient().add_node(peer_id, peer_address))

def connected_all_address(self, node):
peer_id = node.get_peer_id()
node_info = node.client.local_node_info()
for address in node_info["addresses"]:
peer_address = address["address"].replace("0.0.0.0", "127.0.0.1")
print(
"add node response:", self.getClient().add_node(peer_id, peer_address)
)

def getClient(self) -> RPCClient:
return self.client

Expand Down Expand Up @@ -262,6 +285,9 @@ def stop(self):
self.ckb_pid = -1
time.sleep(3)

def rmLockFile(self):
run_command(f"cd {self.ckb_dir} && rm -rf data/db/LOCK")

def prepare(
self,
other_ckb_config={},
Expand Down Expand Up @@ -365,6 +391,7 @@ def subscribe_telnet(self, topic, other_url=None) -> telnetlib.Telnet:
+ topic
+ '"]}'
)
print(f"host:{host},port:{port},topic_str:{topic_str}")
tn.write(topic_str.encode("utf-8") + b"\n")
data = tn.read_until(b"}\n")
if data:
Expand Down
Binary file modified source/contract/test_cases/exec_with_exec
Binary file not shown.
45 changes: 45 additions & 0 deletions source/template/ckb/v120/ckb-miner.toml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Config generated by `ckb init --chain dev`

data_dir = "{{ ckb_miner_data_dir | default(ckb_data_dir) }}"

[chain]
{# Choose the kind of chains to run, possible values: #}
{# - { file = "specs/dev.toml" } #}
{# - { bundled = "specs/testnet.toml" } #}
{# - { bundled = "specs/mainnet.toml" } #}
spec = {{ ckb_chain_spec }}


[logger]
filter = "{{ ckb_miner_logger_filter | default("info") }}"
color = {{ ckb_miner_logger_color | default("true") }}
log_to_file = {{ ckb_miner_logger_log_to_file | default("true") }}
log_to_stdout = {{ ckb_miner_logger_log_to_stdout | default("true") }}

[sentry]
# set to blank to disable sentry error collection
dsn = "{{ ckb_miner_sentry_dsn | default("") }}"
# if you are willing to help us to improve,
# please leave a way to contact you when we have troubles to reproduce the errors.
# org_contact = "{{ ckb_miner_sentry_org_contact | default() }}"

[miner.client]
rpc_url = "http://{{ ckb_miner_rpc_url | default("127.0.0.1:8114") }}"
block_on_submit = {{ ckb_miner_block_on_submit | default("true") }}

# block template polling interval in milliseconds
poll_interval = {{ ckb_miner_poll_interval | default("1000") }}

#{% if ckb_miner_workers is defined %}
# {% for worker in ckb_miner_workers %}
# [[miner.workers]]
# worker_type = "{{ worker.worker_type }}"
# delay_type = "{{ worker.delay_type }}"
# value = {{ worker.value }}
# {% endfor %}
#{% else %}
[[miner.workers]]
worker_type = "Dummy"
delay_type = "Constant"
value = 1000
#{% endif %}
Loading
Loading