Skip to content

schemas: use sat and sat_or_all again where appropiate - #7336

Merged
endothermicdev merged 2 commits into
ElementsProject:masterfrom
daywalker90:satisfaction
May 28, 2024
Merged

schemas: use sat and sat_or_all again where appropiate#7336
endothermicdev merged 2 commits into
ElementsProject:masterfrom
daywalker90:satisfaction

Conversation

@daywalker90

Copy link
Copy Markdown
Collaborator

This is in response to #7333 and #7230 (comment)

@daywalker90
daywalker90 requested a review from cdecker as a code owner May 24, 2024 11:04
ShahanaFarooqui

This comment was marked as duplicate.



def amount2sat(a):
return a.msat / 1000

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
return a.msat / 1000
return a.msat // 1000

Do we want integer division here? Any remainder after division should indicate a problem, but if we're only using it to directly convert types it shouldn't theoretically be an issue.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I assumed an Amount already is a correctly parsed value and this should be fine, otherwise we should raise an error here, no?

For multifund and openchannel_init schemas, request_amt type is also `sat`.
@ShahanaFarooqui

Copy link
Copy Markdown
Collaborator

ACK 1727e75

@endothermicdev
endothermicdev merged commit 43f4e12 into ElementsProject:master May 28, 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