[][src]Function xpx_supercontracts_sdk::storage::save_result

pub fn save_result(file_name: &String, data: &[u8]) -> FunctionResult

Save results of Supercotract execution to Storage. Return result status. When Supercontract execution finished will be aggregated transaction with all saved results from current Supercontract execution. File always located inside /root/supercontracts/ directory. So it should be relative path like: path/to/my/file.json


use xpx_supercontracts_sdk::storage::save_result;
let data = "some_data".as_bytes();
let result_status = save_result(&"some_file.json".to_string(), data);
assert_eq!(result_status.unwrap(), 0);