Skip to content

msggen: new rust types for sat and sat_or_all#9275

Open
daywalker90 wants to merge 1 commit into
ElementsProject:masterfrom
daywalker90:cln-rpc-msat-purge
Open

msggen: new rust types for sat and sat_or_all#9275
daywalker90 wants to merge 1 commit into
ElementsProject:masterfrom
daywalker90:cln-rpc-msat-purge

Conversation

@daywalker90

@daywalker90 daywalker90 commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Drop conversion to string and instead implement Display

Changelog-None

@daywalker90 daywalker90 requested a review from cdecker as a code owner July 3, 2026 09:05
@daywalker90 daywalker90 self-assigned this Jul 3, 2026
@daywalker90 daywalker90 force-pushed the cln-rpc-msat-purge branch from 99ca019 to ff31879 Compare July 3, 2026 09:15
@daywalker90 daywalker90 added the Status::Ready for Review The work has been completed and is now awaiting evaluation or approval. label Jul 3, 2026

@nepet nepet left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ack ff31879

@daywalker90 daywalker90 force-pushed the cln-rpc-msat-purge branch from ff31879 to 128710c Compare July 3, 2026 10:24
@daywalker90

Copy link
Copy Markdown
Collaborator Author

CI found an integration test that fails with this change:

So i fixed:

test_lsps2_buyjitchannel_mpp_fixed_invoice
-        amount_msat=f"{amt}msat",
+        amount_msat=amt,

This tests is quite new and i hope on the other end no one is using msat suffixes anymore?!

@daywalker90 daywalker90 marked this pull request as draft July 3, 2026 13:31
@daywalker90 daywalker90 removed the Status::Ready for Review The work has been completed and is now awaiting evaluation or approval. label Jul 3, 2026
@daywalker90 daywalker90 force-pushed the cln-rpc-msat-purge branch from 128710c to 37e7fed Compare July 6, 2026 13:48
@daywalker90 daywalker90 changed the title cln-rpc: purge msats and encode amounts as u64 msggen: new rust types for sat and sat_or_all Jul 6, 2026
@daywalker90 daywalker90 linked an issue Jul 6, 2026 that may be closed by this pull request
@daywalker90

Copy link
Copy Markdown
Collaborator Author

I have reworked this PR to introduce a new rust type for satoshi unit amounts. See the linked issue for an explanation.

@daywalker90 daywalker90 marked this pull request as ready for review July 6, 2026 13:54
Also stop serializing amounts as string with msat suffix in cln-rpc
and serialize them as a raw number instead, like CLN does it

Changelog-None
@daywalker90 daywalker90 force-pushed the cln-rpc-msat-purge branch from 37e7fed to 4c08cba Compare July 6, 2026 14:17
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.

Amount serialization issue with cln-rpc

2 participants