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

Migrate FeeRate to procedural macros #693

Merged

Conversation

thunderbiscuit
Copy link
Member

@thunderbiscuit thunderbiscuit commented Mar 11, 2025

This PR simply migrates the FeeRate type to procedural macros. Notice that because it is used in the UDL more places than simply its definition, we must keep a single line indicating its definition in proc macros.

These lines can be removed once no reference to the FeeRate type are required in the UDL (for example once we migrate the Wallet type).

I also fixed here the arguments to both constructors of the FeeRate type to bring them in line with the Rust API.

Checklists

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo fmt and cargo clippy before committing

@@ -1469,19 +1469,7 @@ interface Amount {
f64 to_btc();
};

interface FeeRate {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we have sort of policy when migrating to proc macros, if a type did not have documentation defined, a second commit introduces docs too? Seems like a good opportunity to get those out of the way

Copy link
Member Author

Choose a reason for hiding this comment

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

I think that's a great idea.

Copy link
Collaborator

@reez reez left a comment

Choose a reason for hiding this comment

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

ACK 5fd3c71

Just add docs in bitcoin.rs as planned before merge

@thunderbiscuit thunderbiscuit merged commit 74761d0 into bitcoindevkit:master Mar 25, 2025
26 checks passed
@thunderbiscuit thunderbiscuit deleted the feature/macros-2 branch March 25, 2025 00:27
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