Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
e7fc4ee
Update download.py
gpBlockchain Jun 9, 2025
b40cbcf
Update test_node.py
gpBlockchain Jun 9, 2025
b9f2009
add test for listen 2address
gpBlockchain Jun 9, 2025
822a7c9
add exec and spawn test
gpBlockchain Jun 9, 2025
ab97878
compare cycle vs 200
gpBlockchain Jun 9, 2025
18dce10
fix path not found
gpBlockchain Jun 10, 2025
9637fa3
black code
gpBlockchain Jun 10, 2025
64d9ef1
fix contract call err
gpBlockchain Jun 10, 2025
fc3882d
format code
gpBlockchain Jun 10, 2025
3c9c4c6
Update download.py
gpBlockchain Jun 12, 2025
b0ffc9a
update light-client main branch
gpBlockchain Jun 12, 2025
584d7f9
update ckb-light version
gpBlockchain Jun 19, 2025
49633d3
update light client download url
gpBlockchain Jun 19, 2025
eb8704a
support docker
gpBlockchain Sep 4, 2025
82e48fd
fix docker
gpBlockchain Sep 5, 2025
f2dab3f
fix ci for docker
gpBlockchain Sep 8, 2025
834dd17
update 203
gpBlockchain Sep 29, 2025
e2d2a4b
Remove 'replace_rpc' from test cases
gpBlockchain Sep 30, 2025
53a4662
update cli
gpBlockchain Sep 30, 2025
206328a
update makefile
gpBlockchain Oct 9, 2025
36d4d30
update light client
gpBlockchain Oct 9, 2025
d22f45d
Merge branch 'gp/light-client-main' into v203
gpBlockchain Oct 9, 2025
7734b5d
update test
gpBlockchain Oct 12, 2025
e8227da
format code
gpBlockchain Oct 12, 2025
9a58ee0
remove exception_use_old_ckb
gpBlockchain Oct 12, 2025
58409c1
update ckb-cli
gpBlockchain Oct 12, 2025
ac90f85
update 203
gpBlockchain Oct 13, 2025
9f5a517
fix ckb download
gpBlockchain Oct 13, 2025
4c9cf28
update light-client
gpBlockchain Oct 13, 2025
c2257f7
remove ckb 110 for light-client
gpBlockchain Oct 13, 2025
85ad7ef
Merge branch 'gp/203' into v203
gpBlockchain Oct 13, 2025
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
59 changes: 59 additions & 0 deletions .github/workflows/ci_integration_tests_docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: ci_integration_tests_docker

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

permissions:
contents: read

jobs:
build:

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

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


steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi

- name: Install dependencies
run: make prepare

- name: Run tests
run: make test
env:
DOCKER: true
DOCKER_CKB_VERSION: "nervos/ckb:v0.202.0-rc1"

#
#DOCKER = os.getenv('DOCKER',False)
#DOCKER_CKB_VERSION = os.getenv('DOCKER_CKB_VERSION',"nervos/ckb:v0.202.0-rc1")
# - name: Setup upterm session
# if: always()
# uses: lhotari/action-upterm@v1

- name: Publish reports
if: failure()
uses: actions/upload-artifact@v4
with:
name: jfoa-build-reports-${{ runner.os }}
path: ./report
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ tmp
download
pytest.ini
reprot
__pycache__
pid.txt
.idea
venv
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ prepare:
python3 -m download_ckb_light_client
echo "install ckb cli"
sh prepare.sh

develop_prepare:
python3 -m venv venv
. venv/bin/activate
Expand All @@ -22,11 +23,10 @@ develop_prepare:
python3 -m download_ckb_light_client
echo "install ckb cli"
bash develop_prepare.sh
# test_cases/ckb2023 \

test_cases := \
test_cases/replace_rpc \
test_cases/ckb_cli \
test_cases/ckb2023 \
test_cases/contracts \
test_cases/example \
test_cases/framework \
Expand Down
14 changes: 1 addition & 13 deletions download.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,10 @@
from tqdm import tqdm

versions = [
"0.109.0",
"0.110.2",
"0.111.0",
"0.112.1",
"0.113.1",
"0.114.0",
"0.115.0",
"0.116.1",
"0.117.0",
"0.118.0",
"0.119.0",
"0.120.0",
"0.121.0",
"0.200.0",
"0.201.0",
"0.202.0",
"0.203.0-rc1",
] # Replace with your versions

DOWNLOAD_DIR = "download"
Expand Down
10 changes: 1 addition & 9 deletions download_ckb_light_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,8 @@


versions = [
"0.2.4",
"0.3.0",
"0.3.1",
"0.3.2",
"0.3.3",
"0.3.4",
"0.3.5",
"0.3.6",
"0.4.1",
"0.5.0",
"0.5.3",
] # Replace with your versions

DOWNLOAD_DIR = "download"
Expand Down
6 changes: 6 additions & 0 deletions framework/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import framework.test_cluster
import framework.config
import shutil

