Skip to content

Commit 737abbd

Browse files
committed
OpCode test fixes for sliceBytes
1 parent d01d21f commit 737abbd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/test/scala/io/iohk/ethereum/vm/OpCodeFunSpec.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ class OpCodeFunSpec extends FunSuite with OpCodeTesting with Matchers with Prope
183183
withStackVerification(op, stateIn, stateOut) {
184184
val (offset, _) = stateIn.stack.pop
185185
val (data, _) = stateOut.stack.pop
186-
data shouldEqual UInt256(OpCode.sliceBytes(stateIn.inputData, offset.toInt, 32))
186+
data shouldEqual UInt256(OpCode.sliceBytes(stateIn.inputData, offset, 32))
187187

188188
val expectedState = stateIn.withStack(stateOut.stack).step()
189189
stateOut shouldEqual expectedState
@@ -203,7 +203,7 @@ class OpCodeFunSpec extends FunSuite with OpCodeTesting with Matchers with Prope
203203

204204
withStackVerification(op, stateIn, stateOut) {
205205
val (Seq(memOffset, dataOffset, size), _) = stateIn.stack.pop(3)
206-
val data = OpCode.sliceBytes(stateIn.inputData, dataOffset.toInt, size.toInt)
206+
val data = OpCode.sliceBytes(stateIn.inputData, dataOffset, size)
207207
val (storedInMem, _) = stateOut.memory.load(memOffset, size)
208208
data shouldEqual storedInMem
209209

@@ -225,7 +225,7 @@ class OpCodeFunSpec extends FunSuite with OpCodeTesting with Matchers with Prope
225225

226226
withStackVerification(op, stateIn, stateOut) {
227227
val (Seq(memOffset, codeOffset, size), _) = stateIn.stack.pop(3)
228-
val code = stateIn.program.getBytes(codeOffset.toInt, size.toInt)
228+
val code = OpCode.sliceBytes(stateIn.program.code, codeOffset, size)
229229
val (storedInMem, _) = stateOut.memory.load(memOffset, size)
230230
code shouldEqual storedInMem
231231

@@ -284,7 +284,7 @@ class OpCodeFunSpec extends FunSuite with OpCodeTesting with Matchers with Prope
284284

285285
withStackVerification(op, stateIn, stateOut) {
286286
val (Seq(addr, memOffset, codeOffset, size), _) = stateIn.stack.pop(4)
287-
val code = OpCode.sliceBytes(stateIn.world.getCode(Address(addr)), codeOffset.toInt, size.toInt)
287+
val code = OpCode.sliceBytes(stateIn.world.getCode(Address(addr)), codeOffset, size)
288288
val (storedInMem, _) = stateOut.memory.load(memOffset, size)
289289
code shouldEqual storedInMem
290290

0 commit comments

Comments
 (0)