File tree Expand file tree Collapse file tree 5 files changed +12
-8
lines changed
it/scala/io/iohk/ethereum/txExecTest/util
main/scala/io/iohk/ethereum
test/scala/io/iohk/ethereum/jsonrpc Expand file tree Collapse file tree 5 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -196,7 +196,11 @@ class BlockchainMock(genesisHash: ByteString) extends Blockchain {
196
196
197
197
def getBestBlockNumber (): BigInt = ???
198
198
199
- def saveBestKnownBlocks (bestBlockNumber : BigInt , latestCheckpointNumber : Option [BigInt ] = None ): Unit = ???
199
+ override def saveBestKnownBlocks (
200
+ bestBlockhash : ByteString ,
201
+ bestBlockNumber : BigInt ,
202
+ latestCheckpointNumber : Option [BigInt ] = None
203
+ ): Unit = ???
200
204
201
205
def getBestBlock (): Option [Block ] = ???
202
206
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ class AppStateStorage(val dataSource: DataSource) extends TransactionalKeyValueS
37
37
getBigInt(Keys .BestBlockNumber )
38
38
)
39
39
40
- def putBestBlockData (b : BestBlockInfo ): DataSourceBatchUpdate =
40
+ def putBestBlockInfo (b : BestBlockInfo ): DataSourceBatchUpdate =
41
41
put(Keys .BestBlockNumber , b.number.toString)
42
42
.and(put(Keys .BestBlockHash , Hex .toHexString(b.hash.toArray)))
43
43
Original file line number Diff line number Diff line change @@ -144,15 +144,15 @@ class BlockchainImpl(
144
144
}
145
145
146
146
private def saveBestKnownBlock (bestBlockHash : ByteString , bestBlockNumber : BigInt ): Unit =
147
- appStateStorage.putBestBlockData (BestBlockInfo (bestBlockHash, bestBlockNumber)).commit()
147
+ appStateStorage.putBestBlockInfo (BestBlockInfo (bestBlockHash, bestBlockNumber)).commit()
148
148
149
149
private def saveBestKnownBlockAndLatestCheckpointNumber (
150
150
bestBlockHash : ByteString ,
151
151
number : BigInt ,
152
152
latestCheckpointNumber : BigInt
153
153
): Unit =
154
154
appStateStorage
155
- .putBestBlockData (BestBlockInfo (bestBlockHash, number))
155
+ .putBestBlockInfo (BestBlockInfo (bestBlockHash, number))
156
156
.and(appStateStorage.putLatestCheckpointBlockNumber(latestCheckpointNumber))
157
157
.commit()
158
158
@@ -202,7 +202,7 @@ class BlockchainImpl(
202
202
*/
203
203
val bestBlockNumberUpdates =
204
204
if (appStateStorage.getBestBlockNumber() > potentialNewBestBlockNumber)
205
- appStateStorage.putBestBlockData (BestBlockInfo (potentialNewBestBlockHash, potentialNewBestBlockNumber))
205
+ appStateStorage.putBestBlockInfo (BestBlockInfo (potentialNewBestBlockHash, potentialNewBestBlockNumber))
206
206
else appStateStorage.emptyBatchUpdate
207
207
val latestCheckpointNumberUpdates =
208
208
if (appStateStorage.getLatestCheckpointBlockNumber() > newLatestCheckpointNumber)
Original file line number Diff line number Diff line change @@ -32,14 +32,14 @@ class BlockchainWriter(
32
32
block.header.number
33
33
)
34
34
appStateStorage
35
- .putBestBlockData (BestBlockInfo (block.header.hash, block.header.number))
35
+ .putBestBlockInfo (BestBlockInfo (block.header.hash, block.header.number))
36
36
.and(appStateStorage.putLatestCheckpointBlockNumber(block.header.number))
37
37
} else if (saveAsBestBlock) {
38
38
log.debug(
39
39
" New best known block number - {}" ,
40
40
block.header.number
41
41
)
42
- appStateStorage.putBestBlockData (BestBlockInfo (block.header.hash, block.header.number))
42
+ appStateStorage.putBestBlockInfo (BestBlockInfo (block.header.hash, block.header.number))
43
43
} else {
44
44
appStateStorage.emptyBatchUpdate
45
45
}
Original file line number Diff line number Diff line change @@ -416,7 +416,7 @@ class JsonRpcControllerEthSpec
416
416
private val block : Block =
417
417
Block (Fixtures .Blocks .Block3125369 .header.copy(number = 42 ), Fixtures .Blocks .Block3125369 .body)
418
418
blockchainWriter.storeBlock(block).commit()
419
- blockchain.saveBestKnownBlocks(block.hash, 42 )
419
+ blockchain.saveBestKnownBlocks(block.hash, block.number )
420
420
421
421
val request : JsonRpcRequest = newJsonRpcRequest(" eth_gasPrice" )
422
422
You can’t perform that action at this time.
0 commit comments