Skip to content

Commit

Permalink
Merge pull request #2160 from ergoplatform/scaladoc-fixes
Browse files Browse the repository at this point in the history
Scaladoc fixes
  • Loading branch information
kushti authored Jun 3, 2024
2 parents ed7ffb2 + 27bc2d3 commit fb6eb30
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 38 deletions.
12 changes: 6 additions & 6 deletions src/main/scala/org/ergoplatform/mining/CandidateGenerator.scala
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class CandidateGenerator(

override def receive: Receive = {

/** first we need to get Readers to have some initial state to work with */
// first we need to get Readers to have some initial state to work with
case Readers(h, s: UtxoStateReader, m, _) =>
val lastHeaders = h.lastHeaders(500).headers
val avgMiningTime = getBlockMiningTimeAvg(lastHeaders.map(_.timestamp))
Expand Down Expand Up @@ -116,10 +116,10 @@ class CandidateGenerator(
case _: NodeViewChange =>
// Just ignore all other NodeView Changes

/**
* When new block is applied, either one mined by us or received from peers isn't equal to our candidate's parent,
* we need to generate new candidate and possibly also discard existing solution if it is also behind
*/
/*
* When new block is applied, either one mined by us or received from peers isn't equal to our candidate's parent,
* we need to generate new candidate and possibly also discard existing solution if it is also behind
*/
case FullBlockApplied(header) =>
log.info(
s"Preparing new candidate on getting new block at ${header.height}"
Expand Down Expand Up @@ -883,7 +883,7 @@ object CandidateGenerator extends ScorexLogging {
}

/**
* Derives header without pow from [[CandidateBlock]].
* Derives header without pow from a block candidate provided
*/
def deriveUnprovenHeader(candidate: CandidateBlock): HeaderWithoutPow = {
val (parentId, height) = derivedHeaderFields(candidate.parentOpt)
Expand Down
16 changes: 8 additions & 8 deletions src/main/scala/org/ergoplatform/mining/ErgoMiner.scala
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class ErgoMiner(

override def receive: Receive = {

/** at first keep trying to obtain secret and public key as we cannot mine without it */
// at first keep trying to obtain secret and public key as we cannot mine without it
case walletQuery: WalletQuery =>
viewHolderRef ! GetDataFromCurrentView[DigestState, Unit] { v =>
walletQuery match {
Expand Down Expand Up @@ -144,13 +144,13 @@ class ErgoMiner(
case ReadMinerPk => // used in /mining/rewardAddress API method
sender() ! StatusReply.success(minerState.publicKey)

/**
* Non obvious but case when mining is enabled, but miner isn't started yet. Initialization case.
* We've received block that been generated by somebody else or genesis while we doesn't start.
* And this block was generated after our miner had been started. That means that we are ready
* to start mining.
* This block could be either genesis or generated by another node.
*/
/*
* Non obvious but case when mining is enabled, but miner isn't started yet. Initialization case.
* We've received block that been generated by somebody else or genesis while we doesn't start.
* And this block was generated after our miner had been started. That means that we are ready
* to start mining.
* This block could be either genesis or generated by another node.
*/
case FullBlockApplied(header) if shouldStartMine(header) =>

log.info("Starting mining triggered by incoming block")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,9 +361,9 @@ trait ErgoHistoryReader
* @return
*/
def syncInfoV1: ErgoSyncInfoV1 = {
/**
* Return last count headers from best headers chain if exist or chain up to genesis otherwise
*/
/*
* Return last count headers from best headers chain if exist or chain up to genesis otherwise
*/
def lastHeaderIds(count: Int): IndexedSeq[ModifierId] = {
val currentHeight = headersHeight
val from = Math.max(currentHeight - count + 1, 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ object IndexedToken {
* so they are checked with Try-catches.
*
* @param iEb - box to use
* @param tokenIndex - token index to check in [[ErgoBox.additionalTokens]]
* @param tokenIndex - token index to check in box' `additionalTokens`
* @return token index
*/
def fromBox(iEb: IndexedErgoBox, tokenIndex: Int): IndexedToken = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ abstract class Segment[T <: Segment[_] : ClassTag](val parentId: ModifierId,
* @param mempool - mempool to use, if unconfirmed is true
* @param offset - items to skip from the start
* @param limit - items to retrieve
* @param sortDir - whether to start retreival from newest box ([[DESC]]) or oldest box ([[ASC]])
* @param sortDir - whether to start retrieval from newest box (DESC) or oldest box (ASC)
* @param unconfirmed - whether to include unconfirmed boxes
* @return array of unspent boxes
*/
Expand Down Expand Up @@ -288,7 +288,7 @@ abstract class Segment[T <: Segment[_] : ClassTag](val parentId: ModifierId,
}

/**
* Logic for [[Segment.rollback]]
* Logic for `Segment.rollback`
*
* @param txTarget - remove transaction numbers above this number
* @param boxTarget - remove box numbers above this number
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ class DigestState protected(override val version: VersionTag,
object DigestState extends ScorexLogging with ScorexEncoding {

/**
* Creates [[DigestState]] from existing [[ErgoStateContext]] corresponding to some `version` and `rootHash`.
* Creates [[DigestState]] with provided `ErgoStateContext` instance corresponding to some version` and `rootHash`.
*/
def recover(version: VersionTag,
rootHash: ADDigest,
Expand Down
26 changes: 13 additions & 13 deletions src/main/scala/org/ergoplatform/nodeView/state/UtxoState.scala
Original file line number Diff line number Diff line change
Expand Up @@ -159,19 +159,19 @@ class UtxoState(override val persistentProver: PersistentBatchAVLProver[Digest32

log.error("Calculated proofHash is not equal to the declared one, doing another attempt")

/**
* Proof generated was different from one announced.
*
* In most cases, announced proof is okay, and as proof is already checked, problem in some
* extra bytes added to the proof.
*
* Could be related to https://github.com/ergoplatform/ergo/issues/1614
*
* So the problem could appear on mining nodes only, and caused by
* proofsForTransactions() wasting the tree unexpectedly.
*
* We are trying to generate proof again now.
*/
/*
* Proof generated was different from one announced.
*
* In most cases, announced proof is okay, and as proof is already checked, problem in some
* extra bytes added to the proof.
*
* Could be related to https://github.com/ergoplatform/ergo/issues/1614
*
* So the problem could appear on mining nodes only, and caused by
* proofsForTransactions() wasting the tree unexpectedly.
*
* We are trying to generate proof again now.
*/

persistentProver.rollback(inRoot)
.ensuring(java.util.Arrays.equals(persistentProver.digest, inRoot))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class ErgoWalletActor(settings: ErgoSettings,
case _: RestoreWallet | _: InitWallet =>
sender() ! Failure(new Exception("Wallet is already initialized or testMnemonic is set. Clear current secret to re-init it."))

/** READERS */
/* READERS */
case ReadBalances(chainStatus) =>
val walletDigest = if (chainStatus.onChain) {
state.registry.fetchDigest()
Expand Down Expand Up @@ -194,7 +194,7 @@ class ErgoWalletActor(settings: ErgoSettings,
case ReadScans =>
sender() ! ReadScansResponse(state.walletVars.externalScans)

/** STATE CHANGE */
/* STATE CHANGE */
case ChangedMempool(mr: ErgoMemPoolReader@unchecked) =>
val newState = ergoWalletService.updateUtxoState(state.copy(mempoolReaderOpt = Some(mr)))
context.become(loadedWallet(newState))
Expand All @@ -219,7 +219,7 @@ class ErgoWalletActor(settings: ErgoSettings,
context.become(loadedWallet(state.copy(error = Some(errorMsg))))
}

/** SCAN COMMANDS */
/* SCAN COMMANDS */
//scan mempool transaction
case ScanOffChain(tx) =>
val dustLimit = settings.walletSettings.dustLimit
Expand Down Expand Up @@ -300,7 +300,7 @@ class ErgoWalletActor(settings: ErgoSettings,
log.warn("Avoiding rollback as wallet is not initialized yet")
}

/** WALLET COMMANDS */
/* WALLET COMMANDS */
case CheckSeed(mnemonic, passOpt) =>
state.secretStorageOpt match {
case Some(secretStorage) =>
Expand Down

0 comments on commit fb6eb30

Please sign in to comment.