Skip to content

Commit cec6329

Browse files
committed
refactor(experience): fix didcommagent state enum typo
Signed-off-by: Jon Bauer <[email protected]>
1 parent 8914e2e commit cec6329

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

EdgeAgentSDK/EdgeAgent/Sources/DIDCommAgent/DIDCommAgent.swift

+9-9
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ import Foundation
77
public class DIDCommAgent {
88
/// Enumeration representing the current state of the agent.
99
public enum State: String {
10-
case stoped
10+
case stopped
1111
case starting
1212
case running
13-
case stoping
13+
case stopping
1414
}
1515

1616
/// Represents the current state of the agent.
17-
public private(set) var state = State.stoped
17+
public private(set) var state = State.stopped
1818

1919
/// The mediator routing DID if one is currently registered.
2020
public var mediatorRoutingDID: DID? {
@@ -129,7 +129,7 @@ public class DIDCommAgent {
129129
public func start() async throws {
130130
guard
131131
let connectionManager,
132-
state == .stoped
132+
state == .stopped
133133
else { return }
134134
logger.info(message: "Starting agent")
135135
state = .starting
@@ -149,19 +149,19 @@ public class DIDCommAgent {
149149

150150
/**
151151
This function is used to stop the EdgeAgent.
152-
The function sets the state of EdgeAgent to .stoping.
152+
The function sets the state of EdgeAgent to .stopping.
153153
All ongoing events that was created by the EdgeAgent are stopped.
154-
After all the events are stopped the state of the EdgeAgent is set to .stoped.
154+
After all the events are stopped the state of the EdgeAgent is set to .stopped.
155155

156156
- Throws: If the current state is not running throws error.
157157
*/
158158
public func stop() async throws {
159159
guard state == .running else { return }
160-
logger.info(message: "Stoping agent")
161-
state = .stoping
160+
logger.info(message: "Stopping agent")
161+
state = .stopping
162162
cancellables.forEach { $0.cancel() }
163163
connectionManager?.stopAllEvents()
164-
state = .stoped
164+
state = .stopped
165165
logger.info(message: "Agent not running")
166166
}
167167
}

0 commit comments

Comments
 (0)