Skip to content

Commit

Permalink
De-smurf naming
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelBCarter committed Nov 11, 2024
1 parent b48f150 commit f681d13
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Sources/XyoClient/ApiConfig.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
public class XyoApiConfig {
public class ApiConfig {
var apiDomain: String
var token: String?

Expand Down
2 changes: 1 addition & 1 deletion Sources/XyoClient/ArchivistApi/ArchivistApiConfig.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
public class XyoArchivistApiConfig: XyoApiConfig {
public class XyoArchivistApiConfig: ApiConfig {
var apiModule: String
public init(_ apiModule: String, _ apiDomain: String, _ token: String? = nil) {
self.apiModule = apiModule
Expand Down
2 changes: 1 addition & 1 deletion Sources/XyoClient/BoundWitness/BoundWitnessBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class BoundWitnessBuilder {
return self
}

public func witnesses(_ witnesses: [XyoWitness]) -> BoundWitnessBuilder {
public func witnesses(_ witnesses: [AbstractWitness]) -> BoundWitnessBuilder {
_witnesses.append(contentsOf: witnesses.map { witness in witness.address })
_previous_hashes.append(contentsOf: witnesses.map { witness in witness.previousHash })
return self
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open class XyoModule: Module {
open class AbstractModule: Module {
public let address: XyoAddress
public var previousHash: String?

Expand Down
12 changes: 6 additions & 6 deletions Sources/XyoClient/XyoPanel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ public enum XyoPanelError: Error {

public class XyoPanel {

public init(archivists: [XyoArchivistApiClient], witnesses: [XyoWitness]) {
public init(archivists: [XyoArchivistApiClient], witnesses: [AbstractWitness]) {
self._archivists = archivists
self._witnesses = witnesses
}

public convenience init(
archive: String? = nil, apiDomain: String? = nil, witnesses: [XyoWitness]? = nil,
archive: String? = nil, apiDomain: String? = nil, witnesses: [AbstractWitness]? = nil,
token: String? = nil
) {
let apiConfig = XyoArchivistApiConfig(
Expand All @@ -23,7 +23,7 @@ public class XyoPanel {

public convenience init(observe: (() -> XyoEventPayload?)?) {
if observe != nil {
var witnesses = [XyoWitness]()
var witnesses = [AbstractWitness]()

if let observe = observe {
witnesses.append(XyoEventWitness(observe))
Expand All @@ -38,7 +38,7 @@ public class XyoPanel {
public typealias XyoPanelReportCallback = (([String]) -> Void)

private var _archivists: [XyoArchivistApiClient]
private var _witnesses: [XyoWitness]
private var _witnesses: [AbstractWitness]
private var _previous_hash: String?

public func report() throws -> [XyoPayload] {
Expand All @@ -50,11 +50,11 @@ public class XyoPanel {
}

public func report(
_ adhocWitnesses: [XyoWitness], _ closure: XyoPanelReportCallback?
_ adhocWitnesses: [AbstractWitness], _ closure: XyoPanelReportCallback?
) throws
-> [XyoPayload]
{
var witnesses: [XyoWitness] = []
var witnesses: [AbstractWitness] = []
witnesses.append(contentsOf: adhocWitnesses)
witnesses.append(contentsOf: self._witnesses)
let payloads = witnesses.map { witness in
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open class XyoWitness: XyoModule, Witness {
open class AbstractWitness: AbstractModule, Witness {
open func observe() -> [XyoPayload] {
preconditionFailure("This method must be overridden")
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/XyoClient/XyoWitness/Basic/BasicWitness.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

open class XyoBasicWitness: XyoWitness {
open class XyoBasicWitness: AbstractWitness {

public typealias TPayloadOut = XyoPayload

Expand Down
2 changes: 1 addition & 1 deletion Sources/XyoClient/XyoWitness/Event/EventWitness.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

open class XyoEventWitness: XyoWitness {
open class XyoEventWitness: AbstractWitness {

public init(_ observer: @escaping ObserverClosure) {
_observer = observer
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

open class XyoSystemInfoWitness: XyoWitness {
open class XyoSystemInfoWitness: AbstractWitness {

var allowPathMonitor: Bool

Expand Down
2 changes: 1 addition & 1 deletion Tests/XyoClientTests/Panel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class PanelTests: XCTestCase {
let apiDomain = XyoPanel.Defaults.apiDomain
let archive = XyoPanel.Defaults.apiModule
let address = XyoAddress()
let witness = XyoWitness(address: address)
let witness = AbstractWitness(address: address)
let panel = XyoPanel(archive: archive, apiDomain: apiDomain, witnesses: [witness])
XCTAssertNotNil(address)
XCTAssertNotNil(panel)
Expand Down

0 comments on commit f681d13

Please sign in to comment.