-
Notifications
You must be signed in to change notification settings - Fork 10
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
Introduce Sargon: Radix Engine Toolkit (RET) removed #1032
Conversation
supersedes #1031 |
...tures/AccountPreferencesFeature/Children/ThirdPartyDeposits/ThirdPartyDeposits+Reducer.swift
Show resolved
Hide resolved
RadixWallet.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
Show resolved
Hide resolved
RadixWallet/Clients/OnLedgerEntitiesClient/Helpers/OnLedgerEntitiesClient+ComplexTypes.swift
Outdated
Show resolved
Hide resolved
@@ -150,7 +150,7 @@ extension OnLedgerEntitiesClient { | |||
guard let xrdResource = item | |||
.fungibleResources? | |||
.items | |||
.first(where: { $0.resourceAddress == xrdAddress }) | |||
.first(where: { $0.resourceAddress == xrdAddress.address }) |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
@@ -10,23 +10,23 @@ public struct SubmitTransactionClient: Sendable { | |||
} | |||
|
|||
extension SubmitTransactionClient { | |||
public typealias SubmitTransaction = @Sendable (SubmitTXRequest) async throws -> TXID | |||
public typealias HasTXBeenCommittedSuccessfully = @Sendable (TXID) async throws -> Void | |||
public typealias SubmitTransaction = @Sendable (SubmitTXRequest) async throws -> IntentHash |
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.
Should we then also replace the txID
property names?
RadixWallet/Clients/SubmitTransactionClient/SubmitTransactionClient+Live.swift
Outdated
Show resolved
Hide resolved
...nents/TransferAccountList/ReceivingAccount/Asset/NonFungibleResourceAsset+Reducer+View.swift
Outdated
Show resolved
Hide resolved
RadixWallet/Features/TransactionReviewFeature/TransactionReview+Sections.swift
Outdated
Show resolved
Hide resolved
RadixWallet/Features/TransactionReviewFeature/TransactionReview.swift
Outdated
Show resolved
Hide resolved
RadixWallet/Profile/Entity/OnLedgerSettings/Account+OnLedgerSettings.swift
Outdated
Show resolved
Hide resolved
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.
Tremendous work, bravo 💯 🥇!!! So many months of work finally come to fruition, and in what a nice clean way 👏.
Can't wait to have 90% of the codebase in Sargon 😄
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.
Amazing work, many great improvements. Most comments are style related. Regarding all the new debug strings, shouldn't they be returned by Sargon, or are they all on types that only exist on iOS?
RadixWallet/Clients/AccountPortfoliosClient/AccountPortfoliosClient+Live.swift
Show resolved
Hide resolved
RadixWallet/Clients/AccountPortfoliosClient/AccountPortfoliosClient+State.swift
Show resolved
Hide resolved
...nents/TransferAccountList/ReceivingAccount/Asset/NonFungibleResourceAsset+Reducer+View.swift
Outdated
Show resolved
Hide resolved
...ansferFeature/Components/TransferAccountList/ReceivingAccount/ReceivingAccount+Reducer.swift
Outdated
Show resolved
Hide resolved
...ansferFeature/Components/TransferAccountList/ReceivingAccount/ReceivingAccount+Reducer.swift
Outdated
Show resolved
Hide resolved
.../Features/AssetsFeature/Components/HelperViews/ResourceBalance/ResourceBalance+Helpers.swift
Outdated
Show resolved
Hide resolved
...llet/Features/AssetsFeature/Components/HelperViews/ResourceBalance/ResourceBalanceView.swift
Outdated
Show resolved
Hide resolved
… converted from Double, Sargon is wise.
STATUS: Ready for review
Do not merge yet, we must test it more! Initial testing looks good, I've tried all various "standard transactions" which seems to be working:
(Creating MANY NonFungible and MANY Fungible - from Dev Preferences for DEBUG builds does not work, so I will look into that, but at least mint many NFTs is commented out currently in
main
anyway.)Changes
This PR removes
RET: Radix Engine Toolkit
(which is Swifty wrapper around Rust impl), and the extensions we had on those types which reside in the EngineKit folder in this repo - they are all replaces withSargon
, specifically the Swift Package /target
with the same name, which is a non-trivial Swift wrapper around the UniFFI bindgen "hot garbage" generated file with 22,000 lines of Swift code.Sargon
also contains a full implementation ofProfile
, this PR does NOT make use of that here in iOS wallet land, instead we keep using the iOS wallets Profile impl for now, but at a later point in time (hopefully this month) we will remove iOS profile and use Sargon profile instead.RETDecimal
is now known asDecimal192
(Not namedDecimal
to avoid naming collision withFoundation.Decimal
) - and should be identical to what we have today (with a few extra improvements, suchasDecimal
is not a throwing method but a computed property. And more initializers)Sendable
All types in Sargon are value types - not references types like they were in RET - with mutable stored properties. All types are
Hashable
(thusEquatable
) andSendable
.Samples Values
ALL types in Sargon (in Rust) have sample values.
Self.sample()
andSelf.sample_other()
, almost all types in Swift have got those a exported as static vars,Self.sample
andSelf.sampleOther
- if you miss one, let me know and I will export it from Rust and "swiftify it".RET API's have been upgraded to:
hash
andcompile
andintent_hash
etc)Address
(tagged union) but rather use specific addresses, e.g.AccountAddress
foraccountsWithdrawnFrom
networkID
unnecessarily - instead we read it out from the provided addressesnetworkID
,poolKind
,isLegacyAddress
,isFungible
etcformatted(_ addressFormat: AddressFormat) -> String
methodsBROKEN / UNTESTED
Most likely broken are:
Test it out
Pre-Alpha 1.5.1 (2)