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
00348756
Commit
00348756
authored
Jan 12, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated tests
parent
35fe4313
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
186 additions
and
26 deletions
+186
-26
stSystemOperationsTest.json
tests/files/StateTests/stSystemOperationsTest.json
+36
-12
201501091831.json
tests/files/VMTests/RandomTests/201501091831.json
+46
-0
201501110744GO.json
tests/files/VMTests/RandomTests/201501110744GO.json
+46
-0
201501120415GO.json
tests/files/VMTests/RandomTests/201501120415GO.json
+46
-0
201501120933PYTHON.json
tests/files/VMTests/RandomTests/201501120933PYTHON.json
+2
-2
vm.go
tests/helper/vm.go
+1
-1
context.go
vm/context.go
+7
-0
vm_debug.go
vm/vm_debug.go
+2
-11
No files found.
tests/files/StateTests/stSystemOperationsTest.json
View file @
00348756
...
...
@@ -6384,25 +6384,33 @@
"out"
:
"0x"
,
"post"
:
{
"095e7baea6a6c7c4c2dfeb977efac326af552d87"
:
{
"balance"
:
"1000000000000
100000
"
,
"balance"
:
"1000000000000
099977
"
,
"code"
:
"0x7c601080600c6000396000f3006000355415600957005b60203560003555600052600060036017f0600055"
,
"nonce"
:
"
0
"
,
"nonce"
:
"
1
"
,
"storage"
:
{
"0x"
:
"0xd2571607e241ecf590ed94b12d87c94babe36db6"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
:
{
"balance"
:
"
10000
"
,
"balance"
:
"
908
"
,
"code"
:
"0x"
,
"nonce"
:
"0"
,
"storage"
:
{
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b"
:
{
"balance"
:
"99999999999989
0000
"
,
"balance"
:
"99999999999989
9092
"
,
"code"
:
"0x"
,
"nonce"
:
"1"
,
"storage"
:
{
}
},
"d2571607e241ecf590ed94b12d87c94babe36db6"
:
{
"balance"
:
"23"
,
"code"
:
"0x"
,
"nonce"
:
"0"
,
"storage"
:
{
}
}
},
"pre"
:
{
...
...
@@ -6445,25 +6453,33 @@
"out"
:
"0x"
,
"post"
:
{
"095e7baea6a6c7c4c2dfeb977efac326af552d87"
:
{
"balance"
:
"1000000000000
100000
"
,
"balance"
:
"1000000000000
099977
"
,
"code"
:
"0x7c601080600c6000396000f3006000355415600957005b6020356000355560005260007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6017f0600055"
,
"nonce"
:
"
0
"
,
"nonce"
:
"
1
"
,
"storage"
:
{
"0x"
:
"0xd2571607e241ecf590ed94b12d87c94babe36db6"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
:
{
"balance"
:
"
10000
"
,
"balance"
:
"
908
"
,
"code"
:
"0x"
,
"nonce"
:
"0"
,
"storage"
:
{
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b"
:
{
"balance"
:
"99999999999989
0000
"
,
"balance"
:
"99999999999989
9092
"
,
"code"
:
"0x"
,
"nonce"
:
"1"
,
"storage"
:
{
}
},
"d2571607e241ecf590ed94b12d87c94babe36db6"
:
{
"balance"
:
"23"
,
"code"
:
"0x"
,
"nonce"
:
"0"
,
"storage"
:
{
}
}
},
"pre"
:
{
...
...
@@ -6506,25 +6522,33 @@
"out"
:
"0x"
,
"post"
:
{
"095e7baea6a6c7c4c2dfeb977efac326af552d87"
:
{
"balance"
:
"1000000000000
100000
"
,
"balance"
:
"1000000000000
099977
"
,
"code"
:
"0x7c601080600c6000396000f3006000355415600957005b60203560003555600052600060006017f0600055"
,
"nonce"
:
"
0
"
,
"nonce"
:
"
1
"
,
"storage"
:
{
"0x"
:
"0xd2571607e241ecf590ed94b12d87c94babe36db6"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
:
{
"balance"
:
"
10000
"
,
"balance"
:
"
908
"
,
"code"
:
"0x"
,
"nonce"
:
"0"
,
"storage"
:
{
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b"
:
{
"balance"
:
"99999999999989
0000
"
,
"balance"
:
"99999999999989
9092
"
,
"code"
:
"0x"
,
"nonce"
:
"1"
,
"storage"
:
{
}
},
"d2571607e241ecf590ed94b12d87c94babe36db6"
:
{
"balance"
:
"23"
,
"code"
:
"0x"
,
"nonce"
:
"0"
,
"storage"
:
{
}
}
},
"pre"
:
{
...
...
tests/files/VMTests/RandomTests/201501091831.json
0 → 100644
View file @
00348756
{
"randomVMtest"
:
{
"callcreates"
:
[
],
"env"
:
{
"currentCoinbase"
:
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
,
"currentDifficulty"
:
"256"
,
"currentGasLimit"
:
"1000000"
,
"currentNumber"
:
"0"
,
"currentTimestamp"
:
"1"
,
"previousHash"
:
"5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"exec"
:
{
"address"
:
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
,
"caller"
:
"cd1722f3947def4cf144679da39c4c32bdc35681"
,
"code"
:
"0x596b0768335591598873a0325111f337"
,
"data"
:
"0x"
,
"gas"
:
"10000"
,
"gasPrice"
:
"100000000000000"
,
"origin"
:
"cd1722f3947def4cf144679da39c4c32bdc35681"
,
"value"
:
"1000000000000000000"
},
"gas"
:
"9997"
,
"logs"
:
[
],
"out"
:
"0x"
,
"post"
:
{
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
:
{
"balance"
:
"1000000000000000000"
,
"code"
:
"0x596b0768335591598873a0325111f337"
,
"nonce"
:
"0"
,
"storage"
:
{
}
}
},
"pre"
:
{
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
:
{
"balance"
:
"1000000000000000000"
,
"code"
:
"0x596b0768335591598873a0325111f337"
,
"nonce"
:
"0"
,
"storage"
:
{
}
}
}
}
}
tests/files/VMTests/RandomTests/201501110744GO.json
0 → 100644
View file @
00348756
{
"randomVMtest"
:
{
"callcreates"
:
[
],
"env"
:
{
"currentCoinbase"
:
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
,
"currentDifficulty"
:
"256"
,
"currentGasLimit"
:
"1000000"
,
"currentNumber"
:
"0"
,
"currentTimestamp"
:
"1"
,
"previousHash"
:
"5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"exec"
:
{
"address"
:
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
,
"caller"
:
"cd1722f3947def4cf144679da39c4c32bdc35681"
,
"code"
:
"0x3858423938447a730a049901951a0a1a"
,
"data"
:
"0x"
,
"gas"
:
"10000"
,
"gasPrice"
:
"100000000000000"
,
"origin"
:
"cd1722f3947def4cf144679da39c4c32bdc35681"
,
"value"
:
"1000000000000000000"
},
"gas"
:
"9991"
,
"logs"
:
[
],
"out"
:
"0x"
,
"post"
:
{
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
:
{
"balance"
:
"1000000000000000000"
,
"code"
:
"0x3858423938447a730a049901951a0a1a"
,
"nonce"
:
"0"
,
"storage"
:
{
}
}
},
"pre"
:
{
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
:
{
"balance"
:
"1000000000000000000"
,
"code"
:
"0x3858423938447a730a049901951a0a1a"
,
"nonce"
:
"0"
,
"storage"
:
{
}
}
}
}
}
tests/files/VMTests/RandomTests/201501120415GO.json
0 → 100644
View file @
00348756
{
"randomVMtest"
:
{
"callcreates"
:
[
],
"env"
:
{
"currentCoinbase"
:
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
,
"currentDifficulty"
:
"256"
,
"currentGasLimit"
:
"1000000"
,
"currentNumber"
:
"0"
,
"currentTimestamp"
:
"1"
,
"previousHash"
:
"5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"exec"
:
{
"address"
:
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
,
"caller"
:
"cd1722f3947def4cf144679da39c4c32bdc35681"
,
"code"
:
"0x619f9a423639"
,
"data"
:
"0x"
,
"gas"
:
"10000"
,
"gasPrice"
:
"100000000000000"
,
"origin"
:
"cd1722f3947def4cf144679da39c4c32bdc35681"
,
"value"
:
"1000000000000000000"
},
"gas"
:
"7442"
,
"logs"
:
[
],
"out"
:
"0x"
,
"post"
:
{
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
:
{
"balance"
:
"1000000000000000000"
,
"code"
:
"0x619f9a423639"
,
"nonce"
:
"0"
,
"storage"
:
{
}
}
},
"pre"
:
{
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
:
{
"balance"
:
"1000000000000000000"
,
"code"
:
"0x619f9a423639"
,
"nonce"
:
"0"
,
"storage"
:
{
}
}
}
}
}
tests/files/VMTests/RandomTests/201501
091727
.json
→
tests/files/VMTests/RandomTests/201501
120933PYTHON
.json
View file @
00348756
...
...
@@ -11,7 +11,7 @@
"exec"
:
{
"address"
:
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
,
"caller"
:
"cd1722f3947def4cf144679da39c4c32bdc35681"
,
"code"
:
"0x
583438f0
"
,
"code"
:
"0x
6303376d4056f107
"
,
"data"
:
"0x"
,
"gas"
:
"10000"
,
"gasPrice"
:
"100000000000000"
,
...
...
@@ -21,7 +21,7 @@
"pre"
:
{
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
:
{
"balance"
:
"1000000000000000000"
,
"code"
:
"0x
583438f0
"
,
"code"
:
"0x
6303376d4056f107
"
,
"nonce"
:
"0"
,
"storage"
:
{
}
...
...
tests/helper/vm.go
View file @
00348756
...
...
@@ -58,7 +58,7 @@ func (self *Env) Difficulty() *big.Int { return self.difficulty }
func
(
self
*
Env
)
State
()
*
state
.
StateDB
{
return
self
.
state
}
func
(
self
*
Env
)
GasLimit
()
*
big
.
Int
{
return
self
.
gasLimit
}
func
(
self
*
Env
)
GetHash
(
n
uint64
)
[]
byte
{
return
nil
return
crypto
.
Sha3
([]
byte
(
big
.
NewInt
(
int64
(
n
))
.
String
()))
}
func
(
self
*
Env
)
AddLog
(
log
state
.
Log
)
{
self
.
logs
=
append
(
self
.
logs
,
log
)
...
...
vm/context.go
View file @
00348756
...
...
@@ -61,6 +61,13 @@ func (c *Context) GetRangeValue(x, size uint64) []byte {
return
ethutil
.
LeftPadBytes
(
c
.
Code
[
x
:
y
],
int
(
size
))
}
func
(
c
*
Context
)
GetCode
(
x
,
size
uint64
)
[]
byte
{
x
=
uint64
(
math
.
Min
(
float64
(
x
),
float64
(
len
(
c
.
Code
))))
y
:=
uint64
(
math
.
Min
(
float64
(
x
+
size
),
float64
(
len
(
c
.
Code
))))
return
ethutil
.
RightPadBytes
(
c
.
Code
[
x
:
y
],
int
(
size
))
}
func
(
c
*
Context
)
Return
(
ret
[]
byte
)
[]
byte
{
// Return the remaining gas to the caller
c
.
caller
.
ReturnGas
(
c
.
Gas
,
c
.
Price
)
...
...
vm/vm_debug.go
View file @
00348756
...
...
@@ -2,7 +2,6 @@ package vm
import
(
"fmt"
"math"
"math/big"
"github.com/ethereum/go-ethereum/crypto"
...
...
@@ -491,21 +490,13 @@ func (self *DebugVm) Run(me, caller ContextRef, code []byte, value, gas, price *
}
else
{
code
=
context
.
Code
}
context
:=
NewContext
(
nil
,
nil
,
code
,
ethutil
.
Big0
,
ethutil
.
Big0
)
var
(
size
=
uint64
(
len
(
code
))
mOff
=
stack
.
Pop
()
.
Uint64
()
cOff
=
stack
.
Pop
()
.
Uint64
()
l
=
stack
.
Pop
()
.
Uint64
()
)
if
cOff
>
size
{
cOff
=
0
l
=
0
}
else
if
cOff
+
l
>
size
{
l
=
uint64
(
math
.
Min
(
float64
(
cOff
+
l
),
float64
(
size
)))
}
codeCopy
:=
code
[
cOff
:
cOff
+
l
]
codeCopy
:=
context
.
GetCode
(
cOff
,
l
)
mem
.
Set
(
mOff
,
l
,
codeCopy
)
...
...
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