Skip to content

Commit 1a3ca6a

Browse files
[ETCM-912] Reduce duplication in tests
1 parent 4dca231 commit 1a3ca6a

File tree

5 files changed

+516
-743
lines changed

5 files changed

+516
-743
lines changed

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

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ class CallOpFixture(val config: EvmConfig, val startState: MockWorldState) {
181181
originalWorld = worldWithExtAccount
182182
)
183183

184-
case class CallResult(
184+
case class ExecuteCall(
185185
op: CallOp,
186186
context: PC = context,
187187
inputData: ByteString = inputData,
@@ -193,7 +193,7 @@ class CallOpFixture(val config: EvmConfig, val startState: MockWorldState) {
193193
outOffset: UInt256 = inputData.size,
194194
outSize: UInt256 = inputData.size / 2,
195195
toAccessed: Boolean = false
196-
) {
196+
) extends CallResult {
197197

198198
val vm = new TestVM
199199

@@ -218,3 +218,16 @@ class CallOpFixture(val config: EvmConfig, val startState: MockWorldState) {
218218
val extStorage: MockStorage = world.getStorage(to)
219219
}
220220
}
221+
222+
protected[vm] trait CallResult {
223+
def inputData: ByteString
224+
def stateOut: PS
225+
def world: MockWorldState
226+
def ownBalance: UInt256
227+
def extBalance: UInt256
228+
def ownStorage: MockStorage
229+
def extStorage: MockStorage
230+
def outOffset: UInt256
231+
def outSize: UInt256
232+
def value: UInt256
233+
}

0 commit comments

Comments
 (0)