Skip to content

Commit 99d0742

Browse files
author
Łukasz Gąsior
committed
Send config on every request; fix rlp decoding
1 parent a8c3a99 commit 99d0742

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/main/scala/io/iohk/ethereum/extvm/VMClient.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,11 @@ class VMClient(
129129
import msg.CallContext.Config
130130
val blockHeader = buildBlockHeaderMsg(ctx.blockHeader)
131131

132-
val ethereumConfig =
133-
if (testMode)
134-
Config.EthereumConfig(buildEthereumConfigMsg(ctx.evmConfig.blockchainConfig))
135-
else
136-
Config.Empty
132+
val config = externalVmConfig.vmType match {
133+
case VmConfig.ExternalConfig.VmTypeIele => Config.IeleConfig(buildIeleConfigMsg()) // always pass config for IELE
134+
case _ if testMode => Config.EthereumConfig(buildEthereumConfigMsg(ctx.evmConfig.blockchainConfig))
135+
case _ => Config.Empty
136+
}
137137

138138
msg.CallContext(
139139
callerAddr = ctx.callerAddr,
@@ -143,7 +143,7 @@ class VMClient(
143143
gasPrice = ctx.gasPrice,
144144
gasProvided = ctx.startGas,
145145
blockHeader = Some(blockHeader),
146-
config = ethereumConfig
146+
config = config
147147
)
148148
}
149149

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ class EthService(
581581
dataEither match {
582582
case Right(data) =>
583583
call(CallRequest(CallTx(tx.from, tx.to, tx.gas, tx.gasPrice, tx.value, ByteString(data)), req.block))
584-
.map(_.right.map { callResponse => IeleCallResponse(rlp.decode[Seq[ByteString]](callResponse.returnData)(seqEncDec[ByteString])) })
584+
.map(_.right.map { callResponse => IeleCallResponse(rlp.decode[Seq[ByteString]](callResponse.returnData.toArray[Byte])(seqEncDec[ByteString])) })
585585
case Left(error) => Future.successful(Left(error))
586586
}
587587
}

0 commit comments

Comments
 (0)