Skip to content

Commit

Permalink
fix optional
Browse files Browse the repository at this point in the history
  • Loading branch information
xlc committed Nov 8, 2024
1 parent cac786f commit 4bafc33
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Blockchain/Sources/Blockchain/State/StateLayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public struct StateLayer: @unchecked Sendable {
// δ: The (prior) state of the service accounts.
public subscript(serviceAccount index: ServiceIndex) -> StateKeys.ServiceAccountKey.Value? {
get {
changes[StateKeys.ServiceAccountKey(index: index)]!.value()!
changes[StateKeys.ServiceAccountKey(index: index)]?.value()
}
set {
changes[StateKeys.ServiceAccountKey(index: index)] = .init(newValue)
Expand All @@ -182,7 +182,7 @@ public struct StateLayer: @unchecked Sendable {
// s
public subscript(serviceAccount index: ServiceIndex, storageKey key: Data32) -> StateKeys.ServiceAccountStorageKey.Value? {
get {
changes[StateKeys.ServiceAccountStorageKey(index: index, key: key)]!.value()!
changes[StateKeys.ServiceAccountStorageKey(index: index, key: key)]?.value()
}
set {
changes[StateKeys.ServiceAccountStorageKey(index: index, key: key)] = .init(newValue)
Expand All @@ -194,7 +194,7 @@ public struct StateLayer: @unchecked Sendable {
serviceAccount index: ServiceIndex, preimageHash hash: Data32
) -> StateKeys.ServiceAccountPreimagesKey.Value? {
get {
changes[StateKeys.ServiceAccountPreimagesKey(index: index, hash: hash)]!.value()!
changes[StateKeys.ServiceAccountPreimagesKey(index: index, hash: hash)]?.value()
}
set {
changes[StateKeys.ServiceAccountPreimagesKey(index: index, hash: hash)] = .init(newValue)
Expand Down

0 comments on commit 4bafc33

Please sign in to comment.