Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
bb55307a
Commit
bb55307a
authored
Jan 13, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated tests
parent
8f733461
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
584 additions
and
20 deletions
+584
-20
execution.go
core/execution.go
+12
-3
201501131326STACKUNDERFLOW_CPPJIT.json
...MTests/RandomTests/201501131326STACKUNDERFLOW_CPPJIT.json
+31
-0
201501131330CPPJIT.json
tests/files/VMTests/RandomTests/201501131330CPPJIT.json
+31
-0
201501131331CPPJIT.json
tests/files/VMTests/RandomTests/201501131331CPPJIT.json
+31
-0
201501131414CPPJIT.json
tests/files/VMTests/RandomTests/201501131414CPPJIT.json
+31
-0
201501131452CPPJIT.json
tests/files/VMTests/RandomTests/201501131452CPPJIT.json
+31
-0
201501131453CPPJIT.json
tests/files/VMTests/RandomTests/201501131453CPPJIT.json
+31
-0
201501131627CPPJIT.json
tests/files/VMTests/RandomTests/201501131627CPPJIT.json
+31
-0
201501131628CPPJIT.json
tests/files/VMTests/RandomTests/201501131628CPPJIT.json
+31
-0
201501131655CREATE_RETURNS_DIFFERENT_ADDREESS_GO.json
...sts/201501131655CREATE_RETURNS_DIFFERENT_ADDREESS_GO.json
+53
-0
201501131811CPPJIT.json
tests/files/VMTests/RandomTests/201501131811CPPJIT.json
+31
-0
201501131818CPPJIT.json
tests/files/VMTests/RandomTests/201501131818CPPJIT.json
+46
-0
201501131820CPPJIT.json
tests/files/VMTests/RandomTests/201501131820CPPJIT.json
+47
-0
201501131821CPPJIT.json
tests/files/VMTests/RandomTests/201501131821CPPJIT.json
+47
-0
201501131823CPPJIT.json
tests/files/VMTests/RandomTests/201501131823CPPJIT.json
+31
-0
201501131824CPPJIT.json
tests/files/VMTests/RandomTests/201501131824CPPJIT.json
+31
-0
201501131826CPPJIT.json
tests/files/VMTests/RandomTests/201501131826CPPJIT.json
+31
-0
vm_debug.go
vm/vm_debug.go
+7
-17
No files found.
core/execution.go
View file @
bb55307a
...
@@ -5,6 +5,7 @@ import (
...
@@ -5,6 +5,7 @@ import (
"math/big"
"math/big"
"time"
"time"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/vm"
"github.com/ethereum/go-ethereum/vm"
)
)
...
@@ -40,14 +41,22 @@ func (self *Execution) exec(code, contextAddr []byte, caller vm.ContextRef) (ret
...
@@ -40,14 +41,22 @@ func (self *Execution) exec(code, contextAddr []byte, caller vm.ContextRef) (ret
return
nil
,
vm
.
DepthError
{}
return
nil
,
vm
.
DepthError
{}
}
}
vsnapshot
:=
env
.
State
()
.
Copy
()
if
len
(
self
.
address
)
==
0
{
// Generate a new address
nonce
:=
env
.
State
()
.
GetNonce
(
caller
.
Address
())
self
.
address
=
crypto
.
CreateAddress
(
caller
.
Address
(),
nonce
)
env
.
State
()
.
SetNonce
(
caller
.
Address
(),
nonce
+
1
)
}
from
,
to
:=
env
.
State
()
.
GetStateObject
(
caller
.
Address
()),
env
.
State
()
.
GetOrNewStateObject
(
self
.
address
)
from
,
to
:=
env
.
State
()
.
GetStateObject
(
caller
.
Address
()),
env
.
State
()
.
GetOrNewStateObject
(
self
.
address
)
// Skipping transfer is used on testing for the initial call
err
=
env
.
Transfer
(
from
,
to
,
self
.
value
)
err
=
env
.
Transfer
(
from
,
to
,
self
.
value
)
if
err
!=
nil
{
if
err
!=
nil
{
env
.
State
()
.
Set
(
vsnapshot
)
caller
.
ReturnGas
(
self
.
Gas
,
self
.
price
)
caller
.
ReturnGas
(
self
.
Gas
,
self
.
price
)
err
=
fmt
.
Errorf
(
"insufficient funds to transfer value. Req %v, has %v"
,
self
.
value
,
from
.
Balance
())
return
nil
,
fmt
.
Errorf
(
"insufficient funds to transfer value. Req %v, has %v"
,
self
.
value
,
from
.
Balance
())
return
}
}
snapshot
:=
env
.
State
()
.
Copy
()
snapshot
:=
env
.
State
()
.
Copy
()
...
...
tests/files/VMTests/RandomTests/201501131326STACKUNDERFLOW_CPPJIT.json
0 → 100644
View file @
bb55307a
{
"randomVMtest"
:
{
"env"
:
{
"currentCoinbase"
:
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
,
"currentDifficulty"
:
"256"
,
"currentGasLimit"
:
"1000000"
,
"currentNumber"
:
"0"
,
"currentTimestamp"
:
"1"
,
"previousHash"
:
"5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"exec"
:
{
"address"
:
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
,
"caller"
:
"cd1722f3947def4cf144679da39c4c32bdc35681"
,
"code"
:
"0x10375807f18320838f51427932"
,
"data"
:
"0x"
,
"gas"
:
"10000"
,
"gasPrice"
:
"100000000000000"
,
"origin"
:
"cd1722f3947def4cf144679da39c4c32bdc35681"
,
"value"
:
"1000000000000000000"
},
"pre"
:
{
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
:
{
"balance"
:
"1000000000000000000"
,
"code"
:
"0x10375807f18320838f51427932"
,
"nonce"
:
"0"
,
"storage"
:
{
}
}
}
}
}
tests/files/VMTests/RandomTests/201501131330CPPJIT.json
0 → 100644
View file @
bb55307a
{
"randomVMtest"
:
{
"env"
:
{
"currentCoinbase"
:
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
,
"currentDifficulty"
:
"256"
,
"currentGasLimit"
:
"1000000"
,
"currentNumber"
:
"0"
,
"currentTimestamp"
:
"1"
,
"previousHash"
:
"5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"exec"
:
{
"address"
:
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
,
"caller"
:
"cd1722f3947def4cf144679da39c4c32bdc35681"
,
"code"
:
"0x8f06058888984060113c"
,
"data"
:
"0x"
,
"gas"
:
"10000"
,
"gasPrice"
:
"100000000000000"
,
"origin"
:
"cd1722f3947def4cf144679da39c4c32bdc35681"
,
"value"
:
"1000000000000000000"
},
"pre"
:
{
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
:
{
"balance"
:
"1000000000000000000"
,
"code"
:
"0x8f06058888984060113c"
,
"nonce"
:
"0"
,
"storage"
:
{
}
}
}
}
}
tests/files/VMTests/RandomTests/201501131331CPPJIT.json
0 → 100644
View file @
bb55307a
{
"randomVMtest"
:
{
"env"
:
{
"currentCoinbase"
:
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
,
"currentDifficulty"
:
"256"
,
"currentGasLimit"
:
"1000000"
,
"currentNumber"
:
"0"
,
"currentTimestamp"
:
"1"
,
"previousHash"
:
"5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"exec"
:
{
"address"
:
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
,
"caller"
:
"cd1722f3947def4cf144679da39c4c32bdc35681"
,
"code"
:
"0x60023c"
,
"data"
:
"0x"
,
"gas"
:
"10000"
,
"gasPrice"
:
"100000000000000"
,
"origin"
:
"cd1722f3947def4cf144679da39c4c32bdc35681"
,
"value"
:
"1000000000000000000"
},
"pre"
:
{
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
:
{
"balance"
:
"1000000000000000000"
,
"code"
:
"0x60023c"
,
"nonce"
:
"0"
,
"storage"
:
{
}
}
}
}
}
tests/files/VMTests/RandomTests/201501131414CPPJIT.json
0 → 100644
View file @
bb55307a
{
"randomVMtest"
:
{
"env"
:
{
"currentCoinbase"
:
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
,
"currentDifficulty"
:
"256"
,
"currentGasLimit"
:
"1000000"
,
"currentNumber"
:
"0"
,
"currentTimestamp"
:
"1"
,
"previousHash"
:
"5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"exec"
:
{
"address"
:
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
,
"caller"
:
"cd1722f3947def4cf144679da39c4c32bdc35681"
,
"code"
:
"0x98a15260977a64"
,
"data"
:
"0x"
,
"gas"
:
"10000"
,
"gasPrice"
:
"100000000000000"
,
"origin"
:
"cd1722f3947def4cf144679da39c4c32bdc35681"
,
"value"
:
"1000000000000000000"
},
"pre"
:
{
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
:
{
"balance"
:
"1000000000000000000"
,
"code"
:
"0x98a15260977a64"
,
"nonce"
:
"0"
,
"storage"
:
{
}
}
}
}
}
tests/files/VMTests/RandomTests/201501131452CPPJIT.json
0 → 100644
View file @
bb55307a
{
"randomVMtest"
:
{
"env"
:
{
"currentCoinbase"
:
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
,
"currentDifficulty"
:
"256"
,
"currentGasLimit"
:
"1000000"
,
"currentNumber"
:
"0"
,
"currentTimestamp"
:
"1"
,
"previousHash"
:
"5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"exec"
:
{
"address"
:
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
,
"caller"
:
"cd1722f3947def4cf144679da39c4c32bdc35681"
,
"code"
:
"0x5982"
,
"data"
:
"0x"
,
"gas"
:
"10000"
,
"gasPrice"
:
"100000000000000"
,
"origin"
:
"cd1722f3947def4cf144679da39c4c32bdc35681"
,
"value"
:
"1000000000000000000"
},
"pre"
:
{
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
:
{
"balance"
:
"1000000000000000000"
,
"code"
:
"0x5982"
,
"nonce"
:
"0"
,
"storage"
:
{
}
}
}
}
}
tests/files/VMTests/RandomTests/201501131453CPPJIT.json
0 → 100644
View file @
bb55307a
{
"randomVMtest"
:
{
"env"
:
{
"currentCoinbase"
:
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
,
"currentDifficulty"
:
"256"
,
"currentGasLimit"
:
"1000000"
,
"currentNumber"
:
"0"
,
"currentTimestamp"
:
"1"
,
"previousHash"
:
"5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"exec"
:
{
"address"
:
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
,
"caller"
:
"cd1722f3947def4cf144679da39c4c32bdc35681"
,
"code"
:
"0x4386735568"
,
"data"
:
"0x"
,
"gas"
:
"10000"
,
"gasPrice"
:
"100000000000000"
,
"origin"
:
"cd1722f3947def4cf144679da39c4c32bdc35681"
,
"value"
:
"1000000000000000000"
},
"pre"
:
{
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
:
{
"balance"
:
"1000000000000000000"
,
"code"
:
"0x4386735568"
,
"nonce"
:
"0"
,
"storage"
:
{
}
}
}
}
}
tests/files/VMTests/RandomTests/201501131627CPPJIT.json
0 → 100644
View file @
bb55307a
{
"randomVMtest"
:
{
"env"
:
{
"currentCoinbase"
:
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
,
"currentDifficulty"
:
"115792089237316195423570985008687907853269984665640564039457584007913129639935"
,
"currentGasLimit"
:
"1000000"
,
"currentNumber"
:
"0"
,
"currentTimestamp"
:
"2"
,
"previousHash"
:
"5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"exec"
:
{
"address"
:
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
,
"caller"
:
"cd1722f3947def4cf144679da39c4c32bdc35681"
,
"code"
:
"0x41414544454545408a85836e9408689355"
,
"data"
:
"0x"
,
"gas"
:
"10000"
,
"gasPrice"
:
"100000000000000"
,
"origin"
:
"cd1722f3947def4cf144679da39c4c32bdc35681"
,
"value"
:
"1000000000000000000"
},
"pre"
:
{
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
:
{
"balance"
:
"1000000000000000000"
,
"code"
:
"0x41414544454545408a85836e9408689355"
,
"nonce"
:
"0"
,
"storage"
:
{
}
}
}
}
}
tests/files/VMTests/RandomTests/201501131628CPPJIT.json
0 → 100644
View file @
bb55307a
{
"randomVMtest"
:
{
"env"
:
{
"currentCoinbase"
:
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
,
"currentDifficulty"
:
"115792089237316195423570985008687907853269984665640564039457584007913129639935"
,
"currentGasLimit"
:
"1000000"
,
"currentNumber"
:
"0"
,
"currentTimestamp"
:
"2"
,
"previousHash"
:
"5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"exec"
:
{
"address"
:
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
,
"caller"
:
"cd1722f3947def4cf144679da39c4c32bdc35681"
,
"code"
:
"0x45894544404042411955"
,
"data"
:
"0x"
,
"gas"
:
"10000"
,
"gasPrice"
:
"100000000000000"
,
"origin"
:
"cd1722f3947def4cf144679da39c4c32bdc35681"
,
"value"
:
"1000000000000000000"
},
"pre"
:
{
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
:
{
"balance"
:
"1000000000000000000"
,
"code"
:
"0x45894544404042411955"
,
"nonce"
:
"0"
,
"storage"
:
{
}
}
}
}
}
tests/files/VMTests/RandomTests/201501131655CREATE_RETURNS_DIFFERENT_ADDREESS_GO.json
0 → 100644
View file @
bb55307a
{
"randomVMtest"
:
{
"callcreates"
:
[
{
"data"
:
"0x"
,
"destination"
:
""
,
"gasLimit"
:
"9792"
,
"value"
:
"0"
}
],
"env"
:
{
"currentCoinbase"
:
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
,
"currentDifficulty"
:
"115792089237316195423570985008687907853269984665640564039457584007913129639935"
,
"currentGasLimit"
:
"1000000"
,
"currentNumber"
:
"0"
,
"currentTimestamp"
:
"2"
,
"previousHash"
:
"5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"exec"
:
{
"address"
:
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
,
"caller"
:
"cd1722f3947def4cf144679da39c4c32bdc35681"
,
"code"
:
"0x4342404343424041f0f0627ea30555"
,
"data"
:
"0x"
,
"gas"
:
"10000"
,
"gasPrice"
:
"100000000000000"
,
"origin"
:
"cd1722f3947def4cf144679da39c4c32bdc35681"
,
"value"
:
"1000000000000000000"
},
"gas"
:
"9491"
,
"logs"
:
[
],
"out"
:
"0x"
,
"post"
:
{
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
:
{
"balance"
:
"1000000000000000000"
,
"code"
:
"0x4342404343424041f0f0627ea30555"
,
"nonce"
:
"0"
,
"storage"
:
{
"0x7ea305"
:
"0x945304eb96065b2a98b57a48a06ae28d285a71b5"
}
}
},
"pre"
:
{
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
:
{
"balance"
:
"1000000000000000000"
,
"code"
:
"0x4342404343424041f0f0627ea30555"
,
"nonce"
:
"0"
,
"storage"
:
{
}
}
}
}
}
tests/files/VMTests/RandomTests/201501131811CPPJIT.json
0 → 100644
View file @
bb55307a
{
"randomVMtest"
:
{
"env"
:
{
"currentCoinbase"
:
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
,
"currentDifficulty"
:
"115792089237316195423570985008687907853269984665640564039457584007913129639935"
,
"currentGasLimit"
:
"1000000"
,
"currentNumber"
:
"300"
,
"currentTimestamp"
:
"2"
,
"previousHash"
:
"5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"exec"
:
{
"address"
:
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
,
"caller"
:
"cd1722f3947def4cf144679da39c4c32bdc35681"
,
"code"
:
"0x42451a455342ee4255"
,
"data"
:
"0x"
,
"gas"
:
"10000"
,
"gasPrice"
:
"100000000000000"
,
"origin"
:
"cd1722f3947def4cf144679da39c4c32bdc35681"
,
"value"
:
"1000000000000000000"
},
"pre"
:
{
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
:
{
"balance"
:
"1000000000000000000"
,
"code"
:
"0x42451a455342ee4255"
,
"nonce"
:
"0"
,
"storage"
:
{
}
}
}
}
}
tests/files/VMTests/RandomTests/201501131818CPPJIT.json
0 → 100644
View file @
bb55307a
{
"randomVMtest"
:
{
"callcreates"
:
[
],
"env"
:
{
"currentCoinbase"
:
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
,
"currentDifficulty"
:
"115792089237316195423570985008687907853269984665640564039457584007913129639935"
,
"currentGasLimit"
:
"1000000"
,
"currentNumber"
:
"300"
,
"currentTimestamp"
:
"2"
,
"previousHash"
:
"5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"exec"
:
{
"address"
:
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
,
"caller"
:
"cd1722f3947def4cf144679da39c4c32bdc35681"
,
"code"
:
"0x414543434242411a3578f7d99a9a5afe"
,
"data"
:
"0x"
,
"gas"
:
"10000"
,
"gasPrice"
:
"100000000000000"
,
"origin"
:
"cd1722f3947def4cf144679da39c4c32bdc35681"
,
"value"
:
"1000000000000000000"
},
"gas"
:
"9990"
,
"logs"
:
[
],
"out"
:
"0x"
,
"post"
:
{
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
:
{
"balance"
:
"1000000000000000000"
,
"code"
:
"0x414543434242411a3578f7d99a9a5afe"
,
"nonce"
:
"0"
,
"storage"
:
{
}
}
},
"pre"
:
{
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
:
{
"balance"
:
"1000000000000000000"
,
"code"
:
"0x414543434242411a3578f7d99a9a5afe"
,
"nonce"
:
"0"
,
"storage"
:
{
}
}
}
}
}
tests/files/VMTests/RandomTests/201501131820CPPJIT.json
0 → 100644
View file @
bb55307a
{
"randomVMtest"
:
{
"callcreates"
:
[
],
"env"
:
{
"currentCoinbase"
:
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
,
"currentDifficulty"
:
"115792089237316195423570985008687907853269984665640564039457584007913129639935"
,
"currentGasLimit"
:
"1000000"
,
"currentNumber"
:
"300"
,
"currentTimestamp"
:
"2"
,
"previousHash"
:
"5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"exec"
:
{
"address"
:
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
,
"caller"
:
"cd1722f3947def4cf144679da39c4c32bdc35681"
,
"code"
:
"0x42454045414440455755"
,
"data"
:
"0x"
,
"gas"
:
"10000"
,
"gasPrice"
:
"100000000000000"
,
"origin"
:
"cd1722f3947def4cf144679da39c4c32bdc35681"
,
"value"
:
"1000000000000000000"
},
"gas"
:
"9691"
,
"logs"
:
[
],
"out"
:
"0x"
,
"post"
:
{
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
:
{
"balance"
:
"1000000000000000000"
,
"code"
:
"0x42454045414440455755"
,
"nonce"
:
"0"
,
"storage"
:
{
"0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
:
"0x0f4240"
}
}
},
"pre"
:
{
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
:
{
"balance"
:
"1000000000000000000"
,
"code"
:
"0x42454045414440455755"
,
"nonce"
:
"0"
,
"storage"
:
{
}
}
}
}
}
tests/files/VMTests/RandomTests/201501131821CPPJIT.json
0 → 100644
View file @
bb55307a
{
"randomVMtest"
:
{
"callcreates"
:
[
],
"env"
:
{
"currentCoinbase"
:
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
,
"currentDifficulty"
:
"115792089237316195423570985008687907853269984665640564039457584007913129639935"
,
"currentGasLimit"
:
"1000000"
,
"currentNumber"
:
"300"
,
"currentTimestamp"
:
"2"
,
"previousHash"
:
"5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"exec"
:
{
"address"
:
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
,
"caller"
:
"cd1722f3947def4cf144679da39c4c32bdc35681"
,
"code"
:
"0x434341434182404557459142556955"
,
"data"
:
"0x"
,
"gas"
:
"10000"
,
"gasPrice"
:
"100000000000000"
,
"origin"
:
"cd1722f3947def4cf144679da39c4c32bdc35681"
,
"value"
:
"1000000000000000000"
},
"gas"
:
"9687"
,
"logs"
:
[
],
"out"
:
"0x"
,
"post"
:
{
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
:
{
"balance"
:
"1000000000000000000"
,
"code"
:
"0x434341434182404557459142556955"
,
"nonce"
:
"0"
,
"storage"
:
{
"0x02"
:
"0x012c"
}
}
},
"pre"
:
{
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
:
{
"balance"
:
"1000000000000000000"
,
"code"
:
"0x434341434182404557459142556955"
,
"nonce"
:
"0"
,
"storage"
:
{
}
}
}
}
}
tests/files/VMTests/RandomTests/201501131823CPPJIT.json
0 → 100644
View file @
bb55307a
{
"randomVMtest"
:
{
"env"
:
{
"currentCoinbase"
:
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
,
"currentDifficulty"
:
"115792089237316195423570985008687907853269984665640564039457584007913129639935"
,
"currentGasLimit"
:
"1000000"
,
"currentNumber"
:
"300"
,
"currentTimestamp"
:
"2"
,
"previousHash"
:
"5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"exec"
:
{
"address"
:
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
,
"caller"
:
"cd1722f3947def4cf144679da39c4c32bdc35681"
,
"code"
:
"0x43454545451a80a96139e64693a255"
,
"data"
:
"0x"
,
"gas"
:
"10000"
,
"gasPrice"
:
"100000000000000"
,
"origin"
:
"cd1722f3947def4cf144679da39c4c32bdc35681"
,
"value"
:
"1000000000000000000"
},
"pre"
:
{
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
:
{
"balance"
:
"1000000000000000000"
,
"code"
:
"0x43454545451a80a96139e64693a255"
,
"nonce"
:
"0"
,
"storage"
:
{
}
}
}
}
}
tests/files/VMTests/RandomTests/201501131824CPPJIT.json
0 → 100644
View file @
bb55307a
{
"randomVMtest"
:
{
"env"
:
{
"currentCoinbase"
:
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
,
"currentDifficulty"
:
"115792089237316195423570985008687907853269984665640564039457584007913129639935"
,
"currentGasLimit"
:
"1000000"
,
"currentNumber"
:
"300"
,
"currentTimestamp"
:
"2"
,
"previousHash"
:
"5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"exec"
:
{
"address"
:
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
,
"caller"
:
"cd1722f3947def4cf144679da39c4c32bdc35681"
,
"code"
:
"0x45444443414144451a86fa55"
,
"data"
:
"0x"
,
"gas"
:
"10000"
,
"gasPrice"
:
"100000000000000"
,
"origin"
:
"cd1722f3947def4cf144679da39c4c32bdc35681"
,
"value"
:
"1000000000000000000"
},
"pre"
:
{
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
:
{
"balance"
:
"1000000000000000000"
,
"code"
:
"0x45444443414144451a86fa55"
,
"nonce"
:
"0"
,
"storage"
:
{
}
}
}
}
}
tests/files/VMTests/RandomTests/201501131826CPPJIT.json
0 → 100644
View file @
bb55307a
{
"randomVMtest"
:
{
"env"
:
{
"currentCoinbase"
:
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
,
"currentDifficulty"
:
"115792089237316195423570985008687907853269984665640564039457584007913129639935"
,
"currentGasLimit"
:
"1000000"
,
"currentNumber"
:
"300"
,
"currentTimestamp"
:
"2"
,
"previousHash"
:
"5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"exec"
:
{
"address"
:
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
,
"caller"
:
"cd1722f3947def4cf144679da39c4c32bdc35681"
,
"code"
:
"0x4245411a40444542c1505b7855"
,
"data"
:
"0x"
,
"gas"
:
"10000"
,
"gasPrice"
:
"100000000000000"
,
"origin"
:
"cd1722f3947def4cf144679da39c4c32bdc35681"
,
"value"
:
"1000000000000000000"
},
"pre"
:
{
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
:
{
"balance"
:
"1000000000000000000"
,
"code"
:
"0x4245411a40444542c1505b7855"
,
"nonce"
:
"0"
,
"storage"
:
{
}
}
}
}
}
vm/vm_debug.go
View file @
bb55307a
...
@@ -643,32 +643,21 @@ func (self *DebugVm) Run(me, caller ContextRef, code []byte, value, gas, price *
...
@@ -643,32 +643,21 @@ func (self *DebugVm) Run(me, caller ContextRef, code []byte, value, gas, price *
case
CREATE
:
case
CREATE
:
var
(
var
(
err
error
value
=
stack
.
Pop
()
value
=
stack
.
Pop
()
size
,
offset
=
stack
.
Popn
()
size
,
offset
=
stack
.
Popn
()
input
=
mem
.
Get
(
offset
.
Int64
(),
size
.
Int64
())
input
=
mem
.
Get
(
offset
.
Int64
(),
size
.
Int64
())
gas
=
new
(
big
.
Int
)
.
Set
(
context
.
Gas
)
gas
=
new
(
big
.
Int
)
.
Set
(
context
.
Gas
)
addr
[]
byte
// Snapshot the current stack so we are able to
// revert back to it later.
//snapshot = self.env.State().Copy()
)
)
// Generate a new address
n
:=
statedb
.
GetNonce
(
context
.
Address
())
addr
:=
crypto
.
CreateAddress
(
context
.
Address
(),
n
)
statedb
.
SetNonce
(
context
.
Address
(),
n
+
1
)
self
.
Printf
(
" (*) %x"
,
addr
)
.
Endl
()
context
.
UseGas
(
context
.
Gas
)
context
.
UseGas
(
context
.
Gas
)
ret
,
suberr
,
ref
:=
self
.
env
.
Create
(
context
,
nil
,
input
,
gas
,
price
,
value
)
ret
,
suberr
,
ref
:=
self
.
env
.
Create
(
context
,
addr
,
input
,
gas
,
price
,
value
)
if
suberr
!=
nil
{
if
suberr
!=
nil
{
stack
.
Push
(
ethutil
.
BigFalse
)
stack
.
Push
(
ethutil
.
BigFalse
)
self
.
Printf
(
"
CREATE err %v"
,
err
)
self
.
Printf
(
"
(*) 0x0 %v"
,
sub
err
)
}
else
{
}
else
{
// gas < len(ret) * CreateDataGas == NO_CODE
// gas < len(ret) * CreateDataGas == NO_CODE
dataGas
:=
big
.
NewInt
(
int64
(
len
(
ret
)))
dataGas
:=
big
.
NewInt
(
int64
(
len
(
ret
)))
dataGas
.
Mul
(
dataGas
,
GasCreateByte
)
dataGas
.
Mul
(
dataGas
,
GasCreateByte
)
...
@@ -676,11 +665,12 @@ func (self *DebugVm) Run(me, caller ContextRef, code []byte, value, gas, price *
...
@@ -676,11 +665,12 @@ func (self *DebugVm) Run(me, caller ContextRef, code []byte, value, gas, price *
ref
.
SetCode
(
ret
)
ref
.
SetCode
(
ret
)
msg
.
Output
=
ret
msg
.
Output
=
ret
}
}
addr
=
ref
.
Address
()
stack
.
Push
(
ethutil
.
BigD
(
addr
))
stack
.
Push
(
ethutil
.
BigD
(
addr
))
}
self
.
Endl
()
self
.
Printf
(
" (*) %x"
,
addr
)
}
// Debug hook
// Debug hook
if
self
.
Dbg
!=
nil
{
if
self
.
Dbg
!=
nil
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment