Skip to content

Commit

Permalink
Merge pull request #620 from ethereum/example
Browse files Browse the repository at this point in the history
add more comments to stExample
  • Loading branch information
winsvega committed Aug 7, 2019
2 parents da6d391 + dd6e445 commit 418146f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
4 changes: 2 additions & 2 deletions GeneralStateTests/stExample/add11.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"add11" : {
"_info" : {
"comment" : "A test for (add 1 1) opcode result",
"filledwith" : "testeth 1.7.0-alpha.0+commit.2b11ce5c",
"filledwith" : "testeth 1.7.0-alpha.1-23+commit.5bdaa090.dirty",
"lllcversion" : "Version: 0.5.0-develop.2018.11.9+commit.9709dfe0.Linux.g++",
"source" : "src/GeneralStateTestsFiller/stExample/add11Filler.json",
"sourceHash" : "277bbddcfd0dbfb081809512465049a68f98a89afa9d1aef3958b51815cf963c"
"sourceHash" : "ea3f7fedbf492a74d6a402d8891cdca4743548ff965a94258e583987be1fd760"
},
"env" : {
"currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
Expand Down
11 changes: 10 additions & 1 deletion src/GeneralStateTestsFiller/stExample/add11Filler.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@
"result" : {
"//comment" : "Account in expect section would be checked for the fields specified here (balance, code, storage)",
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"//comment" : "Better not to check the gas or mining reward affected account's balances.",
"//comment" : "A change in gasPrice will affect the test and this post condition.",
"//comment" : "So unless the test doesn't really requrie it, don't check coinbase/miner address balance or sender balance in post section",
"balance" : "1000000000000100000",
"//comment" : "Byte Code example",
"code" : "0x6001600101600055",
"storage" : {
"0x00" : "0x02"
Expand Down Expand Up @@ -58,8 +62,11 @@
"balance" : "1000000000000000000",
"//comment": "If lllc compiler is installed, LLL code will be converted into EVM bytecode when --filltests",
"//code" : "put result of add(1,1) into storage cell 0",
"//code" : "{ [[ 0 ]] (ADD 1 1) }",
"//comment" : "Bytecode example: ",
"code" : "0x6001600101600055",
"//comment" : "LLL Code example. Use LLL with comments, so your tests would have transparent source logic.",
"//comment" : "If the LLL is to bit for .json use .yml test format for better sourcing of the contract",
"code" : "{ [[0]] (ADD 1 1) }",
"nonce" : "0",
"storage" : {
}
Expand All @@ -76,9 +83,11 @@
"//comment" : "multiple transaction description that will be applied on a pre state",
"transaction" : {
"//comment" : "foreach d in `data` { foreach g in `gasLimit` { foreach v in `value` { pre.applyTransaction(d, g, v) }}}",
"//comment" : "each element of the data array is treated same as account's code field. You could use LLL here",
"data" : [
""
],
"//comment" : "Be careful when adding gasLimits that are < then intrinsic gas cost. StateTests are not allowed to have invalid transactions",
"gasLimit" : [
"400000"
],
Expand Down

0 comments on commit 418146f

Please sign in to comment.