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

PSBT file refactoring #1993

Open
jasonandjay opened this issue Oct 14, 2023 · 2 comments
Open

PSBT file refactoring #1993

jasonandjay opened this issue Oct 14, 2023 · 2 comments
Labels

Comments

@jasonandjay
Copy link
Collaborator

Background: The PSBT file contains over 2200 lines of code, too many for readers or maintainers.
I think it's necessary to refactor it. Do we have plans to separate bip371 from bitcoinjs-lib? Maybe deep dependencies with the taproot are not easily detachable.
Another way to handle this situation is to simply split psbt into psbt_interface, psbt_helper and psbt_transaction under the ts_src/psbt folder.

I prefer the last solution, other suggestions are welcome.

@junderw
Copy link
Member

junderw commented Oct 14, 2023

  1. I feel like we have a lot of things that aren't publicly exposed that are almost necessary to use taproot. A big smell in that area is the fact that we use a lot of submodule imports in the taproot integration test... In theory integration tests should only use public facing API of the library, but we break that rule often. So some of these functions should be made public. Not sure if that warrants a separate library, but definitely a separate module.
  2. Psbt split into multiple files seems OK. Whatever makes sense. Getting it fully documented is higher priority though, but if refactoring makes that easier then by all means.

@jasonandjay
Copy link
Collaborator Author

I agree, so we can make a TODO

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

No branches or pull requests

3 participants
@jasonandjay @junderw and others