removes unused calls to heroku server

pull/1120/head
James Sangalli 6 years ago
parent 1ee5a66b94
commit e0198bd82e
  1. 12
      AlphaWallet.xcodeproj/project.pbxproj
  2. 38
      AlphaWallet/Redeem/Helpers/RedeemEventListener.swift
  3. 33
      AlphaWallet/Redeem/Rest/EventsRest.swift
  4. 25
      AlphaWallet/Redeem/ViewControllers/TokenCardRedemptionViewController.swift
  5. 13
      AlphaWallet/Rest/EndPoints.swift

@ -215,16 +215,13 @@
442FC258BAEFDE2D64E48D0D /* TokensCardCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 442FCC8150042FE9179D574A /* TokensCardCoordinator.swift */; };
442FC2CC21FFFC4FAB33A300 /* Token.swift in Sources */ = {isa = PBXBuildFile; fileRef = 442FC90F0768C43EF903465B /* Token.swift */; };
442FC546ED56F5C9D3D35471 /* TokenCardRedemptionViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 442FCBDB86579889BC773540 /* TokenCardRedemptionViewModel.swift */; };
442FC54FB6CADF0461F6C95F /* RedeemEventListener.swift in Sources */ = {isa = PBXBuildFile; fileRef = 442FC57AD0C04FAB66FB834D /* RedeemEventListener.swift */; };
442FC58B7558F28F9452D383 /* GetIsERC875ContractCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 442FCEBC98D0A367D258D2C3 /* GetIsERC875ContractCoordinator.swift */; };
442FC5F70AF003F331F7C841 /* GetSymbolCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 442FCB2726DB345481C1FDA1 /* GetSymbolCoordinator.swift */; };
442FC65BFA2D42879648EC06 /* Int.swift in Sources */ = {isa = PBXBuildFile; fileRef = 442FCCAC6A172506637A2FF6 /* Int.swift */; };
442FC7777D495D3095836CA6 /* RedeemTokenCardViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 442FCB2915417EB871E40D6C /* RedeemTokenCardViewModel.swift */; };
442FC81F38F80EEF54C69C5B /* TokenAdaptor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 442FC20E6470B92A46479342 /* TokenAdaptor.swift */; };
442FC8E82231273273B95D85 /* FakeClaimOrderCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 442FCE526E2089CAE88D5602 /* FakeClaimOrderCoordinator.swift */; };
442FCACD46848927C84DE66E /* EndPoints.swift in Sources */ = {isa = PBXBuildFile; fileRef = 442FC203B8266AB92D8F4032 /* EndPoints.swift */; };
442FCAD7292D93C261B97D09 /* TokenHolder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 442FCFEB2D7443C4E0B889B0 /* TokenHolder.swift */; };
442FCB593844F3B8F74BC8C5 /* EventsRest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 442FC94DC1CA79FE4F3360E2 /* EventsRest.swift */; };
442FCB9CF5BC243F0705F4FE /* TokenCardRedemptionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 442FCACD2BF4DD90BD9C6DBC /* TokenCardRedemptionViewController.swift */; };
442FCBA4A5E39A4C4B16426A /* EventsRestTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 442FCBCF749F0FDA53FB88A3 /* EventsRestTest.swift */; };
442FCBBFCC5926B4D416E6D3 /* GetNameCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 442FC630874D29159799EEB6 /* GetNameCoordinator.swift */; };
@ -828,14 +825,11 @@
442FC002CDEA792B8ECD3E13 /* GetERC875BalanceCoordinator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GetERC875BalanceCoordinator.swift; sourceTree = "<group>"; };
442FC084706C14853B4A7B31 /* Event.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Event.swift; sourceTree = "<group>"; };
442FC0F2E3BB3EE420BC2C16 /* GetDecimalsCoordinator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GetDecimalsCoordinator.swift; sourceTree = "<group>"; };
442FC203B8266AB92D8F4032 /* EndPoints.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EndPoints.swift; sourceTree = "<group>"; };
442FC20E6470B92A46479342 /* TokenAdaptor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TokenAdaptor.swift; sourceTree = "<group>"; };
442FC54DA900FA2F9BB73A63 /* RedeemTokenCardQuantitySelectionViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RedeemTokenCardQuantitySelectionViewModel.swift; sourceTree = "<group>"; };
442FC575B6A4A50B0555E1B0 /* NumberStepper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NumberStepper.swift; sourceTree = "<group>"; };
442FC57AD0C04FAB66FB834D /* RedeemEventListener.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RedeemEventListener.swift; sourceTree = "<group>"; };
442FC630874D29159799EEB6 /* GetNameCoordinator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GetNameCoordinator.swift; sourceTree = "<group>"; };
442FC90F0768C43EF903465B /* Token.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Token.swift; sourceTree = "<group>"; };
442FC94DC1CA79FE4F3360E2 /* EventsRest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EventsRest.swift; sourceTree = "<group>"; };
442FCACD2BF4DD90BD9C6DBC /* TokenCardRedemptionViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TokenCardRedemptionViewController.swift; sourceTree = "<group>"; };
442FCB182F854B307761CD82 /* TokensCardViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TokensCardViewModel.swift; sourceTree = "<group>"; };
442FCB2726DB345481C1FDA1 /* GetSymbolCoordinator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GetSymbolCoordinator.swift; sourceTree = "<group>"; };
@ -2383,7 +2377,6 @@
442FC8E0B13CA90882F8BBA6 /* Rest */ = {
isa = PBXGroup;
children = (
442FC94DC1CA79FE4F3360E2 /* EventsRest.swift */,
);
path = Rest;
sourceTree = "<group>";
@ -3100,7 +3093,6 @@
AA574E612054EC8B00F4B3AF /* Rest */ = {
isa = PBXGroup;
children = (
442FC203B8266AB92D8F4032 /* EndPoints.swift */,
AA574E622054ECA400F4B3AF /* RestClient.swift */,
);
path = Rest;
@ -3111,7 +3103,6 @@
children = (
76F1DF80932454E9F58B7830 /* CreateRedeem.swift */,
AAEF2CAA2050A68A0038BE0D /* SignatureHelper.swift */,
442FC57AD0C04FAB66FB834D /* RedeemEventListener.swift */,
);
path = Helpers;
sourceTree = "<group>";
@ -3828,12 +3819,9 @@
5E7C75F80A7E178B49830BCD /* TokenCardsViewControllerHeader.swift in Sources */,
5E7C7E5C30EFDC70DF1E00C1 /* TokensCardViewControllerHeaderViewModel.swift in Sources */,
5E7C7B3E08EEA63C5B68B9C4 /* TokenCardRedemptionInfoViewController.swift in Sources */,
442FCACD46848927C84DE66E /* EndPoints.swift in Sources */,
442FCB593844F3B8F74BC8C5 /* EventsRest.swift in Sources */,
442FCC0C672901AF791D320F /* Event.swift in Sources */,
442FC01053E2F1B59355A961 /* Arguments.swift in Sources */,
5E7C7CF06533EDACC8E220B3 /* StaticHTMLViewController.swift in Sources */,
442FC54FB6CADF0461F6C95F /* RedeemEventListener.swift in Sources */,
5E7C7D71D3184F44C397FFE7 /* HelpViewController.swift in Sources */,
5E7C7D8173CB1089D622DA38 /* HelpViewCell.swift in Sources */,
5E7C72C8A15397C5A40BFE76 /* WhatIsEthereumInfoViewController.swift in Sources */,

@ -1,38 +0,0 @@
//
// RedeemEventListener.swift
// Alpha-Wallet
//
// Created by Oguzhan Gungor on 3/12/18.
// Copyright © 2018 Alpha-Wallet. All rights reserved.
//
import Foundation
import TrustKeystore
class RedeemEventListener {
var shouldListen = false
func start(for address: Address,
completion: @escaping () -> Void) {
if !shouldListen {
return
}
EventsRest().getEvents(for: address, completion: { [weak self] result in
guard let strongSelf = self else { return }
print(result)
switch result {
case .success(let events):
print(events)
completion()
case .failure(let error):
print(error)
strongSelf.start(for: address, completion: completion)
}
})
}
func stop() {
shouldListen = false
RestClient.cancel()
}
}

@ -1,33 +0,0 @@
//
// EventsRest.swift
// Alpha-Wallet
//
// Created by Oguzhan Gungor on 3/11/18.
// Copyright © 2018 Alpha-Wallet. All rights reserved.
//
import Foundation
import Result
import TrustKeystore
public class EventsRest {
func getEvents(for address: Address,
completion: @escaping (Result<[Event], AnyError>) -> Void) {
let endpoint = EndPoints.EventBaseUrl + "/" + address.description.lowercased()
print(endpoint)
RestClient.get(endPoint: endpoint, completion: { response in
guard let statusCode = response.response?.statusCode else {
completion(.failure(AnyError(response.error!)))
return
}
if 200...299 ~= statusCode { // success
completion(.success([]))
} else {
//String not displayed to user
completion(.failure(AnyError(RestError.invalidResponse("Could not parse data"))))
}
})
}
}

@ -19,7 +19,6 @@ class TokenCardRedemptionViewController: UIViewController, TokenVerifiableStatus
private var timer: Timer!
private var session: WalletSession
private let token: TokenObject
private let redeemListener = RedeemEventListener()
let config: Config
var contract: String {
@ -93,30 +92,6 @@ class TokenCardRedemptionViewController: UIViewController, TokenVerifiableStatus
fatalError("init(coder:) has not been implemented")
}
override
func viewDidLoad() {
super.viewDidLoad()
timer = Timer.scheduledTimer(timeInterval: 30,
target: self,
selector: #selector(configureUI),
userInfo: nil,
repeats: true)
redeemListener.shouldListen = true
redeemListener.start(for: session.account.address,
completion: { [weak self] in
guard let strongSelf = self else { return }
strongSelf.redeemListener.stop()
strongSelf.showSuccessMessage()
})
}
override
func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
invalidateTimer()
redeemListener.stop()
}
@objc
private func configureUI() {
let redeem = CreateRedeem(config: session.config, token: token)

@ -1,13 +0,0 @@
//
// EndPoints.swift
// Alpha-Wallet
//
// Created by Oguzhan Gungor on 3/11/18.
// Copyright © 2018 Alpha-Wallet. All rights reserved.
//
import Foundation
struct EndPoints {
static let EventBaseUrl = "https://blockchainapis.herokuapp.com/ticketpro/checkEventsUnconfirmed"
}
Loading…
Cancel
Save