Skip to content

Commit

Permalink
do not return an HTTP error for calls to stopping/stopped canisters (#…
Browse files Browse the repository at this point in the history
…115)

Co-authored-by: Martin Raszyk <[email protected]>
  • Loading branch information
mraszyk and mraszyk authored Nov 30, 2022
1 parent fb76b64 commit 20e23e1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 0 additions & 3 deletions src/IC/Ref.hs
Original file line number Diff line number Diff line change
Expand Up @@ -539,9 +539,6 @@ inspectIngress (CallRequest canister_id user_id method arg)
| otherwise = do
onReject (throwError . T.pack . rejectMessage) $
canisterMustExist canister_id
getRunStatus canister_id >>= \case
IsRunning -> return ()
_ -> throwError "canister is stopped"
empty <- isCanisterEmpty canister_id
when empty $ throwError "canister is empty"
wasm_state <- getCanisterState canister_id
Expand Down
6 changes: 3 additions & 3 deletions src/IC/Test/Spec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ icTests subnet = withAgentConfig $ testGroup "Interface Spec acceptance tests"
ic_stop_canister ic00 cid

step "Cannot call (update)?"
call'' cid reply >>= isErrOrReject [5]
call' cid reply >>= isReject [5]

step "Cannot call (query)?"
query' cid reply >>= isReject [5]
Expand Down Expand Up @@ -710,7 +710,7 @@ icTests subnet = withAgentConfig $ testGroup "Interface Spec acceptance tests"
awaitKnown grs3 >>= isPendingOrProcessing

step "Cannot call (update)?"
call'' cid reply >>= isErrOrReject [5]
call' cid reply >>= isReject [5]

step "Cannot call (query)?"
query' cid reply >>= isReject [5]
Expand All @@ -729,7 +729,7 @@ icTests subnet = withAgentConfig $ testGroup "Interface Spec acceptance tests"


step "Cannot call (update)?"
call'' cid reply >>= isErrOrReject [5]
call' cid reply >>= isReject [5]

step "Cannot call (query)?"
query' cid reply >>= isReject [5]
Expand Down

0 comments on commit 20e23e1

Please sign in to comment.