diff --git a/AlphaWallet/Transfer/Controllers/TransactionConfigurator.swift b/AlphaWallet/Transfer/Controllers/TransactionConfigurator.swift index 855cb0816..9530a06f5 100644 --- a/AlphaWallet/Transfer/Controllers/TransactionConfigurator.swift +++ b/AlphaWallet/Transfer/Controllers/TransactionConfigurator.swift @@ -152,7 +152,7 @@ class TransactionConfigurator { } // swiftlint:disable function_body_length - func load(completion: @escaping (ResultResult.t) -> Void) { + func start(completion: @escaping (ResultResult.t) -> Void) { switch transaction.transferType { case .dapp: configuration = TransactionConfiguration( diff --git a/AlphaWallet/Transfer/Coordinators/TransferNFTCoordinator.swift b/AlphaWallet/Transfer/Coordinators/TransferNFTCoordinator.swift index db208170b..26d6f26e6 100644 --- a/AlphaWallet/Transfer/Coordinators/TransferNFTCoordinator.swift +++ b/AlphaWallet/Transfer/Coordinators/TransferNFTCoordinator.swift @@ -90,7 +90,7 @@ class TransferNFTCoordinator: Coordinator { account: account, transaction: transaction ) - configurator.load { [weak self] result in + configurator.start { [weak self] result in guard let strongSelf = self else { return } diff --git a/AlphaWallet/Transfer/ViewControllers/ConfirmPaymentViewController.swift b/AlphaWallet/Transfer/ViewControllers/ConfirmPaymentViewController.swift index 85639bfd9..22a63f612 100644 --- a/AlphaWallet/Transfer/ViewControllers/ConfirmPaymentViewController.swift +++ b/AlphaWallet/Transfer/ViewControllers/ConfirmPaymentViewController.swift @@ -89,7 +89,7 @@ class ConfirmPaymentViewController: UIViewController { footerBar.bottomAnchor.constraint(equalTo: view.bottomAnchor), ]) - configurator.load { [weak self] result in + configurator.start { [weak self] result in guard let strongSelf = self else { return } switch result { case .success: diff --git a/AlphaWalletTests/Transfer/Controllers/TransactionConfiguratorTests.swift b/AlphaWalletTests/Transfer/Controllers/TransactionConfiguratorTests.swift index 427bd52ed..7dc382b75 100644 --- a/AlphaWalletTests/Transfer/Controllers/TransactionConfiguratorTests.swift +++ b/AlphaWalletTests/Transfer/Controllers/TransactionConfiguratorTests.swift @@ -8,34 +8,34 @@ class TransactionConfiguratorTests: XCTestCase { func testDefault() { let configurator = TransactionConfigurator(session: .make(), account: .make(), transaction: .make(gasLimit: BigInt(90000), gasPrice: .none)) - + XCTAssertEqual(GasPriceConfiguration.defaultPrice, configurator.configuration.gasPrice) } - + func testAdjustGasPrice() { let desiderGasPrice = BigInt(1000000000) let configurator = TransactionConfigurator(session: .make(), account: .make(), transaction: .make(gasPrice: desiderGasPrice)) - + XCTAssertEqual(desiderGasPrice, configurator.configuration.gasPrice) } - + func testMinGasPrice() { let configurator = TransactionConfigurator(session: .make(), account: .make(), transaction: .make(gasPrice: BigInt(1))) - + XCTAssertEqual(GasPriceConfiguration.minPrice, configurator.configuration.gasPrice) } - + func testMaxGasPrice() { let configurator = TransactionConfigurator(session: .make(), account: .make(), transaction: .make(gasPrice: BigInt(990000000000))) - + XCTAssertEqual(GasPriceConfiguration.maxPrice, configurator.configuration.gasPrice) } - + func testLoadEtherConfiguration() { let configurator = TransactionConfigurator(session: .make(), account: .make(), transaction: .make(gasLimit: BigInt(50000), gasPrice: .none)) - configurator.load { _ in } - + configurator.start { _ in } + XCTAssertEqual(BigInt(GasPriceConfiguration.defaultPrice), configurator.configuration.gasPrice) //gas limit is always 21k for native ether transfers XCTAssertEqual(BigInt(21000), configurator.configuration.gasLimit)