Skip to content

Commit ebaab0c

Browse files
Igor Grahovacdzajkowski
Igor Grahovac
authored andcommitted
ETCM-697: Fixed failing tests
1 parent c9c2b14 commit ebaab0c

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

src/main/scala/io/iohk/ethereum/blockchain/data/GenesisDataLoader.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ object GenesisDataLoader {
188188

189189
def deserializeUint256String(jv: JValue): UInt256 = jv match {
190190
case JString(s) =>
191-
Try(UInt256(BigInt(1, Implicits.decode(s)))) match {
191+
Try(UInt256(BigInt(s))) match {
192192
case Failure(_) => throw new RuntimeException("Cannot parse hex string: " + s)
193193
case Success(value) => value
194194
}

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ case class CheckpointResponse(signatures: Seq[ECDSASignature], signers: Seq[Byte
1212
trait BaseBlockResponse {
1313
def number: BigInt
1414
def hash: Option[ByteString]
15-
def mixHash: Option[ByteString]
1615
def parentHash: ByteString
1716
def nonce: Option[ByteString]
1817
def sha3Uncles: ByteString
@@ -59,7 +58,6 @@ case class EthBlockResponse(
5958
case class BlockResponse(
6059
number: BigInt,
6160
hash: Option[ByteString],
62-
mixHash: Option[ByteString],
6361
parentHash: ByteString,
6462
nonce: Option[ByteString],
6563
sha3Uncles: ByteString,
@@ -130,9 +128,8 @@ object BlockResponse {
130128
BlockResponse(
131129
number = block.header.number,
132130
hash = if (pendingBlock) None else Some(block.header.hash),
133-
mixHash = if (block.header.mixHash.isEmpty) None else Some(block.header.mixHash),
134131
parentHash = block.header.parentHash,
135-
nonce = if (block.header.nonce.isEmpty) None else Some(block.header.nonce),
132+
nonce = if (pendingBlock) None else Some(block.header.nonce),
136133
sha3Uncles = block.header.ommersHash,
137134
logsBloom = block.header.logsBloom,
138135
transactionsRoot = block.header.transactionsRoot,

src/main/scala/io/iohk/ethereum/testmode/TestEthBlockServiceWrapper.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package io.iohk.ethereum.testmode
22

3-
import io.iohk.ethereum.domain.{Block, Blockchain}
3+
import io.iohk.ethereum.domain.{Block, Blockchain, UInt256}
44
import io.iohk.ethereum.jsonrpc.EthBlocksService.{BlockByBlockHashResponse, BlockByNumberResponse}
55
import io.iohk.ethereum.jsonrpc.{
66
BaseBlockResponse,
@@ -62,9 +62,9 @@ class TestEthBlockServiceWrapper(blockchain: Blockchain, ledger: Ledger, consens
6262
private def toEthResponse(block: Block, response: BaseBlockResponse) = EthBlockResponse(
6363
response.number,
6464
response.hash,
65-
response.mixHash,
65+
if (block.header.mixHash.isEmpty) Some(UInt256.Zero.bytes) else Some(block.header.mixHash),
6666
response.parentHash,
67-
response.nonce,
67+
if (block.header.nonce.isEmpty) None else Some(block.header.nonce),
6868
response.sha3Uncles,
6969
response.logsBloom,
7070
response.transactionsRoot,

0 commit comments

Comments
 (0)