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 for commitment transaction #26

Closed
contrun opened this issue May 27, 2024 · 0 comments · Fixed by #39
Closed

Add unit test for commitment transaction #26

contrun opened this issue May 27, 2024 · 0 comments · Fixed by #39

Comments

@contrun
Copy link
Collaborator

contrun commented May 27, 2024

Currently we use the code https://github.com/contrun/ckb-pcn-node/blob/e62bf994c2b0c7abfc368f3662172f97ee12f17e/src/ckb/channel.rs#L2513-L2515 to generate a valid funding tx, and the code https://github.com/contrun/ckb-pcn-node/blob/e62bf994c2b0c7abfc368f3662172f97ee12f17e/src/ckb/channel.rs#L2148-L2150 to create a revocation transaction from an old commitment transaction. We verify the validity of the resulting revocation transaction in https://github.com/contrun/ckb-pcn-node/blob/e62bf994c2b0c7abfc368f3662172f97ee12f17e/src/ckb/channel.rs#L2258-L2262 . These lines of code should be converted into a unit test. We need to first complete to implementation of mock ckb_chain actor https://github.com/contrun/ckb-pcn-node/blob/e62bf994c2b0c7abfc368f3662172f97ee12f17e/src/ckb_chain/actor.rs#L216-L242 so that it can respond to Fund, Sign and TraceTx requests in https://github.com/contrun/ckb-pcn-node/blob/e62bf994c2b0c7abfc368f3662172f97ee12f17e/src/ckb_chain/actor.rs#L30-L40 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant