[Refactoring] Prune typeliases that were used as imported types. Those were introduced during extraction to pods and refactorings

pull/7015/head
Hwee-Boon Yar 1 year ago
parent bb496924f3
commit 26140fd5d1
  1. 3
      AlphaWallet/Activities/ViewControllers/ActivityViewController.swift
  2. 3
      AlphaWallet/Activities/Views/ActivitiesView.swift
  3. 3
      AlphaWallet/Activities/Views/ActivityViewCell.swift
  4. 6
      AlphaWallet/Browser/Coordinators/DappBrowserCoordinator.swift
  5. 3
      AlphaWallet/Browser/ViewControllers/BrowserViewController.swift
  6. 5
      AlphaWallet/Common/Views/TokenCardRowView.swift
  7. 1
      AlphaWallet/Market/ViewModels/ImportMagicTokenViewControllerViewModel.swift
  8. 1
      AlphaWallet/TokenScript/Coordinators/AssetDefinitionStoreCoordinator.swift
  9. 9
      AlphaWallet/Tokens/Collectibles/Coordinators/NFTCollectionCoordinator.swift
  10. 1
      AlphaWallet/Tokens/Collectibles/ViewControllers/NFTCollectionViewController.swift
  11. 1
      AlphaWallet/Tokens/Collectibles/ViewModels/NFTCollectionViewModel.swift
  12. 2
      AlphaWallet/Tokens/Collectibles/Views/NonFungibleRowView.swift
  13. 1
      AlphaWallet/Tokens/ViewControllers/FungibleTokenTabViewController.swift
  14. 5
      AlphaWallet/Tokens/ViewControllers/TokenInstanceActionViewController.swift
  15. 5
      AlphaWallet/Tokens/Views/TokenCardWebView.swift
  16. 1
      AlphaWallet/Transfer/Coordinators/PaymentCoordinator.swift
  17. 10
      AlphaWallet/Types/ImportedTypes.swift
  18. 1
      AlphaWallet/Wallet/ViewModels/RenameWalletViewModel.swift
  19. 3
      AlphaWalletTests/Core/FakeDomainResolutionService.swift
  20. 5
      AlphaWalletTests/Tokens/Helpers/TokenAdaptorTest.swift
  21. 1
      AlphaWalletTests/modules/AlphaWalletFoundation/Browser/Types/DappCommandTests.swift
  22. 1
      modules/AlphaWalletFoundation/AlphaWalletFoundation/Browser/Types/DappAction.swift
  23. 1
      modules/AlphaWalletFoundation/AlphaWalletFoundation/CoinTicker/Types/CoinTicker.swift
  24. 7
      modules/AlphaWalletFoundation/AlphaWalletFoundation/KeyManagement/EtherKeystore.swift
  25. 3
      modules/AlphaWalletFoundation/AlphaWalletFoundation/KeyManagement/Keystore.swift
  26. 4
      modules/AlphaWalletFoundation/AlphaWalletFoundation/Tokens/Helpers/TokenAdaptor.swift
  27. 2
      modules/AlphaWalletFoundation/AlphaWalletFoundation/Tokens/Types/TokenHolder.swift
  28. 3
      modules/AlphaWalletFoundation/AlphaWalletFoundation/Transfer/Types/RecipientResolver.swift
  29. 1
      modules/AlphaWalletFoundation/AlphaWalletFoundation/Transfer/eip1559/FeeHistory.swift
  30. 5
      modules/AlphaWalletFoundation/AlphaWalletFoundation/Transfer/eip1559/GetFeeHistory.swift
  31. 25
      modules/AlphaWalletFoundation/AlphaWalletFoundation/Types/ImportedTypes.swift
  32. 1
      modules/AlphaWalletFoundation/AlphaWalletFoundation/Types/SignMessageValidator.swift
  33. 1
      modules/AlphaWalletTokenScript/AlphaWalletTokenScript/Models/AssetAttributeSyntax.swift
  34. 1
      modules/AlphaWalletTokenScript/AlphaWalletTokenScript/Models/CallForAssetAttributeProvider.swift
  35. 2
      modules/AlphaWalletTokenScript/AlphaWalletTokenScript/Models/TokenIdOrigin.swift
  36. 1
      modules/AlphaWalletTokenScript/AlphaWalletTokenScript/Models/TokenInstanceAction.swift
  37. 10
      modules/AlphaWalletTokenScript/AlphaWalletTokenScript/Models/Types/ImportedTypes.swift
  38. 1
      modules/AlphaWalletTokenScript/AlphaWalletTokenScript/Models/Types/TokenHolderProtocol.swift
  39. 1
      modules/AlphaWalletTokenScript/AlphaWalletTokenScript/Models/Types/TokenIdOrEvent.swift
  40. 1
      modules/AlphaWalletTokenScript/AlphaWalletTokenScript/Models/Types/TokenSelection.swift
  41. 1
      modules/AlphaWalletWeb3/AlphaWalletWeb3/ABI/RLP.swift
  42. 1
      modules/AlphaWalletWeb3/AlphaWalletWeb3/BlockchainCallable.swift
  43. 7
      modules/AlphaWalletWeb3/AlphaWalletWeb3/Types/ImportedTypes.swift
  44. 1
      modules/AlphaWalletWeb3/AlphaWalletWeb3/Web3/Web3+JSONRPC.swift
  45. 5
      modules/AlphaWalletWeb3/AlphaWalletWeb3/Web3/Web3+Personal.swift
  46. 1
      modules/AlphaWalletWeb3/AlphaWalletWeb3/Web3/Web3+Structures.swift

