aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-03-18 20:00:01 +0800
committerobscuren <geffobscura@gmail.com>2015-03-18 20:00:01 +0800
commit0a1eeca41e6ba5920ba65d9b41654768299bc7e3 (patch)
tree0c286872355608c317f9e0ec1897bb79386ae94f /core
parent942980609fb8a36873689bd3bd0a15488f327d56 (diff)
downloaddexon-0a1eeca41e6ba5920ba65d9b41654768299bc7e3.tar
dexon-0a1eeca41e6ba5920ba65d9b41654768299bc7e3.tar.gz
dexon-0a1eeca41e6ba5920ba65d9b41654768299bc7e3.tar.bz2
dexon-0a1eeca41e6ba5920ba65d9b41654768299bc7e3.tar.lz
dexon-0a1eeca41e6ba5920ba65d9b41654768299bc7e3.tar.xz
dexon-0a1eeca41e6ba5920ba65d9b41654768299bc7e3.tar.zst
dexon-0a1eeca41e6ba5920ba65d9b41654768299bc7e3.zip
conversions. -compilable-
Diffstat (limited to 'core')
-rw-r--r--core/state_transition.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/state_transition.go b/core/state_transition.go
index 1509a5258..d0b2c5d7c 100644
--- a/core/state_transition.go
+++ b/core/state_transition.go
@@ -57,6 +57,12 @@ type Message interface {
Data() []byte
}
+func AddressFromMessage(msg Message) common.Address {
+ from, _ := msg.From()
+
+ return crypto.CreateAddress(from, msg.Nonce())
+}
+
func MessageCreatesContract(msg Message) bool {
return msg.To() == nil
}