Skip to content

Commit eb18f82

Browse files
author
Łukasz Gąsior
committed
Cleanup
1 parent db7776d commit eb18f82

File tree

4 files changed

+4
-9
lines changed

4 files changed

+4
-9
lines changed

src/main/scala/io/iohk/ethereum/consensus/ConsensusBuilder.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ trait StdConsensusBuilder extends ConsensusBuilder {
4848
case Protocol.Ethash buildEthashConsensus()
4949
case Protocol.AtomixRaft buildAtomixRaftConsensus()
5050
}
51-
// TODO: why the fuck does it fail with npe?
52-
// log.info(s"Using '${protocol.name}' consensus [${consensus.getClass.getName}]")
51+
log.info(s"Using '${protocol.name}' consensus [${consensus.getClass.getName}]")
5352

5453
consensus
5554
}

src/main/scala/io/iohk/ethereum/consensus/ethash/EthashConsensus.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,13 @@ import io.iohk.ethereum.consensus.blocks.TestBlockGenerator
99
import io.iohk.ethereum.consensus.ethash.EthashMiner.MinerMsg
1010
import io.iohk.ethereum.consensus.ethash.blocks.{EthashBlockGenerator, EthashBlockGeneratorImpl}
1111
import io.iohk.ethereum.consensus.ethash.validators.{EthashValidators, StdEthashValidators}
12-
import io.iohk.ethereum.consensus.validators._
12+
import io.iohk.ethereum.consensus.validators.Validators
1313
import io.iohk.ethereum.domain.BlockchainImpl
1414
import io.iohk.ethereum.ledger.BlockPreparator
1515
import io.iohk.ethereum.ledger.Ledger.VMImpl
1616
import io.iohk.ethereum.nodebuilder.Node
1717
import io.iohk.ethereum.utils.{BlockchainConfig, Logger}
1818

19-
2019
/**
2120
* Implements standard Ethereum consensus (ethash PoW).
2221
*/

src/main/scala/io/iohk/ethereum/jsonrpc/JsonMethodsImplicits.scala

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,7 @@ trait JsonMethodsImplicits {
9999

100100
to <- input.get("to") match {
101101
case Some(JString(s)) =>
102-
extractAddress(s).map {
103-
case addr if addr.toUInt256.isZero => None
104-
case addr => Some(addr)
105-
}
102+
extractAddress(s).map(Some(_))
106103

107104
case Some(_) => Left(InvalidAddress)
108105
case None => Right(None)

src/main/scala/io/iohk/ethereum/jsonrpc/TransactionRequest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ case class TransactionRequest(
2020
nonce = nonce.getOrElse(defaultNonce),
2121
gasPrice = gasPrice.getOrElse(defaultGasPrice),
2222
gasLimit = gasLimit.getOrElse(defaultGasLimit),
23-
receivingAddress = to,
23+
receivingAddress = if (to.contains(Address(0))) None else to,
2424
value = value.getOrElse(BigInt(0)),
2525
payload = data.getOrElse(ByteString.empty)
2626
)

0 commit comments

Comments
 (0)