Skip to content

Commit 4345ba3

Browse files
committed
[ETCM-17] Fix typo. Improve validity check
1 parent 28789a9 commit 4345ba3

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

src/main/scala/io/iohk/ethereum/vm/Blake2bCompression.scala

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,8 @@ object Blake2bCompression {
3434

3535
private def bytesToLong(bytes: Array[Byte]) = Pack.littleEndianToLong(bytes, 0)
3636

37-
def isValidInput(input: Array[Byte]): Boolean= {
38-
if (input.length != MessageBytesLength || (input(212) & 0xFE) != 0) {
39-
false
40-
} else {
41-
true
42-
}
43-
}
37+
def isValidInput(input: Array[Byte]): Boolean =
38+
!(input.length != MessageBytesLength || (input(212) & 0xFE) != 0)
4439

4540
def parseNumberOfRounds(input: Array[Byte]): Long =
4641
Integer.toUnsignedLong(bytesToInt(copyOfRange(input, 0, 4)))

src/main/scala/io/iohk/ethereum/vm/PrecompiledContracts.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ object PrecompiledContracts {
4040
Bn128PairingAddr -> Bn128Pairing
4141
)
4242

43-
val istanbulPhoenisContracts = byzantiumAtlantisContracts ++ Map(
43+
val istanbulPhoenixContracts = byzantiumAtlantisContracts ++ Map(
4444
Blake2bCompressionAddr -> Blake2bCompress
4545
)
4646
/**
@@ -63,7 +63,7 @@ object PrecompiledContracts {
6363
val etcFork = context.evmConfig.blockchainConfig.etcForkForBlockNumber(context.blockHeader.number)
6464

6565
if (ethFork >= EthForks.Istanbul || etcFork >= EtcForks.Phoenix) {
66-
istanbulPhoenisContracts.get(addr)
66+
istanbulPhoenixContracts.get(addr)
6767
} else if (ethFork >= EthForks.Byzantium || etcFork >= EtcForks.Atlantis) {
6868
// byzantium and atlantis hard fork introduce the same set of precompiled contracts
6969
byzantiumAtlantisContracts.get(addr)

0 commit comments

Comments
 (0)