From f6c9d5cd3e550cf1bf2396309932bc2e3bb84223 Mon Sep 17 00:00:00 2001 From: Stephen Heaps Date: Wed, 19 Jul 2023 16:00:21 -0400 Subject: [PATCH 1/2] Resolve AccountActivityStoreTests.testUpdateEthereumAccount() --- .../AccountActivityStoreTests.swift | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Tests/BraveWalletTests/AccountActivityStoreTests.swift b/Tests/BraveWalletTests/AccountActivityStoreTests.swift index 66e9c83e9cb..4c65abe2325 100644 --- a/Tests/BraveWalletTests/AccountActivityStoreTests.swift +++ b/Tests/BraveWalletTests/AccountActivityStoreTests.swift @@ -111,6 +111,7 @@ class AccountActivityStoreTests: XCTestCase { } func testUpdateEthereumAccount() { + let firstTransactionDate = Date(timeIntervalSince1970: 1636399671) // Monday, November 8, 2021 7:27:51 PM let account: BraveWallet.AccountInfo = .mockEthAccount let formatter = WeiFormatter(decimalFormatStyle: .decimals(precision: 18)) let mockEthDecimalBalance: Double = 0.0896 @@ -131,7 +132,11 @@ class AccountActivityStoreTests: XCTestCase { mockEthBalanceWei: mockEthBalanceWei, mockERC20BalanceWei: mockERC20BalanceWei, mockERC721BalanceWei: mockERC721BalanceWei, - transactions: [ethSendTxCopy, goerliSwapTxCopy] + transactions: [goerliSwapTxCopy, ethSendTxCopy].enumerated().map { (index, tx) in + // transactions sorted by created time, make sure they are in-order + tx.createdTime = firstTransactionDate.addingTimeInterval(TimeInterval(index * 10)) + return tx + } ) let mockAssetManager = TestableWalletUserAssetManager() @@ -232,6 +237,7 @@ class AccountActivityStoreTests: XCTestCase { } func testUpdateSolanaAccount() { + let firstTransactionDate = Date(timeIntervalSince1970: 1636399671) // Monday, November 8, 2021 7:27:51 PM let account: BraveWallet.AccountInfo = .mockSolAccount let mockLamportBalance: UInt64 = 3876535000 // ~3.8765 SOL let mockSolDecimalBalance: Double = 3.8765 // rounded @@ -253,7 +259,11 @@ class AccountActivityStoreTests: XCTestCase { let (keyringService, rpcService, walletService, blockchainRegistry, assetRatioService, txService, solTxManagerProxy, ipfsApi) = setupServices( mockLamportBalance: mockLamportBalance, mockSplTokenBalances: mockSplTokenBalances, - transactions: [solSendTxCopy, solTestnetSendTxCopy] + transactions: [solTestnetSendTxCopy, solSendTxCopy].enumerated().map { (index, tx) in + // transactions sorted by created time, make sure they are in-order + tx.createdTime = firstTransactionDate.addingTimeInterval(TimeInterval(index * 10)) + return tx + } ) let mockAssetManager = TestableWalletUserAssetManager() From 7362ded1a8c8e0086ab451151d1596666d957468 Mon Sep 17 00:00:00 2001 From: Stephen Heaps Date: Wed, 19 Jul 2023 16:59:34 -0400 Subject: [PATCH 2/2] Update disabled wallet tests for CI. --- fastlane/Fastfile | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 76ac4281048..202b07b387a 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -53,20 +53,17 @@ platform :ios do "ClientTests/UserAgentTests", "ClientTests/AdBlockEngineManagerTests/testPerformance", "DataTests", - "BraveWalletTests/ManageSiteConnectionsStoreTests/testRemoveAllPermissions", - "BraveWalletTests/ManageSiteConnectionsStoreTests/testRemovePermissions", - "BraveWalletTests/ManageSiteConnectionsStoreTests/testRemovePermissionsLastPermission", - "BraveWalletTests/SendTokenStoreTests/testSNSAddressResolution", - "BraveWalletTests/SendTokenStoreTests/testSNSAddressResolutionFailure", + "BraveWalletTests/ManageSiteConnectionsStoreTests/testRemoveAllPermissions", + "BraveWalletTests/ManageSiteConnectionsStoreTests/testRemovePermissions", + "BraveWalletTests/ManageSiteConnectionsStoreTests/testRemovePermissionsLastPermission", "BraveWalletTests/SendTokenStoreTests/testResolvedAddressUsedInSolTxIfAvailable", - "BraveWalletTests/SendTokenStoreTests/testENSAddressResolution", - "BraveWalletTests/SendTokenStoreTests/testENSAddressResolutionOffchain", - "BraveWalletTests/SendTokenStoreTests/testENSAddressResolutionFailure", "BraveWalletTests/SendTokenStoreTests/testResolvedAddressUsedInEthTxIfAvailable", "BraveWalletTests/SendTokenStoreTests/testUDAddressResolutionEthNetwork", - "BraveWalletTests/SendTokenStoreTests/testUDAddressResolutionFailure", "BraveWalletTests/SendTokenStoreTests/testUDAddressResolutionSolNetwork", - "BraveWalletTests/SendTokenStoreTests/testUDAddressResolutionTokenChange" + "BraveWalletTests/SendTokenStoreTests/testUDAddressResolutionFailure", + "BraveWalletTests/SendTokenStoreTests/testUDAddressResolutionTokenChange", + "BraveWalletTests/TransactionConfirmationStoreTests/testPrepareERC20Approve", + "BraveWalletTests/TransactionConfirmationStoreTests/testPrepareTransactionNotOnSelectedNetwork", ] )