-
Notifications
You must be signed in to change notification settings - Fork 1
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
[Swift] Make Decimal192 standard number available for release #210
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -73,6 +73,17 @@ extension Decimal192 { | |||
public static let maxDivisibility: UInt8 = 18 | |||
|
|||
public static let temporaryStandardFee: Self = transactionFeePreset() | |||
|
|||
public static let one: Self = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrong place IMO, should be placed in https://github.com/radixdlt/sargon/blob/main/apple/Sources/Sargon/Extensions/Swiftified/Prelude/Decimal192%2BSwiftified.swift
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I doubt about it myself as well. The +Swiftified
file makes more sense, but shouldn't maxDivisibility
& temporaryStandardFee
be there as well then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no because transactionFeePreset()
is calling a global method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and maxDivisibility
IS declared in Rust, but was not able to UniFFI export it, since one cannot UniFFI export static variables
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so yeah maxDivisibility
should maybe go into Swiftified... I put it there to try to indicate that this too was known by Rust.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tbh, I have been wondering for a while whether we shouldn't have both extensions in same file. There are also cases where we use global methods from the Swiftified extension (example), and it could be easier to maintain to keep all in one place (and have only the +SampleValues
extension in a different file).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The split is much wanted! The goal is to be able to delete the whole +Wrap+Address
! It is needed because UniFFI currently does not allow for exports of constructors for [rust] Record
([swift] struct
).
When they do, we can remove many wrapped functions, e.g
https://github.com/radixdlt/sargon/blob/main/apple/Sources/Sargon/Extensions/Methods/Prelude/Decimal192%2BWrap%2BFunctions.swift#L11
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #210 +/- ##
=====================================
Coverage 97.4% 97.4%
=====================================
Files 932 932
Lines 14954 14954
Branches 64 64
=====================================
Hits 14572 14572
Misses 375 375
Partials 7 7
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.