Skip to content

Commit

Permalink
add check that we can only us direct_calls in send direct request
Browse files Browse the repository at this point in the history
  • Loading branch information
clangenb committed Oct 26, 2024
1 parent f311585 commit 86fed6b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cli/src/trusted_operation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,11 @@ pub(crate) fn send_direct_request(
trusted_args: &TrustedCli,
operation_call: &TrustedOperation<TrustedCallSigned, Getter>,
) -> TrustedOpResult<Hash> {
if !matches!(operation_call, TrustedOperation::direct_call(_)) {
return Err(TrustedOperationError::Default {
msg: "can only use direct_calls in this function".into(),
})
}
let encryption_key = get_shielding_key(cli).unwrap();
let shard = read_shard(trusted_args).unwrap();
let jsonrpc_call: String = get_json_request(shard, operation_call, encryption_key);
Expand Down

0 comments on commit 86fed6b

Please sign in to comment.