Skip to content

Commit 9fd6011

Browse files
authored
various minor fixes (#346)
* various minor fixes * revert vapor change
1 parent 405f8b3 commit 9fd6011

File tree

5 files changed

+9
-5
lines changed

5 files changed

+9
-5
lines changed

Blockchain/Sources/Blockchain/RuntimeProtocols/Accumulation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ extension Accumulation {
575575
for (service, _) in accumulateOutput.gasUsed {
576576
if accumulateStats[service] != nil { continue }
577577

578-
let digests = accumulated.compactMap(\.digests).flatMap { $0 }
578+
let digests = accumulated.compactMap(\.digests).flatMap(\.self)
579579
let num = digests.filter { $0.serviceIndex == service }.count
580580

581581
if num == 0 { continue }

Database/Sources/RocksDBSwift/Store.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public final class Store<CFKey: ColumnFamilyKey, Coder: StoreCoder>: Sendable {
4242

4343
public func exists(key: Coder.Key) throws -> Bool {
4444
let encodedKey = try coder.encode(key: key)
45-
// it seems like
45+
// it seems like there is no way to check if a key exists so we just try to get it
4646
return try db.get(column: column, key: encodedKey) != nil
4747
}
4848

Node/Sources/Node/ChainSpec.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ public struct ChainSpec: Codable, Equatable {
5757
public func getState() throws -> [Data31: Data] {
5858
var output: [Data31: Data] = [:]
5959
for (key, value) in genesisState {
60-
try output[Data31(fromHexString: key).unwrap()] = value
60+
guard let dataKey = Data31(fromHexString: key) else {
61+
throw GenesisError.invalidFormat("Invalid genesisState key format: \(key) (not valid hex)")
62+
}
63+
output[dataKey] = value
6164
}
6265
return output
6366
}

Tools/Sources/CTools/ctools.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#pragma once
2+
13
#include <fcntl.h>
24

35
/**
@@ -13,5 +15,4 @@
1315
*/
1416
int emitAddExample(void *codePtr);
1517

16-
1718
int ctools_shm_open(const char *name, int oflag, mode_t mode);

Tools/Sources/Tools/Tools.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import TracingUtils
44
import Utils
55

66
@main
7-
struct Boka: AsyncParsableCommand {
7+
struct Tools: AsyncParsableCommand {
88
static let configuration = CommandConfiguration(
99
abstract: "Boka Tools",
1010
version: "0.0.1",

0 commit comments

Comments
 (0)