From db494170dc819b1eb0d267b6e1ab36c6cfb63569 Mon Sep 17 00:00:00 2001 From: obscuren Date: Thu, 18 Dec 2014 15:18:13 +0100 Subject: Created generic message (easy for testing) --- cmd/mist/gui.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'cmd/mist/gui.go') diff --git a/cmd/mist/gui.go b/cmd/mist/gui.go index 773688ffc..46f264f35 100644 --- a/cmd/mist/gui.go +++ b/cmd/mist/gui.go @@ -305,13 +305,13 @@ func (gui *Gui) insertTransaction(window string, tx *types.Transaction) { var ( ptx = xeth.NewJSTx(tx, pipe.World().State()) - send = nameReg.Storage(tx.Sender()) - rec = nameReg.Storage(tx.Recipient) + send = nameReg.Storage(tx.From()) + rec = nameReg.Storage(tx.To()) s, r string ) if tx.CreatesContract() { - rec = nameReg.Storage(tx.CreationAddress(pipe.World().State())) + rec = nameReg.Storage(core.AddressFromMessage(tx)) } if send.Len() != 0 { @@ -323,9 +323,9 @@ func (gui *Gui) insertTransaction(window string, tx *types.Transaction) { r = strings.Trim(rec.Str(), "\x00") } else { if tx.CreatesContract() { - r = ethutil.Bytes2Hex(tx.CreationAddress(pipe.World().State())) + r = ethutil.Bytes2Hex(core.AddressFromMessage(tx)) } else { - r = ethutil.Bytes2Hex(tx.Recipient) + r = ethutil.Bytes2Hex(tx.To()) } } ptx.Sender = s @@ -449,11 +449,11 @@ func (gui *Gui) update() { object := state.GetAccount(gui.address()) if bytes.Compare(tx.Sender(), gui.address()) == 0 { - object.SubAmount(tx.Value) + object.SubAmount(tx.Value()) gui.txDb.Put(tx.Hash(), tx.RlpEncode()) - } else if bytes.Compare(tx.Recipient, gui.address()) == 0 { - object.AddAmount(tx.Value) + } else if bytes.Compare(tx.To(), gui.address()) == 0 { + object.AddAmount(tx.Value()) gui.txDb.Put(tx.Hash(), tx.RlpEncode()) } -- cgit v1.2.3 From 5ad473d7581b92811c3a3e035274a82fc5568f57 Mon Sep 17 00:00:00 2001 From: obscuren Date: Thu, 18 Dec 2014 15:33:22 +0100 Subject: Moved methods to messages --- cmd/mist/gui.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cmd/mist/gui.go') diff --git a/cmd/mist/gui.go b/cmd/mist/gui.go index 46f264f35..7775889cc 100644 --- a/cmd/mist/gui.go +++ b/cmd/mist/gui.go @@ -310,7 +310,7 @@ func (gui *Gui) insertTransaction(window string, tx *types.Transaction) { s, r string ) - if tx.CreatesContract() { + if core.MessageCreatesContract(tx) { rec = nameReg.Storage(core.AddressFromMessage(tx)) } @@ -322,7 +322,7 @@ func (gui *Gui) insertTransaction(window string, tx *types.Transaction) { if rec.Len() != 0 { r = strings.Trim(rec.Str(), "\x00") } else { - if tx.CreatesContract() { + if core.MessageCreatesContract(tx) { r = ethutil.Bytes2Hex(core.AddressFromMessage(tx)) } else { r = ethutil.Bytes2Hex(tx.To()) -- cgit v1.2.3