added two methods to transaction struct
This commit is contained in:
parent
421d2d1174
commit
1468145110
@ -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 | {
|
||||
|
Loading…
Reference in New Issue
Block a user