added two methods to transaction struct

This commit is contained in:
debris 2015-12-09 02:09:42 +01:00
parent 421d2d1174
commit 1468145110
1 changed files with 10 additions and 0 deletions

View File

@ -11,6 +11,16 @@ pub struct Transaction {
data: Vec<u8>,
}
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<E>(&self, encoder: &mut E) where E: Encoder {
encoder.emit_list(| e | {