Skip to content

Commit

Permalink
Fix a keychain storage visibility issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
kukabi committed Jun 17, 2024
1 parent 2bd60e4 commit cbbff8b
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ let package = Package(
// ...
.package(
url: "https://github.com/helikon-labs/subvt-data-swift.git",
.upToNextMinor(from: "0.17.0")
.upToNextMinor(from: "0.17.1")
)
],
targets: [
Expand Down
2 changes: 1 addition & 1 deletion Sources/SubVTData/Service/REST/Auth/AuthStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ protocol AuthStorage: AnyObject {
Keychain authentication storage.
*/
public class KeychainStorage: AuthStorage {
static let shared: KeychainStorage = KeychainStorage()
public static let shared: KeychainStorage = KeychainStorage()
var privateKey: PrivateKey
var publicKey: PublicKey
private let keychain = Keychain(service: "io.helikon.subvt.data")
Expand Down
11 changes: 1 addition & 10 deletions Sources/SubVTData/Util/Logging.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,4 @@

import SwiftyBeaver

let log = logger()

fileprivate func logger() -> SwiftyBeaver.Type {
let log = SwiftyBeaver.self
let console = ConsoleDestination()
if !log.destinations.contains(console) {
log.addDestination(console)
}
return log
}
let log = SwiftyBeaver.self
8 changes: 8 additions & 0 deletions Tests/SubVTDataTests/BaseTest.swift
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
import Combine
import SwiftyBeaver
import XCTest
@testable import SubVTData

func initLog() {
let console = ConsoleDestination()
log.addDestination(console)
}


class BaseTest: XCTestCase {
private var cancellables: Set<AnyCancellable>!

override func setUp() {
initLog()
cancellables = []
}

Expand Down
5 changes: 5 additions & 0 deletions Tests/SubVTDataTests/ModelTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ import Foundation
import XCTest

final class Model: XCTestCase {

override func setUp() {
initLog()
}

func testBalanceAdd() {
XCTAssertEqual(
Balance(integerLiteral: 123) + Balance(integerLiteral: 345),
Expand Down
1 change: 1 addition & 0 deletions Tests/SubVTDataTests/NetworkStatusServiceTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ final class NetworkStatusServiceTests: XCTestCase {
private var cancellables: Set<AnyCancellable>!

override func setUp() {
initLog()
cancellables = []
}

Expand Down
1 change: 1 addition & 0 deletions Tests/SubVTDataTests/ValidatorDetailsServiceTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ final class ValidatorDetailsServiceTests: XCTestCase {
private var cancellables: Set<AnyCancellable>!

override func setUp() {
initLog()
cancellables = []
}

Expand Down
1 change: 1 addition & 0 deletions Tests/SubVTDataTests/ValidatorListServiceTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ final class ValidatorListServiceTests: XCTestCase {
private var cancellables: Set<AnyCancellable>!

override func setUp() {
initLog()
cancellables = []
}

Expand Down

0 comments on commit cbbff8b

Please sign in to comment.