From 14681451107041b87424d46f29cba43044b1df6a Mon Sep 17 00:00:00 2001 From: debris Date: Wed, 9 Dec 2015 02:09:42 +0100 Subject: [PATCH] added two methods to transaction struct --- src/transaction.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/transaction.rs b/src/transaction.rs index 3b27ef03d..e8905fd3c 100644 --- a/src/transaction.rs +++ b/src/transaction.rs @@ -11,6 +11,16 @@ pub struct Transaction { data: Vec, } +impl Transaction { + pub fn is_contract_creation(&self) -> bool { + self.receive_address.is_none() + } + + pub fn is_message_call(&self) -> bool { + !self.is_contract_creation() + } +} + impl Encodable for Transaction { fn encode(&self, encoder: &mut E) where E: Encoder { encoder.emit_list(| e | {