aboutsummaryrefslogtreecommitdiffstats
path: root/ethpub
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-05-20 23:09:44 +0800
committerobscuren <geffobscura@gmail.com>2014-05-20 23:09:44 +0800
commit4b13f93a3e0f2901a8e1aa38dfef115e24c63ef0 (patch)
treed4622ae52bcc4c158aa26cf171a306979307bfc9 /ethpub
parent6efdd21633c1d21f36080754a89ad82c0c244128 (diff)
parentc37b3cef7dc465832761b1da6761eeaa47e368d1 (diff)
downloaddexon-4b13f93a3e0f2901a8e1aa38dfef115e24c63ef0.tar
dexon-4b13f93a3e0f2901a8e1aa38dfef115e24c63ef0.tar.gz
dexon-4b13f93a3e0f2901a8e1aa38dfef115e24c63ef0.tar.bz2
dexon-4b13f93a3e0f2901a8e1aa38dfef115e24c63ef0.tar.lz
dexon-4b13f93a3e0f2901a8e1aa38dfef115e24c63ef0.tar.xz
dexon-4b13f93a3e0f2901a8e1aa38dfef115e24c63ef0.tar.zst
dexon-4b13f93a3e0f2901a8e1aa38dfef115e24c63ef0.zip
Merge branch 'release/poc5-rc7'
Diffstat (limited to 'ethpub')
-rw-r--r--ethpub/pub.go4
-rw-r--r--ethpub/types.go8
2 files changed, 10 insertions, 2 deletions
diff --git a/ethpub/pub.go b/ethpub/pub.go
index daacb9d78..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.ProcState().GetContract(ethutil.FromHex(address))
+ stateObject := lib.stateManager.CurrentState().GetStateObject(ethutil.FromHex(address))
if stateObject != nil {
return NewPStateObject(stateObject)
}
@@ -160,8 +160,8 @@ 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)
tx.Sign(keyPair.PrivateKey)
diff --git a/ethpub/types.go b/ethpub/types.go
index c902afc56..5d3bfcaaa 100644
--- a/ethpub/types.go
+++ b/ethpub/types.go
@@ -112,6 +112,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