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
3f904bf3
Commit
3f904bf3
authored
Aug 25, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented POST
parent
cdbc3ecc
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
209 additions
and
71 deletions
+209
-71
state_transition.go
ethchain/state_transition.go
+9
-0
state_object.go
ethstate/state_object.go
+6
-0
closure.go
ethvm/closure.go
+1
-0
types.go
ethvm/types.go
+2
-0
vm.go
ethvm/vm.go
+191
-70
natpmp.go
natpmp.go
+0
-1
No files found.
ethchain/state_transition.go
View file @
3f904bf3
...
...
@@ -278,6 +278,15 @@ func (self *StateTransition) Eval(msg *ethstate.Message, script []byte, context
ret
,
_
,
err
=
callerClosure
.
Call
(
vm
,
self
.
tx
.
Data
)
if
err
==
nil
{
// Execute POSTs
for
e
:=
vm
.
Queue
()
.
Front
();
e
!=
nil
;
e
=
e
.
Next
()
{
msg
:=
e
.
Value
.
(
*
ethvm
.
Message
)
msg
.
Exec
(
transactor
)
}
}
return
}
...
...
ethstate/state_object.go
View file @
3f904bf3
...
...
@@ -245,6 +245,7 @@ func (self *StateObject) Copy() *StateObject {
stateObject
.
InitCode
=
ethutil
.
CopyBytes
(
self
.
InitCode
)
stateObject
.
storage
=
self
.
storage
.
Copy
()
stateObject
.
gasPool
.
Set
(
self
.
gasPool
)
stateObject
.
remove
=
self
.
remove
return
stateObject
}
...
...
@@ -271,6 +272,11 @@ func (c *StateObject) Init() Code {
return
c
.
InitCode
}
// To satisfy ClosureRef
func
(
self
*
StateObject
)
Object
()
*
StateObject
{
return
self
}
// Debug stuff
func
(
self
*
StateObject
)
CreateOutputForDiff
()
{
fmt
.
Printf
(
"%x %x %x %x
\n
"
,
self
.
Address
(),
self
.
State
.
Root
(),
self
.
Balance
.
Bytes
(),
self
.
Nonce
)
...
...
ethvm/closure.go
View file @
3f904bf3
...
...
@@ -12,6 +12,7 @@ import (
type
ClosureRef
interface
{
ReturnGas
(
*
big
.
Int
,
*
big
.
Int
)
Address
()
[]
byte
Object
()
*
ethstate
.
StateObject
GetStorage
(
*
big
.
Int
)
*
ethutil
.
Value
SetStorage
(
*
big
.
Int
,
*
ethutil
.
Value
)
}
...
...
ethvm/types.go
View file @
3f904bf3
...
...
@@ -145,6 +145,7 @@ const (
CREATE
=
0xf0
CALL
=
0xf1
RETURN
=
0xf2
POST
=
0xf3
// 0x70 range - other
LOG
=
0xfe
// XXX Unofficial
...
...
@@ -438,6 +439,7 @@ var OpCodes = map[string]byte{
"CREATE"
:
0xf0
,
"CALL"
:
0xf1
,
"RETURN"
:
0xf2
,
"POST"
:
0xf3
,
// 0x70 range - other
"LOG"
:
0xfe
,
...
...
ethvm/vm.go
View file @
3f904bf3
This diff is collapsed.
Click to expand it.
natpmp.go
View file @
3f904bf3
package
eth
import
(
//natpmp "code.google.com/p/go-nat-pmp"
"fmt"
"net"
...
...
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