@ -2,8 +2,9 @@
import UIKit
import Combine
import AlphaWalletFoundation
import AlphaWalletCore
import AlphaWalletFoundation
import AlphaWalletTokenScript
protocol ActivityViewControllerDelegate: AnyObject, RequestSignMessageDelegate {
func reinject(viewController: ActivityViewController)

@ -6,9 +6,10 @@
//
import UIKit
import AlphaWalletFoundation
import AlphaWalletTokenScript
import BigInt
import StatefulViewController
import AlphaWalletFoundation
protocol ActivitiesViewDelegate: AnyObject {
func didPressActivity(activity: Activity, in view: ActivitiesView)

@ -1,8 +1,9 @@
// Copyright © 2020 Stormbird PTE. LTD.
import UIKit
import BigInt
import AlphaWalletFoundation
import AlphaWalletTokenScript
import BigInt
class ActivityViewCell: UITableViewCell {
private let background = UIView()

@ -1,10 +1,12 @@
// Copyright DApps Platform Inc. All rights reserved.
import Combine
import UIKit
import WebKit
import AlphaWalletFoundation
import Combine
import AlphaWalletBrowser
import AlphaWalletBrowser
import AlphaWalletCore
import AlphaWalletFoundation
protocol DappBrowserCoordinatorDelegate: DappRequesterDelegate, CanOpenURL {
func handleUniversalLink(_ url: URL, forCoordinator coordinator: DappBrowserCoordinator)

@ -1,9 +1,10 @@
// Copyright © 2023 Stormbird PTE. LTD.
import Foundation
import JavaScriptCore
import UIKit
import WebKit
import JavaScriptCore
import AlphaWalletBrowser
import AlphaWalletFoundation
import AlphaWalletLogger
import Combine

@ -1,10 +1,11 @@
// Copyright © 2018 Stormbird PTE. LTD.
import Combine
import UIKit
import WebKit
import AlphaWalletFoundation
import AlphaWalletCore
import Combine
import AlphaWalletFoundation
import AlphaWalletTokenScript
class TokenCardRowView: UIView, TokenCardRowViewProtocol {
private let server: RPCServer

@ -2,6 +2,7 @@
import UIKit
import AlphaWalletFoundation
import AlphaWalletTokenScript
struct ImportMagicTokenViewModel {
enum State {

@ -3,6 +3,7 @@
import Foundation
import UIKit
import AlphaWalletFoundation
import AlphaWalletTokenScript
protocol AssetDefinitionStoreCoordinatorDelegate: AnyObject {
func didClose(in coordinator: AssetDefinitionStoreCoordinator)

@ -5,13 +5,14 @@
// Copyright © 2018 Alpha-Wallet. All rights reserved.
//
import Combine
import Foundation
import UIKit
import SafariServices
import MessageUI
import BigInt
import Combine
import SafariServices
import UIKit
import AlphaWalletFoundation
import AlphaWalletTokenScript
import BigInt
protocol NFTCollectionCoordinatorDelegate: AnyObject, CanOpenURL {
func didClose(in coordinator: NFTCollectionCoordinator)

@ -10,6 +10,7 @@ import Foundation
import UIKit
import Combine
import AlphaWalletFoundation
import AlphaWalletTokenScript
protocol NFTCollectionViewControllerDelegate: AnyObject, CanOpenURL {
func didSelectAssetSelection(in viewController: NFTCollectionViewController)

@ -10,6 +10,7 @@ import Foundation
import BigInt
import Combine
import AlphaWalletFoundation
import AlphaWalletTokenScript
struct NFTCollectionViewModelInput {
let willAppear: AnyPublisher<Void, Never>

@ -6,8 +6,8 @@
//
import UIKit
import AlphaWalletCore
import AlphaWalletFoundation
import struct AlphaWalletTokenScript.TokenId
class NonFungibleRowView: TokenCardViewRepresentable {
private let titleLabel = UILabel()

@ -8,6 +8,7 @@
import UIKit
import Combine
import AlphaWalletFoundation
import AlphaWalletTokenScript
protocol FungibleTokenTabViewControllerDelegate: AnyObject, CanOpenURL2 {
func didClose(in viewController: FungibleTokenTabViewController)

@ -1,10 +1,11 @@
// Copyright © 2018 Stormbird PTE. LTD.
import Combine
import Foundation
import UIKit
import Combine
import AlphaWalletFoundation
import AlphaWalletCore
import AlphaWalletFoundation
import AlphaWalletTokenScript
import BigInt
import PromiseKit

@ -5,11 +5,12 @@
// Created by Vladyslav Shepitko on 12.05.2022.
//
import Combine
import Foundation
import UIKit
import AlphaWalletFoundation
import Combine
import AlphaWalletCore
import AlphaWalletFoundation
import AlphaWalletTokenScript
class TokenCardWebView: UIView, TokenCardRowViewConfigurable, ViewRoundingSupportable, ViewLoadingSupportable {
private let server: RPCServer

@ -3,6 +3,7 @@
import Foundation
import UIKit
import Combine
import AlphaWalletCore
import AlphaWalletFoundation
protocol PaymentCoordinatorDelegate: CanOpenURL, BuyCryptoDelegate {

@ -1,19 +1,9 @@
// Copyright © 2023 Stormbird PTE. LTD.
import AlphaWalletCore
typealias ReachabilityManager = AlphaWalletCore.ReachabilityManager
typealias Loadable = AlphaWalletCore.Loadable
typealias ReachabilityManagerProtocol = AlphaWalletCore.ReachabilityManagerProtocol
import AlphaWalletTokenScript
typealias AssetAttributeValues = AlphaWalletTokenScript.AssetAttributeValues
typealias AssetAttribute = AlphaWalletTokenScript.AssetAttribute
typealias AssetInternalValue = AlphaWalletTokenScript.AssetInternalValue
typealias AttributeId = AlphaWalletTokenScript.AttributeId
typealias GeneralisedTime = AlphaWalletTokenScript.GeneralisedTime
typealias TokenScript = AlphaWalletTokenScript.TokenScript
typealias XMLHandler = AlphaWalletTokenScript.XMLHandler
import AlphaWalletABI
public typealias EIP712TypedData = AlphaWalletABI.EIP712TypedData
public typealias EthTypedData = AlphaWalletABI.EthTypedData

@ -7,6 +7,7 @@
import Foundation
import Combine
import AlphaWalletENS
import AlphaWalletFoundation
struct RenameWalletViewModelInput {

@ -1,9 +1,10 @@
// Copyright © 2022 Stormbird PTE. LTD.
@testable import AlphaWallet
import Foundation
import Combine
import Foundation
import AlphaWalletCore
import AlphaWalletENS
import AlphaWalletFoundation
//TODO does the results from each stub function work correctly as expected in test suite?:w

@ -2,6 +2,7 @@
@testable import AlphaWallet
import AlphaWalletFoundation
import AlphaWalletTokenScript
import Foundation
import XCTest
@ -41,7 +42,7 @@ class TokenAdaptorTest: XCTestCase {
]),
]
let assetDefinitionStore = AssetDefinitionStore.make()
let token = Token(contract: Constants.nullAddress)
let token = Token(contract: AlphaWalletFoundation.Constants.nullAddress)
let nftProvider = FakeNftProvider()
let bundles = TokenAdaptor(assetDefinitionStore: assetDefinitionStore, eventsDataStore: FakeEventsDataStore(), wallet: .make(), nftProvider: nftProvider).bundleTestsOnly(tokens: tokens, token: token)
XCTAssertEqual(bundles.count, 2)
@ -92,7 +93,7 @@ class TokenAdaptorTest: XCTestCase {
]),
]
let assetDefinitionStore = AssetDefinitionStore.make()
let token = Token(contract: Constants.nullAddress)
let token = Token(contract: AlphaWalletFoundation.Constants.nullAddress)
let nftProvider = FakeNftProvider()
let bundles = TokenAdaptor(assetDefinitionStore: assetDefinitionStore, eventsDataStore: FakeEventsDataStore(), wallet: .make(), nftProvider: nftProvider).bundleTestsOnly(tokens: tokens, token: token)
XCTAssertEqual(bundles.count, 2)

@ -1,6 +1,7 @@
// Copyright © 2022 Stormbird PTE. LTD.
import XCTest
import AlphaWalletBrowser
@testable import AlphaWalletFoundation
class DappCommandTests: XCTestCase {

@ -5,6 +5,7 @@ import BigInt
import WebKit
import AlphaWalletABI
import AlphaWalletAddress
import AlphaWalletBrowser
import AlphaWalletCore
import AlphaWalletLogger
import AlphaWalletWeb3

@ -1,6 +1,7 @@
// Copyright SIX DAY LLC. All rights reserved.
import Foundation
import AlphaWalletCore
public struct CoinTicker: Hashable, Equatable {
public let primaryKey: String

@ -1,12 +1,13 @@
// Copyright SIX DAY LLC. All rights reserved.
import Combine
import Foundation
import LocalAuthentication
import BigInt
import AlphaWalletABI
import AlphaWalletHardwareWallet
import AlphaWalletWeb3
import AlphaWalletTrustWalletCoreExtensions
import Combine
import AlphaWalletWeb3
import BigInt
public enum EtherKeystoreError: LocalizedError {
case protectionDisabled

@ -1,8 +1,9 @@
// Copyright SIX DAY LLC. All rights reserved.
import Combine
import Foundation
import LocalAuthentication
import Combine
import AlphaWalletABI
import AlphaWalletTrustWalletCoreExtensions
public protocol Keystore: AnyObject {

@ -6,11 +6,11 @@
// Copyright © 2018 Alpha-Wallet. All rights reserved.
//
import Combine
import Foundation
import AlphaWalletTokenScript
import AlphaWalletOpenSea
import AlphaWalletTokenScript
import BigInt
import Combine
extension TokenHolder: ObservableObject { }

@ -9,9 +9,9 @@
import Foundation
import AlphaWalletCore
import AlphaWalletOpenSea
import AlphaWalletTokenScript
import BigInt
public enum TokenHolderSelectionStrategy {
case all
case token(tokenId: TokenId, amount: Int)

@ -7,8 +7,9 @@
import Foundation
import Combine
import CombineExt
import AlphaWalletCore
import AlphaWalletENS
import CombineExt
public struct RecipientViewModel {
public var address: AlphaWallet.Address?

@ -6,6 +6,7 @@
//
import Foundation
import AlphaWalletCore
import BigInt
public struct FeeHistory {

@ -5,10 +5,11 @@
// Created by Vladyslav Shepitko on 16.08.2022.
//
import Combine
import Foundation
import JSONRPCKit
import AlphaWalletCore
import APIKit
import Combine
import JSONRPCKit
struct FeeHistoryRequest: JSONRPCKit.Request {
typealias Response = FeeHistory

@ -1,7 +1,6 @@
// Copyright © 2023 Stormbird PTE. LTD.
import AlphaWalletCore
typealias CastError = AlphaWalletCore.CastError
public typealias CustomRPC = AlphaWalletCore.CustomRPC
public typealias NetworkService = AlphaWalletCore.NetworkService
public typealias RPCServer = AlphaWalletCore.RPCServer
@ -13,26 +12,16 @@ public typealias TokenId = AlphaWalletCore.TokenId
public typealias JsonRpcError = AlphaWalletCore.JsonRpcError
import AlphaWalletTokenScript
typealias AssetAttributeValues = AlphaWalletTokenScript.AssetAttributeValues
public typealias AssetInternalValue = AlphaWalletTokenScript.AssetInternalValue
public typealias AssetAttributeSyntaxValue = AlphaWalletTokenScript.AssetAttributeSyntaxValue
public typealias AssetDefinitionStore = AlphaWalletTokenScript.AssetDefinitionStore
public typealias AttributeId = AlphaWalletTokenScript.AttributeId
public typealias FunctionOrigin = AlphaWalletTokenScript.FunctionOrigin
public typealias TokenActionProvider = AlphaWalletTokenScript.TokenActionProvider
typealias TokenIdOrEvent = AlphaWalletTokenScript.TokenIdOrEvent
public typealias TokenType = AlphaWalletTokenScript.TokenType
public typealias TokenInstanceAction = AlphaWalletTokenScript.TokenInstanceAction
public typealias TokenScript = AlphaWalletTokenScript.TokenScript
public typealias TokenScriptSelection = AlphaWalletTokenScript.TokenScriptSelection
public typealias TokenHolderProtocol = AlphaWalletTokenScript.TokenHolderProtocol
public typealias TokenScriptWebView = AlphaWalletTokenScript.TokenScriptWebView
public typealias TokenScriptWebViewDelegate = AlphaWalletTokenScript.TokenScriptWebViewDelegate
public typealias TokenSelection = AlphaWalletTokenScript.TokenSelection
public typealias XMLHandler = AlphaWalletTokenScript.XMLHandler
import AlphaWalletWeb3
public typealias ContractMethodCall = AlphaWalletWeb3.ContractMethodCall
public typealias BlockchainsProvider = AlphaWalletWeb3.BlockchainsProvider
public typealias DecodedFunctionCall = AlphaWalletWeb3.DecodedFunctionCall
public typealias EthereumTransaction = AlphaWalletWeb3.EthereumTransaction
@ -40,20 +29,6 @@ public typealias EthereumUnit = AlphaWalletWeb3.EthereumUnit
public typealias EtherNumberFormatter = AlphaWalletWeb3.EtherNumberFormatter
public typealias GasPrice = AlphaWalletWeb3.GasPrice
import AlphaWalletABI
public typealias EIP712TypedData = AlphaWalletABI.EIP712TypedData
public typealias EthTypedData = AlphaWalletABI.EthTypedData
import AlphaWalletENS
public typealias DomainName = AlphaWalletENS.DomainName
import AlphaWalletBrowser
public typealias AddCustomChainCommand = AlphaWalletBrowser.AddCustomChainCommand
public typealias DappCallback = AlphaWalletBrowser.DappCallback
public typealias DappCommandObjectValue = AlphaWalletBrowser.DappCommandObjectValue
public typealias DappCommand = AlphaWalletBrowser.DappCommand
public typealias DappCommandWithOptionalObjectValues = AlphaWalletBrowser.DappCommandWithOptionalObjectValues
public typealias DappOrWalletCommand = AlphaWalletBrowser.DappOrWalletCommand
public typealias SwitchChainCommand = AlphaWalletBrowser.SwitchChainCommand
public typealias WalletAddEthereumChainObject = AlphaWalletBrowser.WalletAddEthereumChainObject
public typealias WalletSwitchEthereumChainObject = AlphaWalletBrowser.WalletSwitchEthereumChainObject

@ -6,6 +6,7 @@
//
import Foundation
import AlphaWalletABI
public struct DappOrTokenScriptEip712v3And4Validator {
let server: RPCServer

@ -1,6 +1,7 @@
// Copyright © 2018 Stormbird PTE. LTD.
import Foundation
import AlphaWalletCore
import BigInt
public enum AssetAttributeSyntax: String {

@ -1,6 +1,7 @@
// Copyright © 2018 Stormbird PTE. LTD.
import Foundation
import AlphaWalletCore
import AlphaWalletWeb3
import BigInt
import PromiseKit

@ -2,6 +2,8 @@
import Foundation
import AlphaWalletAddress
import AlphaWalletCore
import AlphaWalletWeb3
import BigInt
import Kanna

@ -2,6 +2,7 @@
import Foundation
import AlphaWalletAddress
import AlphaWalletCore
import BigInt
extension TokenInstanceAction.ActionType: Equatable {

@ -1,10 +0,0 @@
// Copyright © 2023 Stormbird PTE. LTD.
import AlphaWalletCore
public typealias AtomicDictionary = AlphaWalletCore.AtomicDictionary
public typealias Loadable = AlphaWalletCore.Loadable
public typealias Subscribable = AlphaWalletCore.Subscribable
public typealias TokenId = AlphaWalletCore.TokenId
import AlphaWalletWeb3
public typealias EtherNumberFormatter = AlphaWalletWeb3.EtherNumberFormatter

@ -2,6 +2,7 @@
import Foundation
import AlphaWalletAddress
import AlphaWalletCore
public protocol TokenHolderProtocol {
var tokenId: TokenId { get }

@ -1,6 +1,7 @@
// Copyright © 2020 Stormbird PTE. LTD.
import Foundation
import AlphaWalletCore
public enum TokenIdOrEvent {
case tokenId(tokenId: TokenId)

@ -1,6 +1,7 @@
// Copyright © 2023 Stormbird PTE. LTD.
import Foundation
import AlphaWalletCore
import BigInt
public struct TokenSelection: Equatable, Hashable {

@ -7,6 +7,7 @@
//
import Foundation
import AlphaWalletCore
import BigInt
protocol ArrayType {}

@ -1,6 +1,7 @@
// Copyright © 2023 Stormbird PTE. LTD.
import Combine
import APIKit
public protocol BlockchainCallable {
func call<R: ContractMethodCall>(_ method: R, block: BlockParameter) -> AnyPublisher<R.Response, SessionTaskError>

@ -1,7 +0,0 @@
// Copyright © 2023 Stormbird PTE. LTD.
import AlphaWalletCore
typealias DecodeError = AlphaWalletCore.DecodeError
import APIKit
public typealias SessionTaskError = APIKit.SessionTaskError

@ -7,6 +7,7 @@
//
import Foundation
import AlphaWalletCore
import BigInt
public struct Counter {

@ -7,17 +7,18 @@
//
import Foundation
import AlphaWalletCore
import BigInt
extension Web3.Personal {
public func ecrecover(personalMessage: Data, signature: Data) -> Result<EthereumAddress, Error> {
guard let recovered = Web3.Utils.personalECRecover(personalMessage, signature: signature) else {
return .failure(DecodeError.initFailure)
}
return .success(recovered)
}
public func ecrecover(hash: Data, signature: Data) -> Result<EthereumAddress, Error> {
guard let recovered = Web3.Utils.hashECRecover(hash: hash, signature: signature) else {
return .failure(DecodeError.initFailure)

@ -6,6 +6,7 @@
//
import Foundation
import AlphaWalletCore
import BigInt
fileprivate func decodeHexToData<T>(_ container: KeyedDecodingContainer<T>, key: KeyedDecodingContainer<T>.Key, allowOptional: Bool = false) throws -> Data? {

Loading…
Cancel
Save