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

consolidate make-covenant functions and implement createrawtransaction with covenants #619

Closed
pinheadmz opened this issue Jul 14, 2021 · 0 comments

Comments

@pinheadmz
Copy link
Member

I think all the covenant-filling logic should be consolidated into either output.js or covenant.js and exported as library functions. Currently the best way just to find out what goes into a covenant is in the wallet make___() functions:

e.g. for OPENs:

hsd/lib/wallet/wallet.js

Lines 1613 to 1619 in 98a6491

const output = new Output();
output.address = addr;
output.value = 0;
output.covenant.type = types.OPEN;
output.covenant.pushHash(nameHash);
output.covenant.pushU32(0);
output.covenant.push(rawName);

This will make it a lot easier to write tx-building code with the hsd library, and it should also allow us to implement a JSON api like createrawtransaction where a custom combination of covenants are included.

See #465

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

No branches or pull requests

2 participants