Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

phat-poller: Show the payload when reverted #1329

Merged
merged 1 commit into from
Jul 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion standalone/phat-poller/src/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use phala_types::contract;
use phala_types::contract::ContractId;
use scale::{Decode, Encode};
use sp_core::Pair as _;
use tracing::warn;
use std::convert::TryFrom as _;

#[derive(Debug, Encode, Decode)]
Expand Down Expand Up @@ -81,7 +82,7 @@ pub async fn pink_query<I: Encode, O: Decode>(
.result
.map_err(|err| anyhow::anyhow!("DispatchError({err:?})"))?;
if output.did_revert() {
return Err(anyhow!("Contract execution reverted"));
warn!("Contract execution reverted, output={:?}", output.data);
}
let r = Result::<O, LangError>::decode(&mut &output.data[..])??;
Ok(r)
Expand Down