aboutsummaryrefslogtreecommitdiffstats
path: root/ethereal/ui/library.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-04-30 20:42:57 +0800
committerobscuren <geffobscura@gmail.com>2014-04-30 20:42:57 +0800
commit183dbcc6a0e56bf46f6406d47134f3b88eb5eef1 (patch)
tree7071909a608c3fe63f8db57a59ebeacd5790009c /ethereal/ui/library.go
parente85d5dd428c71dd45060082a9af28a40a68a25e4 (diff)
downloadgo-tangerine-183dbcc6a0e56bf46f6406d47134f3b88eb5eef1.tar.gz
go-tangerine-183dbcc6a0e56bf46f6406d47134f3b88eb5eef1.tar.zst
go-tangerine-183dbcc6a0e56bf46f6406d47134f3b88eb5eef1.zip
fixed state object changes for eth api
Diffstat (limited to 'ethereal/ui/library.go')
-rw-r--r--ethereal/ui/library.go35
1 files changed, 3 insertions, 32 deletions
diff --git a/ethereal/ui/library.go b/ethereal/ui/library.go
index ec5f29f95..70462a93d 100644
--- a/ethereal/ui/library.go
+++ b/ethereal/ui/library.go
@@ -10,35 +10,6 @@ import (
"strings"
)
-type Contract struct {
- object *ethchain.StateObject
-}
-
-func NewContract(object *ethchain.StateObject) *Contract {
- return &Contract{object: object}
-}
-
-func (c *Contract) GetStorage(address string) string {
- // Because somehow, even if you return nil to QML it
- // still has some magical object so we can't rely on
- // undefined or null at the QML side
- if c.object != nil {
- val := c.object.GetMem(ethutil.Big("0x" + address))
-
- return val.BigInt().String()
- }
-
- return ""
-}
-
-func (c *Contract) Value() string {
- if c.object != nil {
- return c.object.Amount.String()
- }
-
- return ""
-}
-
type EthLib struct {
stateManager *ethchain.StateManager
blockChain *ethchain.BlockChain
@@ -76,14 +47,14 @@ func (lib *EthLib) GetKey() string {
return ethutil.Hex(ethutil.Config.Db.GetKeys()[0].Address())
}
-func (lib *EthLib) GetStateObject(address string) *Contract {
+func (lib *EthLib) GetStateObject(address string) *QStateObject {
stateObject := lib.stateManager.ProcState().GetContract(ethutil.FromHex(address))
if stateObject != nil {
- return NewContract(stateObject)
+ return NewQStateObject(stateObject)
}
// See GetStorage for explanation on "nil"
- return NewContract(nil)
+ return NewQStateObject(nil)
}
func (lib *EthLib) Watch(addr, storageAddr string) {