aboutsummaryrefslogtreecommitdiffstats
path: root/ethpub
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-05-20 17:19:07 +0800
committerobscuren <geffobscura@gmail.com>2014-05-20 17:19:07 +0800
commitfd19142c0db3d2b6651989f5389944f3e211d84f (patch)
tree96916597bc7366fad5043acb6df7a2711675f504 /ethpub
parenta2fb265563a3a6eb80efc5720bb0c6f3fec6f397 (diff)
downloadgo-tangerine-fd19142c0db3d2b6651989f5389944f3e211d84f.tar
go-tangerine-fd19142c0db3d2b6651989f5389944f3e211d84f.tar.gz
go-tangerine-fd19142c0db3d2b6651989f5389944f3e211d84f.tar.bz2
go-tangerine-fd19142c0db3d2b6651989f5389944f3e211d84f.tar.lz
go-tangerine-fd19142c0db3d2b6651989f5389944f3e211d84f.tar.xz
go-tangerine-fd19142c0db3d2b6651989f5389944f3e211d84f.tar.zst
go-tangerine-fd19142c0db3d2b6651989f5389944f3e211d84f.zip
No longer store script directly in the state tree
Diffstat (limited to 'ethpub')
-rw-r--r--ethpub/pub.go3
-rw-r--r--ethpub/types.go9
2 files changed, 10 insertions, 2 deletions
diff --git a/ethpub/pub.go b/ethpub/pub.go
index 8c9a0666c..fb1018d47 100644
--- a/ethpub/pub.go
+++ b/ethpub/pub.go
@@ -45,7 +45,7 @@ func (lib *PEthereum) GetKey() *PKey {
}
func (lib *PEthereum) GetStateObject(address string) *PStateObject {
- stateObject := lib.stateManager.CurrentState().GetContract(ethutil.FromHex(address))
+ stateObject := lib.stateManager.CurrentState().GetStateObject(ethutil.FromHex(address))
if stateObject != nil {
return NewPStateObject(stateObject)
}
@@ -160,7 +160,6 @@ func (lib *PEthereum) createTx(key, recipient, valueStr, gasStr, gasPriceStr, in
}
acc := lib.stateManager.TransState().GetStateObject(keyPair.Address())
- //acc := lib.stateManager.GetAddrState(keyPair.Address())
tx.Nonce = acc.Nonce
acc.Nonce += 1
lib.stateManager.TransState().SetStateObject(acc)
diff --git a/ethpub/types.go b/ethpub/types.go
index c902afc56..75115f4e8 100644
--- a/ethpub/types.go
+++ b/ethpub/types.go
@@ -2,6 +2,7 @@ package ethpub
import (
"encoding/hex"
+ "fmt"
"github.com/ethereum/eth-go/ethchain"
"github.com/ethereum/eth-go/ethutil"
)
@@ -112,6 +113,14 @@ func (c *PStateObject) IsContract() bool {
return false
}
+func (c *PStateObject) Script() string {
+ if c.object != nil {
+ return ethutil.Hex(c.object.Script())
+ }
+
+ return ""
+}
+
type PStorageState struct {
StateAddress string
Address string