Skip to content

Commit dfbc9ab

Browse files
author
Łukasz Gąsior
committed
Sending to address 0x0 not allowed only in testmode
1 parent 3221837 commit dfbc9ab

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package io.iohk.ethereum.jsonrpc
22

33
import akka.util.ByteString
44
import io.iohk.ethereum.domain.{Address, Transaction}
5+
import io.iohk.ethereum.utils.Config
56

67
case class TransactionRequest(
78
from: Address,
@@ -20,7 +21,7 @@ case class TransactionRequest(
2021
nonce = nonce.getOrElse(defaultNonce),
2122
gasPrice = gasPrice.getOrElse(defaultGasPrice),
2223
gasLimit = gasLimit.getOrElse(defaultGasLimit),
23-
receivingAddress = if (to.contains(Address(0))) None else to,
24+
receivingAddress = if (Config.testmode) to.filter(_ != Address(0)) else to,
2425
value = value.getOrElse(BigInt(0)),
2526
payload = data.getOrElse(ByteString.empty)
2627
)

0 commit comments

Comments
 (0)