Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
CyonAlexRDX committed Mar 27, 2024
1 parent fdd9512 commit 8d0c350
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 26 deletions.
6 changes: 5 additions & 1 deletion RadixWallet.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
480E50D52B0C881000FC21D5 /* RecoverWalletWithoutProfileCoordinator+View.swift in Sources */ = {isa = PBXBuildFile; fileRef = 480E50D32B0C881000FC21D5 /* RecoverWalletWithoutProfileCoordinator+View.swift */; };
48581B2F2B0206E600F885C0 /* TestUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48581B2E2B0206E600F885C0 /* TestUtils.swift */; };
48649AD52ADC7CAC006307CF /* AppIcon.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 48649AD42ADC7CAC006307CF /* AppIcon.xcassets */; };
4888297A2BB41D0700DFF8E1 /* SargonExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 488829792BB41D0700DFF8E1 /* SargonExtensions.swift */; };
489122782B186F61005F2EEE /* AlternativeRectangularButtonStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 489122772B186F61005F2EEE /* AlternativeRectangularButtonStyle.swift */; };
48AB4E842AE19F5B001B238E /* ProfileStore+AsyncSequence+Updates.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48AB4E832AE19F5B001B238E /* ProfileStore+AsyncSequence+Updates.swift */; };
48ABCF402AE54A1F00D6E87F /* iOS-dev-test.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 48ABCF3F2AE54A1F00D6E87F /* iOS-dev-test.xcconfig */; };
Expand Down Expand Up @@ -1319,6 +1320,7 @@
481B44022ADC7FB3007945C1 /* RadixWallet.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = RadixWallet.xctestplan; sourceTree = "<group>"; };
48581B2E2B0206E600F885C0 /* TestUtils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestUtils.swift; sourceTree = "<group>"; };
48649AD42ADC7CAC006307CF /* AppIcon.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = AppIcon.xcassets; sourceTree = "<group>"; };
488829792BB41D0700DFF8E1 /* SargonExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SargonExtensions.swift; sourceTree = "<group>"; };
489122772B186F61005F2EEE /* AlternativeRectangularButtonStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlternativeRectangularButtonStyle.swift; sourceTree = "<group>"; };
48AB4E832AE19F5B001B238E /* ProfileStore+AsyncSequence+Updates.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ProfileStore+AsyncSequence+Updates.swift"; sourceTree = "<group>"; };
48ABCF3F2AE54A1F00D6E87F /* iOS-dev-test.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "iOS-dev-test.xcconfig"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -6883,6 +6885,7 @@
E63257622BB2F0D400952051 /* KeysToSargon.swift */,
E63257642BB314F600952051 /* ExecutionSummary+Extensions.swift */,
E63257662BB3268800952051 /* Decimal192+Extensions.swift */,
488829792BB41D0700DFF8E1 /* SargonExtensions.swift */,
);
path = SargonExtensions;
sourceTree = "<group>";
Expand Down Expand Up @@ -7875,6 +7878,7 @@
48CFC4032ADC10D900E77A5C /* KeychainClient+Mocked.swift in Sources */,
48CFC2B12ADC10D900E77A5C /* DerivePublicKeys+View.swift in Sources */,
48CFC3032ADC10D900E77A5C /* DebugManageFactorSources.swift in Sources */,
4888297A2BB41D0700DFF8E1 /* SargonExtensions.swift in Sources */,
48CFC3212ADC10D900E77A5C /* NewConnection+Reducer.swift in Sources */,
48CFC5C92ADC10DA00E77A5C /* StackedViewsLayout.swift in Sources */,
48CFC45C2ADC10DA00E77A5C /* P2PLinksClient+Interface.swift in Sources */,
Expand Down Expand Up @@ -9703,7 +9707,7 @@
repositoryURL = "https://github.com/radixdlt/sargon";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 0.4.6;
minimumVersion = 0.5.1;
};
};
/* End XCRemoteSwiftPackageReference section */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/radixdlt/sargon",
"state" : {
"revision" : "ec27f03edbecef16f59730112e20470d34dd0735",
"version" : "0.4.6"
"revision" : "8a81d143730eb4ce2bf65b35d934893780e58069",
"version" : "0.5.1"
}
},
{
Expand Down Expand Up @@ -186,8 +186,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-collections.git",
"state" : {
"branch" : "main",
"revision" : "b2c7faa198164f3d928b1ceec9ce373e22febb96"
"revision" : "94cf62b3ba8d4bed62680a282d4c25f9c63c2efb",
"version" : "1.1.0"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ extension AccountPortfoliosClient {

if let poolAddressesToRefresh {
for item in poolAddressesToRefresh {
cacheClient.removeFile(.onLedgerEntity(.resource(.pool(item))))
cacheClient.removeFile(.onLedgerEntity(.resourcePool(item)))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,23 +138,23 @@ extension TransactionClient {
intentSignatures: IntentSignatures(signatures: Array(request.intentSignatures.map { IntentSignature(signatureWithPublicKey: $0.intoSargon()) }))
)

let signedIntentHash = try signedTransactionIntent.hash()
let signedIntentHash = signedTransactionIntent.hash()

let notarySignature = try request.notary.sign(
hashOfMessage: signedIntentHash.hash
hashOfMessage: signedIntentHash.hash.data
)

let uncompiledNotarized = try NotarizedTransaction(
let uncompiledNotarized = NotarizedTransaction(
signedIntent: signedTransactionIntent,
notarySignature: notarySignature.signature
notarySignature: NotarySignature(signature: notarySignature.intoSargon())
)

let compiledNotarizedTXIntent = try uncompiledNotarized.compile()
let compiledNotarizedTXIntent = uncompiledNotarized.compile()

let txID = try request.transactionIntent.intentHash()
let txID = request.transactionIntent.hash()

return .init(
notarized: compiledNotarizedTXIntent,
notarized: compiledNotarizedTXIntent.data,
intent: request.transactionIntent,
txID: txID
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,3 @@ extension ExecutionSummary {
self.detailedClassification.first!
}
}

// MARK: - NonFungibleGlobalID + CustomStringConvertible
extension NonFungibleGlobalID: CustomStringConvertible {
public var description: String {
fatalError("Sargon migration")
}
}
13 changes: 13 additions & 0 deletions RadixWallet/Core/SargonExtensions/SargonExtensions.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
extension NotarySignature {
public init(signature: Sargon.SignatureWithPublicKey) {
fatalError("sargon migration")
}
}

// MARK: - AssetsTransfersRecipient + Identifiable
extension AssetsTransfersRecipient: Identifiable {
public typealias ID = AccountAddress
public var id: ID {
accountAddress
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ extension AssetsTransfersRecipient {
var name: String {
switch self {
case let .myOwnAccount(account):
account.displayName.rawValue
account.displayName.value
case .foreignAccount:
L10n.Common.account
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ private extension String {

var asDecimalDataField: ArbitraryDataFieldKind? {
nilIfEmpty.map {
if let decimal = try? Decimal192(value: $0) {
if let decimal = try? Decimal192($0) {
.decimal(decimal)
} else {
.primitive(self)
Expand All @@ -292,7 +292,7 @@ private extension String {

var asNonFungibleIDDataField: ArbitraryDataFieldKind? {
nilIfEmpty.map {
if let id = try? NonFungibleLocalId.from(stringFormat: $0) {
if let id = try? NonFungibleLocalID(localId: $0) {
.id(id)
} else {
.primitive(self)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public struct SubmitTransaction: Sendable, FeatureReducer {

case let .submitTXResult(.success(txID)):
state.status = .submitted
return .run { [endEpoch = state.notarizedTX.intent.header().endEpochExclusive] send in
return .run { [endEpoch = state.notarizedTX.intent.header.endEpochExclusive] send in
do {
try await submitTXClient.hasTXBeenCommittedSuccessfully(txID)
await send(.internal(.statusUpdate(.committedSuccessfully)))
Expand All @@ -137,7 +137,7 @@ public struct SubmitTransaction: Sendable, FeatureReducer {
case let .temporarilyRejected(epoch):
await send(.internal(.statusUpdate(
.temporarilyRejected(
remainingProcessingTime: Int((endEpoch - epoch).rawValue) * epochDurationInMinutes
remainingProcessingTime: Int(endEpoch - epoch) * epochDurationInMinutes
)
)))
case let .failed(reason):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ extension TransactionReview {
}

public struct DepositExceptionsChange: Sendable, Identifiable, Hashable {
public var id: AccountAddress.ID { sargon() }
public var id: AccountAddress.ID { account.accountAddress.id }
public let account: Profile.Network.Account
public let resourcePreferenceChanges: IdentifiedArrayOf<ResourcePreferenceChange>
public let allowedDepositorChanges: IdentifiedArrayOf<AllowedDepositorChange>
Expand Down

0 comments on commit 8d0c350

Please sign in to comment.