diff --git a/App/BabylonWallet.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/App/BabylonWallet.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index bdc434bfd9..f5e36c6686 100644 --- a/App/BabylonWallet.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/App/BabylonWallet.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -231,7 +231,7 @@ "location" : "https://github.com/radixdlt/swift-engine-toolkit", "state" : { "branch" : "release/rcnet-v3", - "revision" : "2f6fa524e0191acb3c25cc35966cd4d23039886a" + "revision" : "69e906bd55e5d5f667aa4ee49b31e9ce021f11d7" } }, { @@ -291,7 +291,7 @@ { "identity" : "swift-numerics", "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-numerics.git", + "location" : "https://github.com/apple/swift-numerics", "state" : { "revision" : "0a5bc04095a675662cf24757cc0640aa2204253b", "version" : "1.0.2" @@ -338,8 +338,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/siteline/SwiftUI-Introspect", "state" : { - "revision" : "ccb973cfff703cba53fb88197413485c060eb26b", - "version" : "0.10.0" + "revision" : "121c146fe591b1320238d054ae35c81ffa45f45a", + "version" : "0.12.0" } }, { diff --git a/Sources/Core/SharedTestingModels/TestVectorsSharedByMultipleTargets/profile_snapshot.json b/Sources/Core/SharedTestingModels/TestVectorsSharedByMultipleTargets/profile_snapshot.json index 2af11d38b0..5442212f25 100644 --- a/Sources/Core/SharedTestingModels/TestVectorsSharedByMultipleTargets/profile_snapshot.json +++ b/Sources/Core/SharedTestingModels/TestVectorsSharedByMultipleTargets/profile_snapshot.json @@ -193,9 +193,9 @@ ], "header" : { "contentHint" : { - "numberOfAccountsOnAllNetworksInTotal" : 6, - "numberOfNetworks" : 2, - "numberOfPersonasOnAllNetworksInTotal" : 3 + "numberOfAccountsOnAllNetworksInTotal" : 3, + "numberOfNetworks" : 1, + "numberOfPersonasOnAllNetworksInTotal" : 2 }, "creatingDevice" : { "date" : "1970-01-01T00:00:00Z", diff --git a/Sources/EngineKit/Address.swift b/Sources/EngineKit/Address.swift index 52bbcb3ccc..dfe57e0012 100644 --- a/Sources/EngineKit/Address.swift +++ b/Sources/EngineKit/Address.swift @@ -36,7 +36,6 @@ extension EntityType: CaseIterable { .globalVirtualEd25519Identity, .globalVirtualSecp256k1Account, .globalVirtualSecp256k1Identity, - .internalAccount, .internalFungibleVault, .internalGenericComponent, .internalKeyValueStore, @@ -82,7 +81,7 @@ public enum EntityEntityType: SpecificEntityType { // MARK: - AccountEntityType public enum AccountEntityType: SpecificEntityType { - public static let addressSpace: Set = [.globalAccount, .internalAccount, .globalVirtualEd25519Account, .globalVirtualSecp256k1Account] + public static let addressSpace: Set = [.globalAccount, .globalVirtualEd25519Account, .globalVirtualSecp256k1Account] } // MARK: - IdentityEntityType diff --git a/Tests/ProfileTests/ProfileTests.swift b/Tests/ProfileTests/ProfileTests.swift index 82c750b393..abbf272553 100644 --- a/Tests/ProfileTests/ProfileTests.swift +++ b/Tests/ProfileTests/ProfileTests.swift @@ -114,6 +114,7 @@ final class ProfileTests: TestCase { } } + // FIXME: Rewrite this whole test... which manually populates profile instead of using our production code! func test_generate_profile_snapshot_test_vector() async throws { continueAfterFailure = false @@ -150,7 +151,19 @@ final class ProfileTests: TestCase { ) let profile = Profile( - header: snapshotHeader, + header: .init( + creatingDevice: device, + lastUsedOnDevice: device, + id: stableUUID, + lastModified: stableDate, + // FIXME: we should not hard code these... actually we should rewrite this whole test... which manually populates profile instead of using our production code! + contentHint: .init( + numberOfAccountsOnAllNetworksInTotal: 3, + numberOfPersonasOnAllNetworksInTotal: 2, + numberOfNetworks: 1 + ), + snapshotVersion: .minimum + ), deviceFactorSource: babylonFactorSource, appPreferences: .init(gateways: .init(current: gateway)) ) @@ -458,6 +471,10 @@ final class ProfileTests: TestCase { ) let snapshot = profile.snapshot() + + XCTAssertEqual(snapshot.networks.count, snapshot.header.contentHint.numberOfNetworks) + XCTAssertEqual(snapshot.header.contentHint.numberOfAccountsOnAllNetworksInTotal, profile.network?.accounts.count) + XCTAssertEqual(snapshot.header.contentHint.numberOfPersonasOnAllNetworksInTotal, profile.network?.personas.count) let jsonEncoder = JSONEncoder.iso8601 XCTAssertNoThrow(try jsonEncoder.encode(snapshot)) // Uncomment the lines below to generate a new test vector @@ -481,9 +498,9 @@ final class ProfileTests: TestCase { id: .init(uuidString: "BABE1442-3C98-41FF-AFB0-D0F5829B020D")!, lastModified: date, contentHint: .init( - numberOfAccountsOnAllNetworksInTotal: 6, - numberOfPersonasOnAllNetworksInTotal: 3, - numberOfNetworks: 2 + numberOfAccountsOnAllNetworksInTotal: 3, + numberOfPersonasOnAllNetworksInTotal: 2, + numberOfNetworks: 1 ), snapshotVersion: ProfileSnapshot.Header.Version.minimum ) @@ -719,6 +736,18 @@ final class ProfileTests: TestCase { } func test_version_compatibility_check_ok() throws { + let snapshotHeader = ProfileSnapshot.Header( + creatingDevice: device, + lastUsedOnDevice: device, + id: stableUUID, + lastModified: stableDate, + contentHint: .init( + numberOfAccountsOnAllNetworksInTotal: 6, + numberOfPersonasOnAllNetworksInTotal: 3, + numberOfNetworks: 2 + ), + snapshotVersion: .minimum + ) XCTAssertNoThrow( try snapshotHeader.validateCompatibility() ) @@ -731,18 +760,6 @@ private let creatingDevice: NonEmptyString = "\(deviceFactorModel) \(deviceFacto private let stableDate = Date(timeIntervalSince1970: 0) private let stableUUID = UUID(uuidString: "BABE1442-3C98-41FF-AFB0-D0F5829B020D")! private let device: ProfileSnapshot.Header.UsedDeviceInfo = .init(description: creatingDevice, id: stableUUID, date: stableDate) -private let snapshotHeader = ProfileSnapshot.Header( - creatingDevice: device, - lastUsedOnDevice: device, - id: stableUUID, - lastModified: stableDate, - contentHint: .init( - numberOfAccountsOnAllNetworksInTotal: 6, - numberOfPersonasOnAllNetworksInTotal: 3, - numberOfNetworks: 2 - ), - snapshotVersion: .minimum -) extension EntityProtocol { func publicKey() -> SLIP10.PublicKey? {