From 8730dfdcc2e2b40410a57385e4864d15f2f0336b Mon Sep 17 00:00:00 2001 From: obscuren Date: Sat, 17 May 2014 14:07:52 +0200 Subject: Changed how changes are being applied to states --- ethpub/pub.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ethpub') diff --git a/ethpub/pub.go b/ethpub/pub.go index daacb9d78..2513f83ed 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().GetContract(ethutil.FromHex(address)) if stateObject != nil { return NewPStateObject(stateObject) } -- cgit v1.2.3 From b8034f4d9ed7eea29a219a2d894ae22041a906a7 Mon Sep 17 00:00:00 2001 From: obscuren Date: Mon, 19 May 2014 12:14:04 +0200 Subject: Increment nonce in the public api --- ethpub/pub.go | 1 + 1 file changed, 1 insertion(+) (limited to 'ethpub') diff --git a/ethpub/pub.go b/ethpub/pub.go index 2513f83ed..8c9a0666c 100644 --- a/ethpub/pub.go +++ b/ethpub/pub.go @@ -162,6 +162,7 @@ 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) -- cgit v1.2.3 From fd19142c0db3d2b6651989f5389944f3e211d84f Mon Sep 17 00:00:00 2001 From: obscuren Date: Tue, 20 May 2014 11:19:07 +0200 Subject: No longer store script directly in the state tree --- ethpub/pub.go | 3 +-- ethpub/types.go | 9 +++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'ethpub') 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 -- cgit v1.2.3 From fafdd21e4fb18c9714c4f784d443e9592ec3ff69 Mon Sep 17 00:00:00 2001 From: obscuren Date: Tue, 20 May 2014 12:23:49 +0200 Subject: unused --- ethpub/types.go | 1 - 1 file changed, 1 deletion(-) (limited to 'ethpub') diff --git a/ethpub/types.go b/ethpub/types.go index 75115f4e8..5d3bfcaaa 100644 --- a/ethpub/types.go +++ b/ethpub/types.go @@ -2,7 +2,6 @@ package ethpub import ( "encoding/hex" - "fmt" "github.com/ethereum/eth-go/ethchain" "github.com/ethereum/eth-go/ethutil" ) -- cgit v1.2.3