From 8c6816528a33038028c80dd6d6cfa23ed2eb6320 Mon Sep 17 00:00:00 2001 From: Heemin Kim <36722822+h33min@users.noreply.github.com> Date: Thu, 31 Oct 2024 17:05:52 +0900 Subject: [PATCH] Update Sources/Web3Core/Structure/Block/Block.swift Co-authored-by: Jenea Vranceanu <36865532+JeneaVranceanu@users.noreply.github.com> --- Sources/Web3Core/Structure/Block/Block.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Web3Core/Structure/Block/Block.swift b/Sources/Web3Core/Structure/Block/Block.swift index 6dfdfb96..8752954a 100644 --- a/Sources/Web3Core/Structure/Block/Block.swift +++ b/Sources/Web3Core/Structure/Block/Block.swift @@ -85,7 +85,7 @@ extension Block: Decodable { } self.difficulty = try container.decodeHex(BigUInt.self, forKey: .difficulty) - self.totalDifficulty = try? container.decodeHex(BigUInt.self, forKey: .totalDifficulty) + self.totalDifficulty = (try? container.decodeHex(BigUInt.self, forKey: .totalDifficulty)) ?? .zero self.extraData = try container.decodeHex(Data.self, forKey: .extraData) self.size = try container.decodeHex(BigUInt.self, forKey: .size) self.gasLimit = try container.decodeHex(BigUInt.self, forKey: .gasLimit)