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 compile-time switch for Sequentia RPC definitions #1

Closed
wants to merge 3 commits into from

Conversation

JBetz
Copy link
Contributor

@JBetz JBetz commented Feb 28, 2024

Uses a compile time flag __SEQUENTIA__ for switching between Sequentia and Elements RPC definitions.

Note: The definition of sequentia::createrawtransaction hasn't been updated for the No Fee feature yet. This is more a demonstration and proof-of-concept for how we can extend the protocol without interfering with the Elements codepath.

src/rpc/rawtransaction.cpp Show resolved Hide resolved
{

static std::vector<RPCArg> CreateTxDoc()
{
Copy link

Choose a reason for hiding this comment

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

I don't get what that is and how that differs from the other ones. Good enough for now I suppose?

Copy link

Choose a reason for hiding this comment

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

But then make it a branch until it's somewhat cleaner?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a helper function for generating RPC documentation specific to createrawtransaction. I haven't changed it at all from the Elements source (yet).

Copy link
Contributor Author

@JBetz JBetz Feb 29, 2024

Choose a reason for hiding this comment

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

Oh, maybe you were asking about the entire module.

I don't get what that is and how that differs from the other ones. Good enough for now I suppose?

It's effectively a way to override static methods by importing namespace methods from a different module.

But then make it a branch until it's somewhat cleaner?

I don't think #ifdefs containing more than a few lines of code would be cleaner, and in this case it'd be a few dozen. And we're going to want to override both createrawtransaction and CreateTxDoc soon.

@JBetz JBetz requested a review from fare February 29, 2024 01:09
src/rpc/rawtransaction.cpp Outdated Show resolved Hide resolved
src/rpc/rawtransaction.cpp Outdated Show resolved Hide resolved
@Mixa84 Mixa84 changed the base branch from master to dev February 29, 2024 14:21
@JBetz JBetz marked this pull request as draft February 29, 2024 19:12
@JBetz
Copy link
Contributor Author

JBetz commented Apr 2, 2024

Closing since this will create extra work if we try to upstream to Elements, and the Elements team has already expressed interest in the No Coin feature (ElementsProject/elements#1302),.

@JBetz JBetz closed this Apr 2, 2024
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.

3 participants