Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
metalurgical committed Mar 15, 2024
1 parent 2c45c8a commit 7ad67f0
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 27 deletions.
6 changes: 0 additions & 6 deletions Tests/TorusUtilsTests/AquaTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class AquaTest: XCTestCase {
XCTAssertEqual(val.metadata?.nonce, 0)
XCTAssertEqual(val.metadata?.upgraded, false)
XCTAssertEqual(val.metadata?.typeOfUser, UserType(rawValue: "v1"))
XCTAssertEqual(val.nodesData?.nodeIndexes.count, 0)
}

func test_should_fetch_user_type_and_public_addresses() async throws {
Expand All @@ -61,7 +60,6 @@ class AquaTest: XCTestCase {
XCTAssertEqual(val.metadata?.nonce, 0)
XCTAssertEqual(val.metadata?.upgraded, false)
XCTAssertEqual(val.metadata?.typeOfUser, .v2)
XCTAssertEqual(val.nodesData?.nodeIndexes.count, 0)

verifier = "tkey-google-aqua"
verifierID = "[email protected]"
Expand All @@ -76,7 +74,6 @@ class AquaTest: XCTestCase {
XCTAssertEqual(val.metadata?.nonce, 0)
XCTAssertEqual(val.metadata?.upgraded, false)
XCTAssertEqual(val.metadata?.typeOfUser, .v2)
XCTAssertEqual(val.nodesData?.nodeIndexes.count, 0)

verifierID = "[email protected]"
val = try await tu.getUserTypeAndAddress(endpoints: nodeDetails.getTorusNodeEndpoints(), torusNodePubs: nodeDetails.getTorusNodePub(), verifier: verifier, verifierId: verifierID)
Expand All @@ -89,7 +86,6 @@ class AquaTest: XCTestCase {
XCTAssertEqual(val.metadata?.nonce, 0)
XCTAssertEqual(val.metadata?.upgraded, false)
XCTAssertEqual(val.metadata?.typeOfUser, .v2)
XCTAssertEqual(val.nodesData?.nodeIndexes.count, 0)
}

func test_key_assign() async throws {
Expand Down Expand Up @@ -127,7 +123,6 @@ class AquaTest: XCTestCase {
XCTAssertEqual(data.metadata?.nonce, BigUInt(0))
XCTAssertEqual(data.metadata?.typeOfUser, .v1)
XCTAssertEqual(data.metadata?.upgraded, nil)
XCTAssertEqual(data.nodesData?.nodeIndexes.count, 0)
}

func test_aggregate_login() async throws {
Expand All @@ -153,7 +148,6 @@ class AquaTest: XCTestCase {
XCTAssertEqual(data.metadata?.nonce, BigUInt(0))
XCTAssertEqual(data.metadata?.typeOfUser, .v1)
XCTAssertEqual(data.metadata?.upgraded, nil)
XCTAssertEqual(data.nodesData?.nodeIndexes.count, 0)
}
}

Expand Down
3 changes: 0 additions & 3 deletions Tests/TorusUtilsTests/CyanTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class CyanTest: XCTestCase {
XCTAssertEqual(val.metadata?.nonce, 0)
XCTAssertEqual(val.metadata?.upgraded, false)
XCTAssertEqual(val.metadata?.typeOfUser, UserType(rawValue: "v1"))
XCTAssertEqual(val.nodesData?.nodeIndexes.count, 0)
}

func test_get_user_type_and_addresses() async throws {
Expand Down Expand Up @@ -131,7 +130,6 @@ class CyanTest: XCTestCase {
XCTAssertEqual(data.metadata?.nonce, BigUInt(0))
XCTAssertEqual(data.metadata?.typeOfUser, .v1)
XCTAssertEqual(data.metadata?.upgraded, nil)
XCTAssertEqual(data.nodesData?.nodeIndexes.count, 0)
}

func test_aggregate_login() async throws {
Expand All @@ -157,6 +155,5 @@ class CyanTest: XCTestCase {
XCTAssertEqual(data.metadata?.nonce, BigUInt(0))
XCTAssertEqual(data.metadata?.typeOfUser, .v1)
XCTAssertEqual(data.metadata?.upgraded, nil)
XCTAssertEqual(data.nodesData?.nodeIndexes.count, 0)
}
}
6 changes: 0 additions & 6 deletions Tests/TorusUtilsTests/MainnetTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ class MainnetTests: XCTestCase {
XCTAssertEqual(val.metadata?.nonce, 0)
XCTAssertEqual(val.metadata?.upgraded, false)
XCTAssertEqual(val.metadata?.typeOfUser, UserType(rawValue: "v1"))
XCTAssertEqual(val.nodesData?.nodeIndexes.count, 0)
}

func test_fetch_user_type_and_addresses() async throws {
Expand All @@ -70,7 +69,6 @@ class MainnetTests: XCTestCase {
XCTAssertEqual(val.metadata?.nonce, 0)
XCTAssertEqual(val.metadata?.upgraded, false)
XCTAssertEqual(val.metadata?.typeOfUser, .v2)
XCTAssertEqual(val.nodesData?.nodeIndexes.count, 0)

let verifier2: String = "tkey-google"
let verifierID2: String = "[email protected]"
Expand All @@ -87,7 +85,6 @@ class MainnetTests: XCTestCase {
XCTAssertEqual(val.metadata?.nonce, 0)
XCTAssertEqual(val.metadata?.upgraded, false)
XCTAssertEqual(val.metadata?.typeOfUser, UserType(rawValue: "v2"))
XCTAssertEqual(val.nodesData?.nodeIndexes.count, 0)

let verifier3: String = "tkey-google"
let verifierID3: String = "[email protected]"
Expand All @@ -104,7 +101,6 @@ class MainnetTests: XCTestCase {
XCTAssertEqual(val.metadata?.nonce, 0)
XCTAssertEqual(val.metadata?.upgraded, false)
XCTAssertEqual(val.metadata?.typeOfUser, .v2)
XCTAssertEqual(val.nodesData?.nodeIndexes.count, 0)
}

func test_key_assign() async throws {
Expand Down Expand Up @@ -148,7 +144,6 @@ class MainnetTests: XCTestCase {
XCTAssertEqual(data.metadata?.nonce, BigUInt(0))
XCTAssertEqual(data.metadata?.typeOfUser, .v1)
XCTAssertEqual(data.metadata?.upgraded, nil)
XCTAssertEqual(data.nodesData?.nodeIndexes.count, 0)
}

func test_aggregate_login() async throws {
Expand Down Expand Up @@ -176,6 +171,5 @@ class MainnetTests: XCTestCase {
XCTAssertEqual(data.metadata?.nonce, BigUInt(0))
XCTAssertEqual(data.metadata?.typeOfUser, .v1)
XCTAssertEqual(data.metadata?.upgraded, nil)
XCTAssertEqual(data.nodesData?.nodeIndexes.count, 0)
}
}
7 changes: 0 additions & 7 deletions Tests/TorusUtilsTests/SapphireTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ final class SapphireTest: XCTestCase {
XCTAssertEqual(val.metadata?.nonce, BigUInt.zero)
XCTAssertEqual(val.metadata?.upgraded, false)
XCTAssertEqual(val.metadata?.typeOfUser, UserType(rawValue: "v2"))
XCTAssertEqual(val.nodesData?.nodeIndexes.count, 5)
}

func testKeepPublicAddressSame() async throws {
Expand Down Expand Up @@ -125,7 +124,6 @@ final class SapphireTest: XCTestCase {
XCTAssertEqual(data.metadata?.nonce?.serialize().hexString, "b7d126751b68ecd09e371a23898e6819dee54708a5ead4f6fe83cdc79c0f1c4a")
XCTAssertEqual(data.metadata?.typeOfUser, .v2)
XCTAssertEqual(data.metadata?.upgraded, false)
XCTAssertNotEqual(data.nodesData?.nodeIndexes.count, 0)
}

func testNewUserLogin() async throws {
Expand Down Expand Up @@ -160,7 +158,6 @@ final class SapphireTest: XCTestCase {
XCTAssertNotEqual(data.sessionData?.sessionAuthKey, "")
XCTAssertNotEqual(data.metadata?.pubNonce?.x, "")
XCTAssertNotEqual(data.metadata?.pubNonce?.y, "")
XCTAssertNotEqual(data.nodesData?.nodeIndexes.count, 0)
}

func testNodeDownAbleToLogin() async throws {
Expand Down Expand Up @@ -191,7 +188,6 @@ final class SapphireTest: XCTestCase {
XCTAssertEqual(data.metadata?.nonce?.serialize().hexString, "b7d126751b68ecd09e371a23898e6819dee54708a5ead4f6fe83cdc79c0f1c4a")
XCTAssertEqual(data.metadata?.typeOfUser, .v2)
XCTAssertEqual(data.metadata?.upgraded, false)
XCTAssertNotEqual(data.nodesData?.nodeIndexes.count, 0)
}

func testPubAdderessOfTssVerifierId() async throws {
Expand All @@ -214,7 +210,6 @@ final class SapphireTest: XCTestCase {
XCTAssertEqual(pubAddress.metadata?.nonce, BigUInt("0"))
XCTAssertEqual(pubAddress.metadata?.upgraded, false)
XCTAssertEqual(pubAddress.metadata?.typeOfUser, UserType(rawValue: "v2"))
XCTAssertEqual(pubAddress.nodesData?.nodeIndexes.count, 3)
}

func testAssignKeyToTssVerifier() async throws {
Expand Down Expand Up @@ -271,7 +266,6 @@ final class SapphireTest: XCTestCase {
XCTAssertEqual(pubAddress.metadata?.nonce, BigUInt.zero)
XCTAssertEqual(pubAddress.metadata?.upgraded, false)
XCTAssertEqual(pubAddress.metadata?.typeOfUser, UserType(rawValue: "v2"))
XCTAssertTrue(pubAddress.nodesData!.nodeIndexes.count >= 3)
}

func testLoginWhenHashEnabled() async throws {
Expand All @@ -297,7 +291,6 @@ final class SapphireTest: XCTestCase {
XCTAssertEqual(result.metadata?.nonce?.serialize().hexString, "8e80e560ae59319938f7ef727ff2c5346caac1c7f5be96d3076e3342ad1d20b7")
XCTAssertEqual(result.metadata?.typeOfUser, .v2)
XCTAssertEqual(result.metadata?.upgraded, false)
XCTAssertNotEqual(result.nodesData?.nodeIndexes.count, 0)
}

func testAggregrateLoginWithEmail(email: String) async throws {
Expand Down
6 changes: 1 addition & 5 deletions Tests/TorusUtilsTests/TestnetTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class TestnetTest: XCTestCase {
XCTAssertEqual(val.metadata?.nonce, 0)
XCTAssertEqual(val.metadata?.upgraded, false)
XCTAssertEqual(val.metadata?.typeOfUser, UserType(rawValue: "v1"))
XCTAssertEqual(val.nodesData?.nodeIndexes.count, 0)
}

func test_getUserTypeAndAddress_testnet() async throws {
Expand All @@ -61,7 +60,6 @@ class TestnetTest: XCTestCase {
XCTAssertEqual(val.metadata?.nonce, 0)
XCTAssertEqual(val.metadata?.upgraded, false)
XCTAssertEqual(val.metadata?.typeOfUser, .v2)
XCTAssertEqual(val.nodesData?.nodeIndexes.count, 0)
}

/* TODO: Investigate further
Expand Down Expand Up @@ -100,7 +98,6 @@ class TestnetTest: XCTestCase {
XCTAssertEqual(data.metadata?.nonce, BigUInt(0))
XCTAssertEqual(data.metadata?.typeOfUser, .v1)
XCTAssertEqual(data.metadata?.upgraded, nil)
XCTAssertEqual(data.nodesData?.nodeIndexes.count, 0)
}

func test_aggregate_login_testnet() async throws {
Expand All @@ -126,8 +123,7 @@ class TestnetTest: XCTestCase {
XCTAssertEqual(data.metadata?.nonce, BigUInt(0))
XCTAssertEqual(data.metadata?.typeOfUser, .v1)
XCTAssertEqual(data.metadata?.upgraded, nil)
XCTAssertEqual(data.nodesData?.nodeIndexes.count, 0)
}
}
}

extension TestnetTest {
Expand Down

0 comments on commit 7ad67f0

Please sign in to comment.