pub fn input() -> Vec<u8> {
    let len = unsafe { env::ontio_input_length() };

    if len == 0 {
        Vec::new()
    } else {
        let mut data = vec![0; len as usize];
        unsafe {
            env::ontio_get_input(data.as_mut_ptr());
        }
        data
    }
}
/// Get input data from transaction or caller contract
/// # Example
///
/// ```no_run
/// # use ontio_std::runtime;
/// # use ontio_std::abi::Source;
/// let input = runtime::input();
/// let mut source = Source::new(&input);
/// let addr = source.read().unwrap();
/// let res = runtime::check_witness(addr);
/// ```
///
Get input data from transaction or caller contract
Get input data from transaction or caller contract
pub fn input() -> Vec<u8> {
    let len = unsafe { env::ontio_input_length() };
    if len == 0 {
        Vec::new()
    } else {
        let mut data = vec![0; len as usize];
        unsafe {
            env::ontio_get_input(data.as_mut_ptr());
        }
        data
    }
}
pub fn input ( ) -> Vec < u8 > { let len = unsafe { env :: ontio_input_length ( ) } ; if len == 0 { Vec :: new ( ) } else { let mut data = vec ! [ 0 len as usize ] ; unsafe { env :: ontio_get_input ( data . as_mut_ptr ( ) ) ; } data } }
Get input data from transaction or caller contract
Get input data from transaction or caller contract
example
None
use ontio_std::runtime;
None
use ontio_std::abi::source;
let input = runtime::input();
let mut source = Source::new(&input);
let addr = source.read().unwrap();
let res = runtime::check_witness(addr);
```
let input = runtime :: input () ; let mut source = Source :: new ( &input ) ; let addr = source . read () . unwrap () ; let res = runtime :: check_witness ( addr ) ; ` ` `