Commit 4e9fc86f authored by Kelvin Fichter's avatar Kelvin Fichter

CREATE tests passing

parent cf113fec
...@@ -493,6 +493,7 @@ const test_ovmCREATE: TestDefinition = { ...@@ -493,6 +493,7 @@ const test_ovmCREATE: TestDefinition = {
}, },
{ {
name: 'ovmCREATE => ovmCALL(ADDRESS_NONEXIST)', name: 'ovmCREATE => ovmCALL(ADDRESS_NONEXIST)',
expectInvalidStateAccess: true,
steps: [ steps: [
{ {
functionName: 'ovmCREATE', functionName: 'ovmCREATE',
...@@ -519,7 +520,7 @@ const test_ovmCREATE: TestDefinition = { ...@@ -519,7 +520,7 @@ const test_ovmCREATE: TestDefinition = {
}, },
{ {
name: 'ovmCREATE => ovmCREATE => ovmCALL(ADDRESS_NONEXIST)', name: 'ovmCREATE => ovmCREATE => ovmCALL(ADDRESS_NONEXIST)',
focus: true, expectInvalidStateAccess: true,
steps: [ steps: [
{ {
functionName: 'ovmCREATE', functionName: 'ovmCREATE',
......
...@@ -105,21 +105,22 @@ export class ExecutionManagerTestRunner { ...@@ -105,21 +105,22 @@ export class ExecutionManagerTestRunner {
) )
}) })
if (parameter.focus) { const itfn = parameter.focus ? it.only : it
it.only(`should execute: ${parameter.name}`, async () => { itfn(`should execute: ${parameter.name}`, async () => {
try {
for (const step of replacedParameter.steps) { for (const step of replacedParameter.steps) {
await this.runTestStep(step) await this.runTestStep(step)
} }
}) } catch (err) {
if (parameter.expectInvalidStateAccess) {
expect(err.toString()).to.contain('VM Exception while processing transaction: revert')
} else { } else {
it(`should execute: ${parameter.name}`, async () => { throw err
for (const step of replacedParameter.steps) {
await this.runTestStep(step)
} }
})
} }
}) })
}) })
})
} }
private async initContracts() { private async initContracts() {
......
...@@ -216,8 +216,9 @@ interface TestState { ...@@ -216,8 +216,9 @@ interface TestState {
export interface TestParameter { export interface TestParameter {
name: string name: string
focus?: boolean
steps: TestStep[] steps: TestStep[]
expectInvalidStateAccess?: boolean
focus?: boolean
} }
export interface TestDefinition { export interface TestDefinition {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment