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
411b9800
Commit
411b9800
authored
Oct 22, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reflect VM Env changes
parent
2e45e4d0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
10 deletions
+14
-10
debugger.go
mist/debugger.go
+5
-5
gui.go
mist/gui.go
+4
-4
main.go
mist/main.go
+1
-1
vm_env.go
utils/vm_env.go
+4
-0
No files found.
mist/debugger.go
View file @
411b9800
...
...
@@ -127,7 +127,7 @@ func (self *DebuggerWindow) Debug(valueStr, gasStr, gasPriceStr, scriptStr, data
state
:=
self
.
lib
.
eth
.
StateManager
()
.
TransState
()
account
:=
self
.
lib
.
eth
.
StateManager
()
.
TransState
()
.
GetAccount
(
keyPair
.
Address
())
contract
:=
ethstate
.
NewStateObject
([]
byte
{
0
})
contract
.
Balance
=
value
contract
.
SetBalance
(
value
)
self
.
SetAsm
(
script
)
...
...
@@ -135,14 +135,14 @@ func (self *DebuggerWindow) Debug(valueStr, gasStr, gasPriceStr, scriptStr, data
callerClosure
:=
vm
.
NewClosure
(
&
ethstate
.
Message
{},
account
,
contract
,
script
,
gas
,
gasPrice
)
env
:=
utils
.
NewEnv
(
state
,
block
,
account
.
Address
(),
value
)
vm
:=
vm
.
NewDebugVm
(
env
)
vm
.
Dbg
=
self
.
Db
e
vm
:=
vm
.
NewDebugVm
(
env
)
e
vm
.
Dbg
=
self
.
Db
self
.
vm
=
vm
self
.
vm
=
e
vm
self
.
Db
.
done
=
false
self
.
Logf
(
"callsize %d"
,
len
(
script
))
go
func
()
{
ret
,
g
,
err
:=
callerClosure
.
Call
(
vm
,
data
)
ret
,
g
,
err
:=
callerClosure
.
Call
(
e
vm
,
data
)
tot
:=
new
(
big
.
Int
)
.
Mul
(
g
,
gasPrice
)
self
.
Logf
(
"gas usage %v total price = %v (%v)"
,
g
,
tot
,
ethutil
.
CurrencyToString
(
tot
))
if
err
!=
nil
{
...
...
mist/gui.go
View file @
411b9800
...
...
@@ -382,7 +382,7 @@ func (gui *Gui) update() {
state
:=
gui
.
eth
.
StateManager
()
.
TransState
()
unconfirmedFunds
:=
new
(
big
.
Int
)
gui
.
win
.
Root
()
.
Call
(
"setWalletValue"
,
fmt
.
Sprintf
(
"%v"
,
ethutil
.
CurrencyToString
(
state
.
GetAccount
(
gui
.
address
())
.
Balance
)))
gui
.
win
.
Root
()
.
Call
(
"setWalletValue"
,
fmt
.
Sprintf
(
"%v"
,
ethutil
.
CurrencyToString
(
state
.
GetAccount
(
gui
.
address
())
.
Balance
()
)))
lastBlockLabel
:=
gui
.
getObjectByName
(
"lastBlockLabel"
)
miningLabel
:=
gui
.
getObjectByName
(
"miningLabel"
)
...
...
@@ -410,7 +410,7 @@ func (gui *Gui) update() {
case
ethchain
.
NewBlockEvent
:
gui
.
processBlock
(
ev
.
Block
,
false
)
if
bytes
.
Compare
(
ev
.
Block
.
Coinbase
,
gui
.
address
())
==
0
{
gui
.
setWalletValue
(
gui
.
eth
.
StateManager
()
.
CurrentState
()
.
GetAccount
(
gui
.
address
())
.
Balance
,
nil
)
gui
.
setWalletValue
(
gui
.
eth
.
StateManager
()
.
CurrentState
()
.
GetAccount
(
gui
.
address
())
.
Balance
()
,
nil
)
}
case
ethchain
.
TxEvent
:
...
...
@@ -424,7 +424,7 @@ func (gui *Gui) update() {
unconfirmedFunds
.
Add
(
unconfirmedFunds
,
tx
.
Value
)
}
gui
.
setWalletValue
(
object
.
Balance
,
unconfirmedFunds
)
gui
.
setWalletValue
(
object
.
Balance
()
,
unconfirmedFunds
)
gui
.
insertTransaction
(
"pre"
,
tx
)
...
...
@@ -442,7 +442,7 @@ func (gui *Gui) update() {
gui
.
txDb
.
Put
(
tx
.
Hash
(),
tx
.
RlpEncode
())
}
gui
.
setWalletValue
(
object
.
Balance
,
nil
)
gui
.
setWalletValue
(
object
.
Balance
()
,
nil
)
state
.
UpdateStateObject
(
object
)
}
...
...
mist/main.go
View file @
411b9800
...
...
@@ -12,7 +12,7 @@ import (
const
(
ClientIdentifier
=
"Mist"
Version
=
"0.7.
0
"
Version
=
"0.7.
1
"
)
var
ethereum
*
eth
.
Ethereum
...
...
utils/vm_env.go
View file @
411b9800
...
...
@@ -5,6 +5,7 @@ import (
"github.com/ethereum/eth-go/ethchain"
"github.com/ethereum/eth-go/ethstate"
"github.com/ethereum/eth-go/vm"
)
type
VMEnv
struct
{
...
...
@@ -34,3 +35,6 @@ func (self *VMEnv) BlockHash() []byte { return self.block.Hash() }
func
(
self
*
VMEnv
)
Value
()
*
big
.
Int
{
return
self
.
value
}
func
(
self
*
VMEnv
)
State
()
*
ethstate
.
State
{
return
self
.
state
}
func
(
self
*
VMEnv
)
GasLimit
()
*
big
.
Int
{
return
self
.
block
.
GasLimit
}
func
(
self
*
VMEnv
)
Transfer
(
from
,
to
vm
.
Account
,
amount
*
big
.
Int
)
error
{
return
vm
.
Transfer
(
from
,
to
,
amount
)
}
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