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 | {