aboutsummaryrefslogtreecommitdiffstats
path: root/ethpub
diff options
context:
space:
mode:
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