Skip to content

Commit

Permalink
Merge pull request #601 from ethereum/maintanace
Browse files Browse the repository at this point in the history
add comments to stExample test
  • Loading branch information
winsvega committed Jun 8, 2019
2 parents 2d74adc + dbf84e4 commit 784ff96
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 10 deletions.
8 changes: 4 additions & 4 deletions GeneralStateTests/stExample/add11.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"add11" : {
"_info" : {
"comment" : "",
"filledwith" : "testeth 1.6.0-alpha.0-11+commit.978e68d2",
"lllcversion" : "Version: 0.5.0-develop.2018.11.9+commit.9709dfe0.Linux.g++",
"comment" : "A test for (add 1 1) opcode result",
"filledwith" : "testeth 1.7.0-alpha.0+commit.1e771655.dirty",
"lllcversion" : "Version: 0.5.0-develop.2019.6.1+commit.9709dfe0.Linux.g++",
"source" : "src/GeneralStateTestsFiller/stExample/add11Filler.json",
"sourceHash" : "4cbab2514fa414ba6017082264950e9c59249d384bef9a3cec07a611523460a4"
"sourceHash" : "277bbddcfd0dbfb081809512465049a68f98a89afa9d1aef3958b51815cf963c"
},
"env" : {
"currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
Expand Down
10 changes: 10 additions & 0 deletions Retesteth/gethTCP/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name" : "Ethereum GO on TCP",
"socketType" : "tcp",
"socketAddress" : [
"127.0.0.1:8545",
"127.0.0.1:8546",
"127.0.0.1:8547",
"127.0.0.1:8548"
]
}
32 changes: 26 additions & 6 deletions src/GeneralStateTestsFiller/stExample/add11Filler.json
Original file line number Diff line number Diff line change
@@ -1,55 +1,70 @@
{
"add11" : {
"_info" : {
"comment" : "A test for (add 1 1) opcode result"
},
"env" : {
"//comment" : "A blockinfo section (obsolite). Do not change. (only coinbase and gasLimit could be changed)",
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x20000",
"currentGasLimit" : "1000000",
"currentNumber" : "1",
"currentTimestamp" : "1000",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"//comment" : "Expect section is the post condition for the transaction result",
"expect" : [
{
"//comment" : "indexes are used to specify post condition for a given transaction range.",
"//comment" : "transaction section describe multiple transaction which will be executed on pre state",
"indexes" : {
"//comment" : "-1 for transaction with any data from this field. or a particular index, or range [0, 1, 2]",
"data" : -1,
"gas" : -1,
"gas" : 0,
"value" : -1
},
"//comment" : "hard fork order: Frontier, Homestead, EIP150, EIP155, Byzantium, Constantinople, ConstantinopleFix",
"network" : [">=Frontier"],
"result" : {
"//comment" : "Account in expect section would be checked for the fields specified here (balance, code, storage)",
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "1000000000000100000",
"code" : "0x6001600101600055",
"storage" : {
"0x00" : "0x02"
}
},
"//comment" : "could be incomplete type. only balance field would be checked.",
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
"balance" : "41012",
"code" : "0x",
"nonce" : "0",
"storage" : {
}
"balance" : "41012"
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "999999999999858988",
"code" : "0x",
"nonce" : "1",
"storage" : {
}
},
"//comment" : "check that this address is not generated to the post state",
"e94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"shouldnotexist" : "1"
}
}
}
],
"//comment" : "Pre condition state for the test",
"pre" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"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) }",
"code" : "0x6001600101600055",
"nonce" : "0",
"storage" : {
}
},
"//comment" : "A pre state account description must be complete (balance, code, nonce, storage)",
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "1000000000000000000",
"code" : "0x",
Expand All @@ -58,16 +73,21 @@
}
}
},
"//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) }}}",
"data" : [
""
],
"gasLimit" : [
"400000"
],
"gasPrice" : "1",
"//comment" : "nonce must be same as account nonce a94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"nonce" : "0",
"//comment" : "secretKey is a privKey of a94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"//comment" : "if `to` field is empty, the transaction becomes contract creation. code from data will be executed as a deployment code",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"value" : [
"100000"
Expand Down

0 comments on commit 784ff96

Please sign in to comment.