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

Clean code, better documentation and comments #439

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from

Conversation

ozankaymak
Copy link
Contributor

Description

This PR introduces better documentation and code comments. Also cleans the code.

Linked Issues

#410
#431

Testing

None

Docs

This whole PR is about the docs.

@ozankaymak ozankaymak changed the base branch from main to dev January 20, 2025 15:13
Copy link

@mmtftr mmtftr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for undertaking this large task, I have some comments that might be helpful going forward.

core/src/builder/script.rs Outdated Show resolved Hide resolved
core/src/builder/script.rs Outdated Show resolved Hide resolved
core/src/builder/sighash.rs Outdated Show resolved Hide resolved
core/src/builder/sighash.rs Outdated Show resolved Hide resolved
core/src/builder/sighash.rs Outdated Show resolved Hide resolved
core/src/operator.rs Outdated Show resolved Hide resolved
@ozankaymak ozankaymak marked this pull request as ready for review January 21, 2025 14:06
@ozankaymak
Copy link
Contributor Author

I will merge this PR as it is now, and distribute the remaining tasks accordingly.

/// ≤ (`# of blocks mined after UTXO appears on the chain`). However, this is not mandatory.
/// One can spend an output delayed for some number of blocks just by using the nSequence field
/// of the input inside the transaction. For more, see:
/// https://github.com/bitcoin/bips/blob/master/bip-0068.mediawiki and
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be bullet list

pub fn generate_relative_timelock_script(
actor_taproot_xonly_pk: XOnlyPublicKey, // This is the tweaked XonlyPublicKey, which appears in the script_pubkey of the address
block_count: i64,
actor_taproot_xonly_pk: XOnlyPublicKey, // This is the tweaked XonlyPublicKey, which appears in the script_pubkey of the address. The tweaked signature will be given accordingly.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this should be in the function comment so that everyone can see this comment without locating the code

0,
Some(bitcoin::sighash::TapSighashType::SinglePlusAnyoneCanPay)
)?;

// Creates the start_happy_reimburse_tx handler.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a bit verbose imo

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 this pull request may close these issues.

4 participants