Skip to content

Commit

Permalink
new eof test format
Browse files Browse the repository at this point in the history
  • Loading branch information
winsvega committed Apr 12, 2023
1 parent d25a79a commit c30f328
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 30 deletions.
35 changes: 27 additions & 8 deletions EOFTests/efExample/ymlExample.json
Original file line number Diff line number Diff line change
@@ -1,44 +1,63 @@
{
"ymlExample" : {
"_info" : {
"comment" : "",
"filling-rpc-server" : "evm version 1.11.0-unstable-df238889-20230119",
"filling-tool-version" : "retesteth-0.2.3-postmerge+commit.bc3429d8.Linux.g++",
"generatedTestHash" : "b5cb0bba99bf06ca870bf4150406aea59820e6deca1ad973141de6bc2c421808",
"lllcversion" : "Version: 0.5.14-develop.2023.1.22+commit.a096d7a9.Linux.g++",
"comment" : "EOF example test",
"filling-rpc-server" : "evm version 1.11.0-unstable-97c49b85-20230411",
"filling-tool-version" : "retesteth-0.3.1-shanghai+commit.9e1f1208.Linux.g++",
"generatedTestHash" : "9fe585064da9eddb59a1610dfc31a8623a06968e3b1d097436f57555508f4d14",
"lllcversion" : "Version: 0.5.14-develop.2022.7.30+commit.a096d7a9.Linux.g++",
"solidity" : "Version: 0.8.17+commit.8df45f5f.Linux.g++",
"source" : "src/EOFTestsFiller/efExample/ymlExampleFiller.yml",
"sourceHash" : "eecb22a7afed6b7437f7ebad5558424c34968db19fca5c94eb6aebe77f29464d"
"sourceHash" : "788f15fd3a8c01e38b1cafcf04b4879079cddbf26aa0267f81865e664a1f6717"
},
"vectors" : {
"ymlExample_0" : {
"code" : "0x60016000f3",
"results" : {
"Cancun" : {
"exception" : "invalid magic",
"result" : false
},
"Shanghai" : {
"result" : true
"exception" : "Invalid Code",
"result" : false
}
}
},
"ymlExample_1" : {
"code" : "0xef0001010004020001000a030016000000000338600060003938601df3ef0001010004020001000303001d0000000001385000",
"results" : {
"Shanghai" : {
"Cancun" : {
"result" : true
},
"Shanghai" : {
"exception" : "Invalid Code",
"result" : false
}
}
},
"ymlExample_2" : {
"code" : "0xefffff",
"results" : {
"Cancun" : {
"exception" : "invalid magic",
"result" : false
},
"Shanghai" : {
"exception" : "Invalid Code",
"result" : false
}
}
},
"ymlExample_3" : {
"code" : "0x610badfe",
"results" : {
"Cancun" : {
"exception" : "invalid magic",
"result" : false
},
"Shanghai" : {
"exception" : "Invalid Code",
"result" : false
}
}
Expand Down
48 changes: 26 additions & 22 deletions src/EOFTestsFiller/efExample/ymlExampleFiller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,20 @@ ymlExample:
_info:
comment: EOF example test

data:
forks:
- ">=Shanghai"

vectors:

# Not EOF1
- :raw 0x60016000F3
- data: |
:raw 0x60016000F3
expectException:
"Shanghai" : "Invalid Code"
">=Cancun" : "invalid magic"
# EOF1 constructor returning an EOF1 contract
- |
- data: |
:raw
0xEF0001 # Magic and version
010004 # One code segment
Expand Down Expand Up @@ -48,28 +56,24 @@ ymlExample:
38 # CODESIZE
50 # POP
00 # STOP
expectException:
"Shanghai" : "Invalid Code"
# Invalid init code
- :raw 0xEFFFFF

# Init code which doesn't create a contract
- :raw 0x610BADFE
# Invalid init code
# Not EOF1
- data: |
:raw 0xEFFFFF
expectException:
"Shanghai" : "Invalid Code"
">=Cancun" : "invalid magic"

expect:
- indexes:
data:
- 0-1
network:
- '>=Shanghai'
result: !!bool true
# Init code which doesn't create a contract
- data: |
:raw 0x610BADFE
expectException:
"Shanghai" : "Invalid Code"
">=Cancun" : "invalid magic"
- indexes:
data:
- 2-3
network:
- '>=Shanghai'
result: !!bool false

0 comments on commit c30f328

Please sign in to comment.