Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gp blockchain patch 5 #78

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
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
6 changes: 5 additions & 1 deletion .github/workflows/ci_integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ permissions:
jobs:
build:

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


steps:
- uses: actions/checkout@v3
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-rc4",
] # Replace with your versions

DOWNLOAD_DIR = "download"
Expand Down
15 changes: 11 additions & 4 deletions framework/test_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,34 @@ class CkbNodeConfigPath(Enum):
"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",
"download/0.120.0",
)
TESTNET = (
"source/template/ckb/v118/ckb.toml.j2",
"source/template/ckb/v118/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/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/specs/preview_dev.toml",
"download/0.119.0",
"download/0.120.0",
)

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

v119 = (
Expand Down
84 changes: 84 additions & 0 deletions test_cases/issue/test_4698.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
import pytest

from framework.basic import CkbTest


class Test4698(CkbTest):

@classmethod
def setup_class(cls):
"""
1. start 1 ckb node in tmp/feature/TestTxPoolAccept/node1 dir
2. miner 200 block
Returns:

"""
cls.node = cls.CkbNode.init_dev_by_port(
cls.CkbNodeConfigPath.CURRENT_TEST,
"feature/TestTxPoolAccept/node1",
8114,
8225,
)
cls.node.prepare(other_ckb_config={"ckb_tx_pool_max_tx_pool_size": "4640"})
cls.node.start()
cls.Miner.make_tip_height_number(cls.node, 200)

@classmethod
def teardown_class(cls):
"""
1. stop ckb node
2. clean ckb node tmp dir
Returns:

"""
print("\nTeardown TestClass1")
cls.node.stop()
cls.node.clean()

def setup_method(self, method):
"""
1. clear tx pool setup for testcases
Args:
method:

Returns:

"""
self.node.getClient().clear_tx_pool()

def test_4698(self):
"""
1. RPC send_transaction should not include stack trace in the RPC response
Returns:

"""
account = self.Ckb_cli.util_key_info_by_private_key(
self.Config.ACCOUNT_PRIVATE_1
)
father_tx_hash = self.Ckb_cli.wallet_transfer_by_private_key(
self.Config.ACCOUNT_PRIVATE_1,
account["address"]["testnet"],
100000,
self.node.getClient().url,
"1500000",
)

tx = self.Tx.build_send_transfer_self_tx_with_input(
[father_tx_hash],
["0x0"],
self.Config.ACCOUNT_PRIVATE_1,
output_count=15,
fee=15000,
api_url=self.node.getClient().url,
)
tx_hash = self.node.getClient().send_transaction(tx)
# 1. remove tx from tx pool
self.node.getClient().remove_transaction(tx_hash)
tx["witnesses"][0] = "0x00"
with pytest.raises(Exception) as exc_info:
tx_hash = self.node.getClient().send_transaction(tx)
# 2. use error witness check transaction can not send success,and RPC send_transaction should not include stack trace in the RPC response
expected_error_message = "Stack backtrace"
assert (
expected_error_message not in exc_info.value.args[0]
), f"Expected substring '{expected_error_message}' not found in actual string '{exc_info.value.args[0]}'"
Loading