Skip to content

Commit

Permalink
refactor(experience): fix didcommagent state enum typo
Browse files Browse the repository at this point in the history
  • Loading branch information
coveloper committed Jan 6, 2025
1 parent a7efde5 commit 31a9d5e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions EdgeAgentSDK/EdgeAgent/Sources/DIDCommAgent/DIDCommAgent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import Foundation
public class DIDCommAgent {
/// Enumeration representing the current state of the agent.
public enum State: String {
case stoped
case stopped
case starting
case running
case stoping
}

/// Represents the current state of the agent.
public private(set) var state = State.stoped
public private(set) var state = State.stopped

/// The mediator routing DID if one is currently registered.
public var mediatorRoutingDID: DID? {
Expand Down Expand Up @@ -129,7 +129,7 @@ public class DIDCommAgent {
public func start() async throws {
guard
let connectionManager,
state == .stoped
state == .stopped
else { return }
logger.info(message: "Starting agent")
state = .starting
Expand All @@ -151,7 +151,7 @@ public class DIDCommAgent {
This function is used to stop the EdgeAgent.
The function sets the state of EdgeAgent to .stoping.
All ongoing events that was created by the EdgeAgent are stopped.
After all the events are stopped the state of the EdgeAgent is set to .stoped.
After all the events are stopped the state of the EdgeAgent is set to .stopped.

- Throws: If the current state is not running throws error.
*/
Expand All @@ -161,7 +161,7 @@ public class DIDCommAgent {
state = .stoping
cancellables.forEach { $0.cancel() }
connectionManager?.stopAllEvents()
state = .stoped
state = .stopped
logger.info(message: "Agent not running")
}
}
Expand Down

0 comments on commit 31a9d5e

Please sign in to comment.