Skip to content

Commit dd56de9

Browse files
author
Aurélien Richez
committed
review fixes
rename putBestBlockData to putBestBlockInfo avoid using magic number for block number in test
1 parent 69227c9 commit dd56de9

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

src/main/scala/io/iohk/ethereum/db/storage/AppStateStorage.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class AppStateStorage(val dataSource: DataSource) extends TransactionalKeyValueS
3737
getBigInt(Keys.BestBlockNumber)
3838
)
3939

40-
def putBestBlockData(b: BestBlockInfo): DataSourceBatchUpdate =
40+
def putBestBlockInfo(b: BestBlockInfo): DataSourceBatchUpdate =
4141
put(Keys.BestBlockNumber, b.number.toString)
4242
.and(put(Keys.BestBlockHash, Hex.toHexString(b.hash.toArray)))
4343

src/main/scala/io/iohk/ethereum/domain/Blockchain.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ class BlockchainImpl(
220220
*/
221221
val bestBlockNumberUpdates =
222222
if (appStateStorage.getBestBlockNumber() > potentialNewBestBlockNumber)
223-
appStateStorage.putBestBlockData(BestBlockInfo(potentialNewBestBlockHash, potentialNewBestBlockNumber))
223+
appStateStorage.putBestBlockInfo(BestBlockInfo(potentialNewBestBlockHash, potentialNewBestBlockNumber))
224224
else appStateStorage.emptyBatchUpdate
225225
val latestCheckpointNumberUpdates =
226226
if (appStateStorage.getLatestCheckpointBlockNumber() > newLatestCheckpointNumber)

src/main/scala/io/iohk/ethereum/domain/BlockchainWriter.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class BlockchainWriter(
111111
)
112112

113113
appStateStorage
114-
.putBestBlockData(currentBestBlockInfo)
114+
.putBestBlockInfo(currentBestBlockInfo)
115115
.and(appStateStorage.putLatestCheckpointBlockNumber(currentBestCheckpointNumber))
116116
.commit()
117117
}

src/test/scala/io/iohk/ethereum/consensus/ConsensusSpec.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ class ConsensusSpec extends AnyFlatSpec with Matchers with ScalaFutures {
221221

222222
val ancestorForValidation: Block = getBlock(0, difficulty = 1)
223223
storagesInstance.storages.appStateStorage
224-
.putBestBlockData(BestBlockInfo(ancestorForValidation.hash, ancestorForValidation.number))
224+
.putBestBlockInfo(BestBlockInfo(ancestorForValidation.hash, ancestorForValidation.number))
225225
.commit()
226226
blockchainWriter.save(ancestorForValidation, Nil, ChainWeight.totalDifficultyOnly(1), saveAsBestBlock = false)
227227

src/test/scala/io/iohk/ethereum/jsonrpc/JsonRpcControllerEthSpec.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ class JsonRpcControllerEthSpec
416416
private val block: Block =
417417
Block(Fixtures.Blocks.Block3125369.header.copy(number = 42), Fixtures.Blocks.Block3125369.body)
418418
blockchainWriter.storeBlock(block).commit()
419-
blockchain.saveBestKnownBlocks(block.hash, 42)
419+
blockchain.saveBestKnownBlocks(block.hash, block.number)
420420

421421
val request: JsonRpcRequest = newJsonRpcRequest("eth_gasPrice")
422422

0 commit comments

Comments
 (0)