Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Sources/Web3Core/Structure/Block/Block.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public struct Block {
public var receiptsRoot: Data
public var miner: EthereumAddress? // MARK: This is NOT optional in web3js
public var difficulty: BigUInt
public var totalDifficulty: BigUInt
public var totalDifficulty: BigUInt? // MARK by JoshKim: Removed from Ethereum official Blockschema (https://github.com/ethereum/execution-apis/commit/9e16d5e76a554c733613a2db631130166e2d8725)
public var extraData: Data
public var size: BigUInt
public var gasLimit: BigUInt
Expand Down Expand Up @@ -83,7 +83,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)
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)
Expand Down