update contract, changed result to any (change back later)

pull/86/head
James Sangalli 7 years ago
parent 811366cd28
commit 4c7df8b122
  1. 2
      Trust/Market/OrdersRequest.swift
  2. 8
      Trust/Tokens/Coordinators/ClaimOrderCoordinator.swift
  3. 3
      Trust/Tokens/Types/TokensDataStore.swift
  4. 2
      Trust/Tokens/ViewControllers/NewTokenViewController.swift

@ -20,7 +20,7 @@ import BigInt
public class OrdersRequest {
public let baseURL = "https://482kdh4npg.execute-api.ap-southeast-1.amazonaws.com/dev/"
public let contractAddress = "0xbc9a1026a4bc6f0ba8bbe486d1d09da5732b39e4"
public let contractAddress = "0x84DFD837931954c6ca515516598468564308bde6"
private let methodSig = "0xa6fb475f"
public func getOrders(callback: @escaping (_ result : Any) -> Void) {

@ -25,18 +25,18 @@ class ClaimOrderCoordinator {
v: UInt8,
r: String,
s: String,
completion: @escaping (Result<Void, AnyError>) -> Void
completion: @escaping (Any) -> Void//Result<Void, AnyError>) -> Void
) {
let request = ClaimStormBirdOrder(expiry: expiry, indices: indices, v: v, r: r, s: s)
web3.request(request: request) { result in
self.web3.request(request: request) { result in
switch result {
//TODO handle cases for UI
case .success(let res):
print(res)
//completion(res)
completion(res)
case .failure(let err):
print(err)
//completion(err)
completion(err)
}
}

@ -165,12 +165,13 @@ class TokensDataStore {
}
}
//Result<Void, AnyError>
func claimOrder(ticketIndices: [UInt16],
expiry: BigUInt,
v: UInt8,
r: String,
s: String,
completion: @escaping(Result<Void, AnyError>) -> Void) {
completion: @escaping(Any) -> Void) {
claimOrderCoordinator.claimOrder(indices: ticketIndices, expiry: expiry, v: v, r: r, s: s) { result in
completion(result)
}

@ -181,7 +181,7 @@ class NewTokenViewController: FormViewController {
// return displayError(error: Errors.invalidAddress)
// }
updateContractValue(value: "0xbC9a1026A4BC6F0BA8Bbe486d1D09dA5732B39e4")
updateContractValue(value: "0x84DFD837931954c6ca515516598468564308bde6")
}
private func updateContractValue(value: String) {

Loading…
Cancel
Save