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
45ce820b
Commit
45ce820b
authored
May 07, 2014
by
Maran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented value()
parent
05068445
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
state_manager.go
ethchain/state_manager.go
+1
-0
vm.go
ethchain/vm.go
+4
-2
No files found.
ethchain/state_manager.go
View file @
45ce820b
...
@@ -331,6 +331,7 @@ func (sm *StateManager) EvalScript(script []byte, object *StateObject, tx *Trans
...
@@ -331,6 +331,7 @@ func (sm *StateManager) EvalScript(script []byte, object *StateObject, tx *Trans
Coinbase
:
block
.
Coinbase
,
Coinbase
:
block
.
Coinbase
,
Time
:
block
.
Time
,
Time
:
block
.
Time
,
Diff
:
block
.
Difficulty
,
Diff
:
block
.
Difficulty
,
Value
:
tx
.
Value
,
//Price: tx.GasPrice,
//Price: tx.GasPrice,
})
})
closure
.
Call
(
vm
,
tx
.
Data
,
nil
)
closure
.
Call
(
vm
,
tx
.
Data
,
nil
)
...
...
ethchain/vm.go
View file @
45ce820b
...
@@ -5,6 +5,7 @@ import (
...
@@ -5,6 +5,7 @@ import (
"fmt"
"fmt"
"github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/eth-go/ethutil"
_
"github.com/obscuren/secp256k1-go"
_
"github.com/obscuren/secp256k1-go"
"log"
_
"math"
_
"math"
"math/big"
"math/big"
)
)
...
@@ -53,6 +54,7 @@ type RuntimeVars struct {
...
@@ -53,6 +54,7 @@ type RuntimeVars struct {
Time
int64
Time
int64
Diff
*
big
.
Int
Diff
*
big
.
Int
TxData
[]
string
TxData
[]
string
Value
*
big
.
Int
}
}
func
NewVm
(
state
*
State
,
stateManager
*
StateManager
,
vars
RuntimeVars
)
*
Vm
{
func
NewVm
(
state
*
State
,
stateManager
*
StateManager
,
vars
RuntimeVars
)
*
Vm
{
...
@@ -324,8 +326,8 @@ func (vm *Vm) RunClosure(closure *Closure, hook DebugHook) (ret []byte, err erro
...
@@ -324,8 +326,8 @@ func (vm *Vm) RunClosure(closure *Closure, hook DebugHook) (ret []byte, err erro
case
oCALLER
:
case
oCALLER
:
stack
.
Push
(
ethutil
.
BigD
(
closure
.
Callee
()
.
Address
()))
stack
.
Push
(
ethutil
.
BigD
(
closure
.
Callee
()
.
Address
()))
case
oCALLVALUE
:
case
oCALLVALUE
:
// FIXME: Original value of the call, not the current value
log
.
Println
(
"Value:"
,
vm
.
vars
.
Value
)
stack
.
Push
(
closure
.
Value
)
stack
.
Push
(
vm
.
vars
.
Value
)
case
oCALLDATALOAD
:
case
oCALLDATALOAD
:
require
(
1
)
require
(
1
)
offset
:=
stack
.
Pop
()
.
Int64
()
offset
:=
stack
.
Pop
()
.
Int64
()
...
...
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