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
87a5e945
Commit
87a5e945
authored
11 years ago
by
Maran
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into feature/rpc
parents
b98cc2fb
5757f5df
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
11 deletions
+54
-11
state_manager.go
ethchain/state_manager.go
+1
-1
state_object.go
ethchain/state_object.go
+6
-0
pub.go
ethpub/pub.go
+21
-0
types.go
ethpub/types.go
+26
-10
No files found.
ethchain/state_manager.go
View file @
87a5e945
...
...
@@ -350,7 +350,7 @@ func (sm *StateManager) notifyChanges() {
for
stateObjectAddr
,
mappedObjects
:=
range
sm
.
manifest
.
storageChanges
{
for
addr
,
value
:=
range
mappedObjects
{
sm
.
Ethereum
.
Reactor
()
.
Post
(
"storage:"
+
stateObjectAddr
+
":"
+
addr
,
value
.
String
()
)
sm
.
Ethereum
.
Reactor
()
.
Post
(
"storage:"
+
stateObjectAddr
+
":"
+
addr
,
&
StorageState
{[]
byte
(
stateObjectAddr
),
[]
byte
(
addr
),
value
}
)
}
}
}
...
...
This diff is collapsed.
Click to expand it.
ethchain/state_object.go
View file @
87a5e945
...
...
@@ -186,3 +186,9 @@ type CachedStateObject struct {
Nonce
uint64
Object
*
StateObject
}
type
StorageState
struct
{
StateAddress
[]
byte
Address
[]
byte
Value
*
big
.
Int
}
This diff is collapsed.
Click to expand it.
ethpub/pub.go
View file @
87a5e945
...
...
@@ -54,6 +54,27 @@ func (lib *PEthereum) GetStateObject(address string) *PStateObject {
return
NewPStateObject
(
nil
)
}
func
(
lib
*
PEthereum
)
GetStorage
(
address
,
storageAddress
string
)
string
{
return
lib
.
GetStateObject
(
address
)
.
GetStorage
(
storageAddress
)
}
func
(
lib
*
PEthereum
)
GetTxCount
(
address
string
)
int
{
return
lib
.
GetStateObject
(
address
)
.
Nonce
()
}
func
(
lib
*
PEthereum
)
IsContract
(
address
string
)
bool
{
return
lib
.
GetStateObject
(
address
)
.
IsContract
()
}
func
(
lib
*
PEthereum
)
SecretToAddress
(
key
string
)
string
{
pair
,
err
:=
ethchain
.
NewKeyPairFromSec
(
ethutil
.
FromHex
(
key
))
if
err
!=
nil
{
return
""
}
return
ethutil
.
Hex
(
pair
.
Address
())
}
func
(
lib
*
PEthereum
)
Transact
(
key
,
recipient
,
valueStr
,
gasStr
,
gasPriceStr
,
dataStr
string
)
(
*
PReceipt
,
error
)
{
return
lib
.
createTx
(
key
,
recipient
,
valueStr
,
gasStr
,
gasPriceStr
,
dataStr
,
""
)
}
...
...
This diff is collapsed.
Click to expand it.
ethpub/types.go
View file @
87a5e945
...
...
@@ -59,16 +59,6 @@ func NewPReciept(contractCreation bool, creationAddress, hash, address []byte) *
}
}
/*
type PKeyRing struct {
Keys []interface{}
}
func NewPKeyRing(keys []interface{}) *PKeyRing {
return &PKeyRing{Keys: keys}
}
*/
type
PStateObject
struct
{
object
*
ethchain
.
StateObject
}
...
...
@@ -105,3 +95,29 @@ func (c *PStateObject) Address() string {
return
""
}
func
(
c
*
PStateObject
)
Nonce
()
int
{
if
c
.
object
!=
nil
{
return
int
(
c
.
object
.
Nonce
)
}
return
0
}
func
(
c
*
PStateObject
)
IsContract
()
bool
{
if
c
.
object
!=
nil
{
return
len
(
c
.
object
.
Script
())
>
0
}
return
false
}
type
PStorageState
struct
{
StateAddress
string
Address
string
Value
string
}
func
NewPStorageState
(
storageObject
*
ethchain
.
StorageState
)
*
PStorageState
{
return
&
PStorageState
{
ethutil
.
Hex
(
storageObject
.
StateAddress
),
ethutil
.
Hex
(
storageObject
.
Address
),
storageObject
.
Value
.
String
()}
}
This diff is collapsed.
Click to expand it.
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