Skip to content

Commit 8c68165

Browse files
Update Sources/Web3Core/Structure/Block/Block.swift
Co-authored-by: Jenea Vranceanu <36865532+JeneaVranceanu@users.noreply.github.com>
1 parent 329bcb4 commit 8c68165

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/Web3Core/Structure/Block/Block.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ extension Block: Decodable {
8585
}
8686

8787
self.difficulty = try container.decodeHex(BigUInt.self, forKey: .difficulty)
88-
self.totalDifficulty = try? container.decodeHex(BigUInt.self, forKey: .totalDifficulty)
88+
self.totalDifficulty = (try? container.decodeHex(BigUInt.self, forKey: .totalDifficulty)) ?? .zero
8989
self.extraData = try container.decodeHex(Data.self, forKey: .extraData)
9090
self.size = try container.decodeHex(BigUInt.self, forKey: .size)
9191
self.gasLimit = try container.decodeHex(BigUInt.self, forKey: .gasLimit)

0 commit comments

Comments
 (0)