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

[Swift] Make Decimal192 standard number available for release #210

Merged
merged 3 commits into from
Sep 6, 2024

Conversation

matiasbzurovski
Copy link
Contributor

No description provided.

@matiasbzurovski matiasbzurovski added the Swift 🍏 Changes in Swift Sargon label Sep 6, 2024
Copy link
Contributor

@CyonAlexRDX CyonAlexRDX left a 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
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

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?

Copy link
Contributor

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.

Copy link
Contributor

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

Copy link
Contributor

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.

Copy link
Contributor Author

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).

Copy link
Contributor

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

Copy link

codecov bot commented Sep 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.4%. Comparing base (f4772a7) to head (6d9babe).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@          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           
Flag Coverage Δ
rust 96.9% <ø> (ø)
swift 99.4% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ons/Swiftified/Prelude/Decimal192+Swiftified.swift 100.0% <ø> (ø)

Copy link
Contributor

@CyonAlexRDX CyonAlexRDX left a comment

Choose a reason for hiding this comment

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

LGTM

@matiasbzurovski matiasbzurovski merged commit 9c874a3 into main Sep 6, 2024
9 of 10 checks passed
@matiasbzurovski matiasbzurovski deleted the mb/decimal branch September 6, 2024 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Swift 🍏 Changes in Swift Sargon
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants