Skip to content

Commit 26de1dd

Browse files
authored
Use raw Bool for JSON responses, better web3 testing harness (#456)
* data, driver, web3: Int and Bool are valid JSON * web3: "true" => true * tests/web3/eth_newBlockFilter: add test of non-existent filter * Makefile, tests/web3: handle diffing output in Makefile * .gitignore: ignore temporary output * tests/web3: update expected output
1 parent 0dccd01 commit 26de1dd

29 files changed

+22
-22
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@
55
/package/pkg
66
/package/src
77
/media/*.pdf
8+
/tests/web3/*.out.json
9+
/tests/web3/*/*.out.json

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,8 @@ tests/web3/no-shutdown/%: KEVM_WEB3_ARGS=
425425

426426
tests/%.run-web3: tests/%.in.json
427427
tests/web3/runtest.sh $< tests/$*.out.json $(KEVM_WEB3_ARGS)
428+
$(CHECK) tests/$*.expected.json tests/$*.out.json
429+
rm -rf tests/$*.out.json
428430

429431
tests/%.parse: tests/%
430432
$(TEST) kast --backend $(TEST_CONCRETE_BACKEND) $< kast > $@-out

data.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Writing a JSON-ish parser in K takes 6 lines.
2929
```k
3030
syntax JSONList ::= List{JSON,","}
3131
syntax JSONKey ::= String | Int
32-
syntax JSON ::= String | Int
32+
syntax JSON ::= String | Int | Bool
3333
| JSONKey ":" JSON
3434
| "{" JSONList "}"
3535
| "[" JSONList "]"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[{"jsonrpc":"2.0","id":1,"result":"0x0"},{"jsonrpc":"2.0","id":2,"result":"0x1"},{"jsonrpc":"2.0","id":3,"result":true},{"jsonrpc":"2.0","id":4,"result":true},{"jsonrpc":"2.0","id":4,"result":false}]

0 commit comments

Comments
 (0)