allows signing of different erc875 contracts but payment server only processes approved contracts for ecrecover and free import

pull/438/head
James Sangalli 6 years ago
parent 646659c8d8
commit cf09d9530f
  1. 7
      AlphaWallet/Market/Coordinators/UniversalLinkCoordinator.swift
  2. 3
      AlphaWallet/Redeem/ViewControllers/RedeemTicketsQuantitySelectionViewController.swift
  3. 3
      AlphaWallet/Sell/ViewControllers/EnterSellTicketsPriceQuantityViewController.swift
  4. 3
      AlphaWallet/Tokens/Helpers/TicketAdaptor.swift
  5. 4
      AlphaWallet/Tokens/Types/TicketHolder.swift
  6. 4
      AlphaWallet/Transactions/Coordinators/TicketsCoordinator.swift
  7. 3
      AlphaWallet/Transfer/ViewControllers/TransferTicketsQuantitySelectionViewController.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
}

@ -149,7 +149,8 @@ class RedeemTicketsQuantitySelectionViewController: UIViewController {
let tickets = Array(ticketHolder.tickets[..<quantity])
return TicketHolder(
tickets: tickets,
status: ticketHolder.status
status: ticketHolder.status,
contractAddress: ticketHolder.contractAddress
)
}

@ -307,7 +307,8 @@ class EnterSellTicketsPriceQuantityViewController: UIViewController {
let tickets = Array(ticketHolder.tickets[..<quantity])
return TicketHolder(
tickets: tickets,
status: ticketHolder.status
status: ticketHolder.status,
contractAddress: ticketHolder.contractAddress
)
}

@ -88,7 +88,8 @@ class TicketAdaptor {
private func getTicketHolder(for tickets: [Ticket]) -> TicketHolder {
return TicketHolder(
tickets: tickets,
status: .available
status: .available,
contractAddress: token.contract
)
}

@ -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 {

@ -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
)

@ -145,7 +145,8 @@ class TransferTicketsQuantitySelectionViewController: UIViewController {
let tickets = Array(ticketHolder.tickets[..<quantity])
return TicketHolder(
tickets: tickets,
status: ticketHolder.status
status: ticketHolder.status,
contractAddress: ticketHolder.contractAddress
)
}

Loading…
Cancel
Save