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 all commits
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
8 changes: 4 additions & 4 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/torusresearch/fetch-node-details-swift.git",
"state" : {
"revision" : "5f67cd080c26cf38ae91e7fe63e6217c6e401c07",
"version" : "6.0.2"
"revision" : "4bd96c33ba8d02d9e27190c5c7cedf09cfdfd656",
"version" : "6.0.3"
}
},
{
Expand Down Expand Up @@ -77,8 +77,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/torusresearch/torus-utils-swift",
"state" : {
"revision" : "ff85c3e96bfa29013309b487875c4d9383e4ac80",
"version" : "8.1.1"
"revision" : "608c28404c506983bfec7bbd957632fc0544db8c",
"version" : "8.1.2"
}
}
],
Expand Down
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