diff --git a/AlphaWallet/Market/Coordinators/UniversalLinkCoordinator.swift b/AlphaWallet/Market/Coordinators/UniversalLinkCoordinator.swift index 1ea7a185e..8716f3c81 100644 --- a/AlphaWallet/Market/Coordinators/UniversalLinkCoordinator.swift +++ b/AlphaWallet/Market/Coordinators/UniversalLinkCoordinator.swift @@ -203,14 +203,14 @@ class UniversalLinkCoordinator: Coordinator { } //start at one to slice off address let bytes32Tickets = Array(array[1...]) - completion(self.sortTickets(bytes32Tickets, indices)) + completion(self.sortTickets(bytes32Tickets, indices, signedOrder.order.contractAddress)) } else { completion(nil) } } } - private func sortTickets(_ bytes32Tickets: [String], _ indices: [UInt16]) -> TicketHolder { + private func sortTickets(_ bytes32Tickets: [String], _ indices: [UInt16], _ contractAddress: String) -> TicketHolder { var tickets = [Ticket]() let xmlHandler = XMLHandler() for i in 0...bytes32Tickets.count - 1 { @@ -222,7 +222,8 @@ class UniversalLinkCoordinator: Coordinator { } let ticketHolder = TicketHolder( tickets: tickets, - status: .available + status: .available, + contractAddress: contractAddress ) return ticketHolder } diff --git a/AlphaWallet/Redeem/ViewControllers/RedeemTicketsQuantitySelectionViewController.swift b/AlphaWallet/Redeem/ViewControllers/RedeemTicketsQuantitySelectionViewController.swift index 8c3b95b50..e62a2a559 100644 --- a/AlphaWallet/Redeem/ViewControllers/RedeemTicketsQuantitySelectionViewController.swift +++ b/AlphaWallet/Redeem/ViewControllers/RedeemTicketsQuantitySelectionViewController.swift @@ -149,7 +149,8 @@ class RedeemTicketsQuantitySelectionViewController: UIViewController { let tickets = Array(ticketHolder.tickets[.. TicketHolder { return TicketHolder( tickets: tickets, - status: .available + status: .available, + contractAddress: token.contract ) } diff --git a/AlphaWallet/Tokens/Types/TicketHolder.swift b/AlphaWallet/Tokens/Types/TicketHolder.swift index 19beaf759..8bcaa11fb 100644 --- a/AlphaWallet/Tokens/Types/TicketHolder.swift +++ b/AlphaWallet/Tokens/Types/TicketHolder.swift @@ -26,10 +26,12 @@ class TicketHolder { var status: TicketHolderStatus var isSelected = false var areDetailsVisible = false + var contractAddress: String - init(tickets: [Ticket], status: TicketHolderStatus) { + init(tickets: [Ticket], status: TicketHolderStatus, contractAddress: String) { self.tickets = tickets self.status = status + self.contractAddress = contractAddress } var seatRange: String { diff --git a/AlphaWallet/Transactions/Coordinators/TicketsCoordinator.swift b/AlphaWallet/Transactions/Coordinators/TicketsCoordinator.swift index b8737e8f2..e72b751da 100644 --- a/AlphaWallet/Transactions/Coordinators/TicketsCoordinator.swift +++ b/AlphaWallet/Transactions/Coordinators/TicketsCoordinator.swift @@ -283,7 +283,7 @@ class TicketsCoordinator: NSObject, Coordinator { price: BigUInt("0")!, indices: ticketHolder.indices, expiry: BigUInt(Int(linkExpiryDate.timeIntervalSince1970)), - contractAddress: TicketsCoordinator.getContractAddressForLinks(), + contractAddress: ticketHolder.contractAddress, start: BigUInt("0")!, count: ticketHolder.indices.count ) @@ -306,7 +306,7 @@ class TicketsCoordinator: NSObject, Coordinator { price: wei, indices: ticketHolder.indices, expiry: BigUInt(Int(linkExpiryDate.timeIntervalSince1970)), - contractAddress: TicketsCoordinator.getContractAddressForLinks(), + contractAddress: ticketHolder.contractAddress, start: BigUInt("0")!, count: ticketHolder.indices.count ) diff --git a/AlphaWallet/Transfer/ViewControllers/TransferTicketsQuantitySelectionViewController.swift b/AlphaWallet/Transfer/ViewControllers/TransferTicketsQuantitySelectionViewController.swift index c57c9eb5b..09c8894fa 100644 --- a/AlphaWallet/Transfer/ViewControllers/TransferTicketsQuantitySelectionViewController.swift +++ b/AlphaWallet/Transfer/ViewControllers/TransferTicketsQuantitySelectionViewController.swift @@ -145,7 +145,8 @@ class TransferTicketsQuantitySelectionViewController: UIViewController { let tickets = Array(ticketHolder.tickets[..