I don’t get how to adapt the deprecated ic_cdk::api::call::ManualReply
of the ic_cdk v0.18 and I cannot find any description in the migration guide.
Has anyone an example to share?
For example, I would like to adapt:
#[update(guard = "caller_is_admin_controller", manual_reply = true)]
fn reject_proposal(proposal: RejectProposal) -> ManualReply<()> {
match make_reject_proposal(&proposal) {
Ok(_) => ManualReply::one(()),
Err(e) => ManualReply::reject(e.to_string()),
}
}
And the deprecation notice says Please use std::marker::PhantomData with manual_reply instead
, so I tried following:
#[update(guard = "caller_is_admin_controller", manual_reply = true)]
fn reject_proposal(proposal: RejectProposal) -> PhantomData<()> {
match make_reject_proposal(&proposal) {
Ok(_) => msg_reply(()),
Err(e) => msg_reject(e.to_string()),
}
PhantomData
}
but then I get the trait AsRef<[u8]> is not implemented for ()