[][src]Function ontio_std::runtime::ret

pub fn ret(data: &[u8]) -> !

return the result of execution and exit contract execution

Example

  let input = runtime::input();
  let mut source = Source::new(&input);
  let addr = source.read().unwrap();
  let res = runtime::check_witness(addr);
  let mut sink = Sink::new(16);
  sink.write(res);
  runtime::ret(sink.bytes());