Skip to content

Commit

Permalink
added support for empty return data
Browse files Browse the repository at this point in the history
  • Loading branch information
mihaicalinluca committed Sep 10, 2024
1 parent 390d18d commit 9f3c9be
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ impl Interactor {

info!("{:#?}", result);

let raw_results: Vec<Vec<u8>> = result.data.return_data.iter().map(base64_decode).collect();
let raw_results: Vec<Vec<u8>> = if let Some(data) = result.data.return_data {
data.iter().map(base64_decode).collect()
} else {
Vec::new()
};

step.save_response(TxResponse::from_raw_results(raw_results));

Expand Down
2 changes: 1 addition & 1 deletion sdk/core/src/data/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ pub struct StorageUpdateApi {
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct VMOutputApi {
pub return_data: Vec<String>,
pub return_data: Option<Vec<String>>,
pub return_code: String,
pub return_message: String,
pub gas_remaining: u64,
Expand Down

0 comments on commit 9f3c9be

Please sign in to comment.