Skip to content

Commit

Permalink
🐛 Fix empty ExecutionContext when parsing raw input (#820)
Browse files Browse the repository at this point in the history
  • Loading branch information
BertrandD authored Feb 24, 2025
1 parent 0454d63 commit 6e455e6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions crates/contract-sdk/src/caller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ pub struct ExecutionContext {
}

impl ExecutionContext {
pub fn new(caller: Identity, contract_name: ContractName) -> Self {
ExecutionContext {
callees_blobs: Vec::new(),
caller,
contract_name,
}
}

pub fn is_in_callee_blobs<U>(
&mut self,
contract_name: &ContractName,
Expand Down
2 changes: 1 addition & 1 deletion crates/contract-sdk/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ where
return Err(format!("Could not deserialize Blob at index {index}"));
};

let exec_ctx = ExecutionContext::default();
let exec_ctx = ExecutionContext::new(input.identity.clone(), blob.contract_name.clone());
Ok((parameters, exec_ctx))
}

Expand Down

0 comments on commit 6e455e6

Please sign in to comment.