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

Add unit test to check the validitiy of commitment transaction #39

Merged
merged 30 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
9173959
Create a mock chain actor to validate transactions
contrun Jun 4, 2024
62b8507
Add more state to the mock chain actor
contrun Jun 4, 2024
34317e4
Add a unit test to create a channel
contrun Jun 4, 2024
f5d662c
Fix obtaining temp channel id instead of final one
contrun Jun 4, 2024
ab05f76
Correctly assemble funding tx
contrun Jun 4, 2024
0bb0eb4
Add dummy secp256k1 lock in mock environment
contrun Jun 4, 2024
ef3546d
Update comments for mock chain actor
contrun Jun 4, 2024
5ad144a
Use mock chain actor instead of hard-coded funding tx generation
contrun Jun 4, 2024
93a5a1c
Remove hard-coded commitment transaction verification
contrun Jun 4, 2024
3b25604
Refine channel ready checking conditions
contrun Jun 4, 2024
cea633f
Emit peer CommitmentSigned event for later use
contrun Jun 4, 2024
2ee4632
Emit CommitmentSignaturePending event
contrun Jun 4, 2024
14b4ddf
Correctly save tx from SendTx to mock context
contrun Jun 4, 2024
6c1a566
Verify that we can spend the commitment transaction
contrun Jun 4, 2024
2bf084f
Put testing helper MockContext behind cfg(test)
contrun Jun 4, 2024
a463b41
Remove singleton for get contract info
contrun Jun 4, 2024
fe9aba7
Make CommtimentLockContext less verbose
contrun Jun 4, 2024
6fead8f
Use deterministic rng for mock environment
contrun Jun 4, 2024
dd8fb99
Refine debug messages
contrun Jun 4, 2024
eb4bbdd
Fix setting incorrect commitment tx witness
contrun Jun 4, 2024
167f72c
Refactor shutdown tx creation
contrun Jun 4, 2024
a82315f
Remove a few logs
contrun Jun 4, 2024
4dad1f8
Remove outdated test case
contrun Jun 4, 2024
aadbacc
Remove unused code
contrun Jun 4, 2024
d65cf3d
Update outdated comment
contrun Jun 4, 2024
6384fbb
Move ckb-testtool to dev dependencies
contrun Jun 4, 2024
9037cc4
Move functions to obtain contract scripts/cell_deps to ckb_chain
contrun Jun 4, 2024
48e7ec7
Add more tests to mock ckb chain actor
contrun Jun 4, 2024
5d1bb6e
Add test mock context determinisim
contrun Jun 4, 2024
fdd6af7
Remove outdated code
contrun Jun 4, 2024
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
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ molecule = { version = "0.7.5", default-features = false }
ckb-types = "0.114.0"
ckb-jsonrpc-types = "0.114.0"
ckb-crypto = "0.114.0"
rocksdb = { package = "ckb-rocksdb", version ="=0.21.1", features = ["snappy"], default-features = false }
rocksdb = { package = "ckb-rocksdb", version = "=0.21.1", features = [
"snappy",
], default-features = false }
serde_with = { version = "3.7.0", features = ["macros", "base64"] }
hex = "0.4.3"
tower = "0.4.13"
Expand All @@ -63,7 +65,6 @@ musig2 = { version = "0.0.11", features = ["secp256k1", "serde"] }
ractor = "0.9.7"
arcode = "0.2.4"
nom = "7.1.3"
ckb-testtool = { git = "https://github.com/contrun/capsule.git", branch = "determinisitic-rng" }

[profile.release]
panic = "abort"
Expand All @@ -73,3 +74,4 @@ panic = "abort"

[dev-dependencies]
tempfile = "3.10.1"
ckb-testtool = { git = "https://github.com/contrun/capsule.git", branch = "determinisitic-rng" }
Loading
Loading