@@ -8,7 +8,7 @@ import io.iohk.ethereum.db.storage.BlockHeadersStorage
8
8
import io .iohk .ethereum .db .storage .BlockNumberMappingStorage
9
9
import io .iohk .ethereum .db .storage .ReceiptStorage
10
10
import io .iohk .ethereum .db .storage .StateStorage
11
- import io .iohk .ethereum .domain .branch .BestBranchSubset
11
+ import io .iohk .ethereum .domain .branch .BestBranch
12
12
import io .iohk .ethereum .domain .branch .Branch
13
13
import io .iohk .ethereum .domain .branch .EmptyBranch
14
14
import io .iohk .ethereum .mpt .MptNode
@@ -75,7 +75,7 @@ class BlockchainReader(
75
75
val number = getBestBlockNumber()
76
76
blockNumberMappingStorage
77
77
.get(number)
78
- .map(hash => BestBranchSubset (hash, number))
78
+ .map(hash => BestBranch (hash, number))
79
79
.getOrElse(EmptyBranch )
80
80
}
81
81
@@ -112,7 +112,7 @@ class BlockchainReader(
112
112
113
113
/** Returns a block inside this branch based on its number */
114
114
def getBlockByNumber (branch : Branch , number : BigInt ): Option [Block ] = branch match {
115
- case BestBranchSubset (_, tipBlockNumber) =>
115
+ case BestBranch (_, tipBlockNumber) =>
116
116
if (tipBlockNumber >= number && number >= 0 ) {
117
117
for {
118
118
hash <- getHashByBlockNumber(number)
@@ -124,7 +124,7 @@ class BlockchainReader(
124
124
125
125
/** Returns a block hash for the block at the given height if any */
126
126
def getHashByBlockNumber (branch : Branch , number : BigInt ): Option [ByteString ] = branch match {
127
- case BestBranchSubset (_, tipBlockNumber) =>
127
+ case BestBranch (_, tipBlockNumber) =>
128
128
if (tipBlockNumber >= number && number >= 0 ) {
129
129
blockNumberMappingStorage.get(number)
130
130
} else None
@@ -134,7 +134,7 @@ class BlockchainReader(
134
134
135
135
/** Checks if given block hash is in this chain. (i.e. is an ancestor of the tip block) */
136
136
def isInChain (branch : Branch , hash : ByteString ): Boolean = branch match {
137
- case BestBranchSubset (_, tipBlockNumber) =>
137
+ case BestBranch (_, tipBlockNumber) =>
138
138
(for {
139
139
header <- getBlockHeaderByHash(hash) if header.number <= tipBlockNumber
140
140
hash <- getHashByBlockNumber(branch, header.number)
0 commit comments