aboutsummaryrefslogtreecommitdiffstats
path: root/ethpub/types.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-05-05 17:56:25 +0800
committerobscuren <geffobscura@gmail.com>2014-05-05 17:56:25 +0800
commit7c91159449c528daa099aec5a3744aa8a6b5a826 (patch)
treee25dc33bdd0d833aceb99fea06c93181a0e59c57 /ethpub/types.go
parent1f6df0cd522842095c5ca723d2e11fc6b97b8b6a (diff)
downloaddexon-7c91159449c528daa099aec5a3744aa8a6b5a826.tar.gz
dexon-7c91159449c528daa099aec5a3744aa8a6b5a826.tar.zst
dexon-7c91159449c528daa099aec5a3744aa8a6b5a826.zip
Added different storage notification object
Diffstat (limited to 'ethpub/types.go')
-rw-r--r--ethpub/types.go36
1 files changed, 26 insertions, 10 deletions
diff --git a/ethpub/types.go b/ethpub/types.go
index bf06ce2f6..7ae476339 100644
--- a/ethpub/types.go
+++ b/ethpub/types.go
@@ -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()}
+}