from framework.test_node import DOCKER
from framework.util import get_project_root


Expand Down Expand Up @@ -56,3 +58,7 @@ def teardown_method(self, method):
f"{get_project_root()}/tmp",
f"{get_project_root()}/report/{method.__name__}",
)

@staticmethod
def skip_docker():
return DOCKER
30 changes: 1 addition & 29 deletions framework/helper/ckb_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,6 @@
cli_path = f"cd {get_project_root()}/source && ./ckb-cli"


def exception_use_old_ckb():
def decorator(func):
@wraps(func)
def wrapper(*args, **kwargs):
try:
return func(*args, **kwargs)
except Exception as e:
if "SoftFork" in str(e):
global cli_path
cli_path = f"cd {get_project_root()}/source && ./ckb-cli-old"
print("------ change use old ckb-cli -------")
try:
ret = func(*args, **kwargs)
cli_path = f"cd {get_project_root()}/source && ./ckb-cli"
return ret
except Exception as e:
cli_path = f"cd {get_project_root()}/source && ./ckb-cli"
raise e
else:
raise e

return wrapper

return decorator


@exception_use_old_ckb()
def wallet_get_capacity(ckb_address, api_url="http://127.0.0.1:8114"):
"""
MacBook-Pro-4 0.111.0 % ./ckb-cli wallet get-capacity
Expand Down Expand Up @@ -67,7 +40,6 @@ def wallet_get_capacity(ckb_address, api_url="http://127.0.0.1:8114"):
Exception(f"Number not found :{capacity_response}")


@exception_use_old_ckb()
def wallet_get_live_cells(ckb_address, api_url="http://127.0.0.1:8114"):
"""
./ckb-cli wallet get-live-cells --address
Expand Down Expand Up @@ -132,7 +104,6 @@ def wallet_get_live_cells(ckb_address, api_url="http://127.0.0.1:8114"):
return json.loads(run_command(cmd))


@exception_use_old_ckb()
def wallet_transfer_by_private_key(
private_key,
to_ckb_address,
Expand Down Expand Up @@ -642,6 +613,7 @@ def get_deploy_toml_config(account_private, contract_bin_path, enable_type_id):

[[dep_groups]]
name = "my_dep_group"
enable_type_id = {str(enable_type_id).lower()}
cells = []

[lock]
Expand Down
4 changes: 0 additions & 4 deletions framework/helper/contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ def get_arg_and_data(self, key) -> (str, str):
pass


@exception_use_old_ckb()
def deploy_ckb_contract(
private_key,
contract_path,
Expand Down Expand Up @@ -79,7 +78,6 @@ def deploy_ckb_contract(
return run_command(cmd).replace("\n", "")


@exception_use_old_ckb()
def get_ckb_contract_codehash(
tx_hash, tx_index, enable_type_id=True, api_url="http://127.0.0.1:8114"
):
Expand Down Expand Up @@ -110,7 +108,6 @@ def get_ckb_contract_codehash(
return f"0x{hex_digest}"


@exception_use_old_ckb()
def invoke_ckb_contract(
account_private,
contract_out_point_tx_hash,
Expand Down Expand Up @@ -260,7 +257,6 @@ def invoke_ckb_contract(
return tx_send(tmp_tx_file, api_url).strip()


@exception_use_old_ckb()
def build_invoke_ckb_contract(
account_private,
contract_out_point_tx_hash,
Expand Down
40 changes: 1 addition & 39 deletions framework/test_light_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,52 +6,14 @@


class CkbLightClientConfigPath(Enum):
V0_2_4 = (
"source/template/ckb_light_client/0.2.4/testnet.toml.j2",
"download/0.2.4/ckb-light-client",
)
V0_3_0 = (
"source/template/ckb_light_client/0.3.0/testnet.toml.j2",
"download/0.3.0/ckb-light-client",
)
V0_3_1 = (
"source/template/ckb_light_client/0.3.0/testnet.toml.j2",
"download/0.3.1/ckb-light-client",
)
V0_3_2 = (
"source/template/ckb_light_client/0.3.0/testnet.toml.j2",
"download/0.3.2/ckb-light-client",
)
V0_3_3 = (
"source/template/ckb_light_client/0.3.0/testnet.toml.j2",
"download/0.3.3/ckb-light-client",
)
V0_3_4 = (
"source/template/ckb_light_client/0.3.0/testnet.toml.j2",
"download/0.3.4/ckb-light-client",
)
V0_3_5 = (
"source/template/ckb_light_client/0.3.0/testnet.toml.j2",
"download/0.3.5/ckb-light-client",
)
V0_3_6 = (
"source/template/ckb_light_client/0.3.0/testnet.toml.j2",
"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",
)

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

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

def __init__(self, ckb_light_client_config_path, ckb_light_bin_path):
Expand Down
Loading
Loading