Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update getKey function to return evmAddress rather than publicKey. #20

Merged
merged 2 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 0 additions & 86 deletions Package.resolved

This file was deleted.

2 changes: 1 addition & 1 deletion Sources/SingleFactorAuth/SingleFactorAuth.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public class SingleFactorAuth {
public func getKey(loginParams: LoginParams) async throws -> TorusSFAKey {
let torusKey = try await self.getTorusKey(loginParams: loginParams)

let publicAddress = (torusKey.finalKeyData?.X ?? "") + (torusKey.finalKeyData?.Y ?? "")
let publicAddress = torusKey.finalKeyData?.evmAddress ?? ""
chaitanyapotti marked this conversation as resolved.
Show resolved Hide resolved
let privateKey = torusKey.finalKeyData?.privKey ?? ""

let torusSfaKey = TorusSFAKey(privateKey: privateKey, publicAddress: publicAddress)
Expand Down
4 changes: 2 additions & 2 deletions Tests/SingleFactorAuthTests/AquaTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ final class AquaTest: XCTestCase {

let requiredPrivateKey = "d8204e9f8c270647294c54acd8d49ee208789f981a7503158e122527d38626d8"
XCTAssertEqual(requiredPrivateKey, torusKey.getPrivateKey())
XCTAssertEqual(torusKey.publicAddress, torusKey.getPublicAddress())
XCTAssertEqual("0x8b32926cD9224fec3B296aA7250B049029434807", torusKey.getPublicAddress())
}

func testInitialise() async throws {
Expand All @@ -44,6 +44,6 @@ final class AquaTest: XCTestCase {

let requiredPrivateKey = "6f8b884f19975fb0d138ed21b22a6a7e1b79e37f611d0a29f1442b34efc6bacd"
XCTAssertEqual(requiredPrivateKey, torusKey.getPrivateKey())
XCTAssertEqual(torusKey.publicAddress, torusKey.getPublicAddress())
XCTAssertEqual("0x62BaCa60f48C2b2b7e3074f7B7b4795EeF2afD2e", torusKey.getPublicAddress())
}
}
4 changes: 2 additions & 2 deletions Tests/SingleFactorAuthTests/CyanTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ final class CyanTest: XCTestCase {

let requiredPrivateKey = "223d982054fa1ad27d1497560521e4cce5b8c6438c38533c7bad27ff21ce0546"
XCTAssertEqual(requiredPrivateKey, torusKey.getPrivateKey())
XCTAssertEqual(torusKey.publicAddress, torusKey.getPublicAddress())
XCTAssertEqual("0x6b902fBCEb0E0374e5eB9eDFe68cD4B888c32150", torusKey.getPublicAddress())
}

func testInitialise() async throws {
Expand All @@ -44,6 +44,6 @@ final class CyanTest: XCTestCase {

let requiredPrivateKey = "66af498ea82c95d52fdb8c8dedd44cf2f758424a0eecab7ac3dd8721527ea2d4"
XCTAssertEqual(requiredPrivateKey, torusKey.getPrivateKey())
XCTAssertEqual(torusKey.publicAddress, torusKey.getPublicAddress())
XCTAssertEqual("0xFF4c4A0Aa5D633302B5711C3047D7D5967884521", torusKey.getPublicAddress())
}
}
4 changes: 2 additions & 2 deletions Tests/SingleFactorAuthTests/SingleFactorAuthTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ final class SingleFactorAuthTests: XCTestCase {
let torusKey = try await singleFactoreAuth.getKey(loginParams: loginParams)
let requiredPrivateKey = "296045a5599afefda7afbdd1bf236358baff580a0fe2db62ae5c1bbe817fbae4"
XCTAssertEqual(requiredPrivateKey, torusKey.getPrivateKey())
XCTAssertEqual(torusKey.publicAddress, torusKey.getPublicAddress())
XCTAssertEqual("0x53010055542cCc0f2b6715a5c53838eC4aC96EF7", torusKey.getPublicAddress())
}

func testInitialise() async throws {
Expand All @@ -43,6 +43,6 @@ final class SingleFactorAuthTests: XCTestCase {

let requiredPrivateKey = "ad47959db4cb2e63e641bac285df1b944f54d1a1cecdaeea40042b60d53c35d2"
XCTAssertEqual(requiredPrivateKey, torusKey.getPrivateKey())
XCTAssertEqual(torusKey.publicAddress, torusKey.getPublicAddress())
XCTAssertEqual("0xE1155dB406dAD89DdeE9FB9EfC29C8EedC2A0C8B", torusKey.getPublicAddress())
}
}
Loading