novax-executor 0.2.12

Part of the NovaX framework, this crate facilitates the execution of transactions and queries against smart contracts on the blockchain.
1
2
3
4
5
6
7
8
9
10
11
use crate::{DecodeError, TopDecodeMulti};

pub trait DecodableEvent: Sized {
    fn decode_event(topics: Vec<Vec<u8>>, data: Vec<u8>) -> Result<Self, DecodeError>;
}

impl<T: TopDecodeMulti> DecodableEvent for T {
    fn decode_event(_topics: Vec<Vec<u8>>, data: Vec<u8>) -> Result<Self, DecodeError> {
        Self::multi_decode(&mut vec![data])
    }
}