diff --git a/GeneralStateTests/stExample/add11.json b/GeneralStateTests/stExample/add11.json index 0a77228e6d7..009fd92929a 100644 --- a/GeneralStateTests/stExample/add11.json +++ b/GeneralStateTests/stExample/add11.json @@ -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", diff --git a/src/GeneralStateTestsFiller/stExample/add11Filler.json b/src/GeneralStateTestsFiller/stExample/add11Filler.json index 16c63b7be74..16a58cd0e48 100644 --- a/src/GeneralStateTestsFiller/stExample/add11Filler.json +++ b/src/GeneralStateTestsFiller/stExample/add11Filler.json @@ -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" @@ -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" : { } @@ -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" ],