Adapting tests

pull/2/head
Michael Scoff 7 years ago
parent a748d9eb87
commit 83302b05c3
  1. 2
      Trust/Transactions/Types/TransactionAction.swift
  2. 6
      TrustTests/Factories/Transaction.swift
  3. 12
      TrustTests/Settings/RPCServerTests.swift

@ -9,7 +9,7 @@ enum TransactionAction {
extension TransactionAction {
static func from(dict: [String: AnyObject]) -> TransactionAction {
guard let type = dict["type"] as? String else { return .unknown }
guard let type = dict["type"] as? String else { return .unknown }
let actionType = TransactionActionType(string: type)
switch actionType {
case .tokenTransfer:

@ -19,7 +19,8 @@ extension Transaction {
gasUsed: String = "0x1",
confirmations: Int64 = 64,
nonce: String = "0",
date: Date = Date()
date: Date = Date(),
actionJSON: String = ""
) -> Transaction {
return Transaction(
id: id,
@ -36,7 +37,8 @@ extension Transaction {
gasUsed: gasUsed,
confirmations: confirmations,
nonce: nonce,
date: date
date: date,
actionJSON: actionJSON
)
}
}

@ -11,21 +11,9 @@ class RPCServerTests: XCTestCase {
XCTAssertEqual(.main, server)
}
func testRopstenNetwork() {
let server = RPCServer(chainID: 3)
XCTAssertEqual(.ropsten, server)
}
func testKovanNetwork() {
let server = RPCServer(chainID: 42)
XCTAssertEqual(.kovan, server)
}
func testRinkebyNetwork() {
let server = RPCServer(chainID: 4)
XCTAssertEqual(.rinkeby, server)
}
}

Loading…
Cancel
Save