Skip to content

Commit

Permalink
validate nounslabs on the sender side as well
Browse files Browse the repository at this point in the history
  • Loading branch information
drbeefsupreme committed Nov 13, 2024
1 parent 2fe8ad1 commit 211df25
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crown/src/nockapp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,9 @@ pub struct NockAppHandle {

impl NockAppHandle {
pub async fn poke(&self, poke: NounSlab) -> Result<PokeResult, NockAppError> {
if let Err(e) = poke.validate_root() {
panic!("Invalid poke noun: {}", e);
}
let (ack_channel, ack_future) = oneshot::channel();
self.io_sender
.send(IOAction::Poke { poke, ack_channel })
Expand All @@ -280,6 +283,9 @@ impl NockAppHandle {
}

pub async fn peek(&self, path: NounSlab) -> Result<Option<NounSlab>, NockAppError> {
if let Err(e) = path.validate_root() {
panic!("Invalid peek path: {}", e);
}
let (result_channel, result_future) = oneshot::channel();
self.io_sender
.send(IOAction::Peek {
Expand Down

0 comments on commit 211df25

Please sign in to comment.