In today’s Juno live stream, I was implementing the CMC notify_top_up
. My first attempt failed because I forgot to specify the memo in the transfer. At that point, I tried converting the ICP memo — which I knew worked — into an ICRC memo, but I couldn’t get it to work. Ultimately, I abandoned the ICRC transfer and reverted the entire solution back to an ICP transfer.
Long story short, I’m wondering: is it possible to convert an ICP memo to an ICRC memo?
I tried the following, but it failed at runtime.
use icrc_ledger_types::icrc1::transfer::{Memo as IcrcMemo};
use ic_ledger_types::{Memo};
const MEMO_CANISTER_TOP_UP: Memo = Memo(0x50555054); // == 'TPUP'
let icrc_memo = IcrcMemo::from(MEMO_CANISTER_TOP_UP.0);
// Proceed with an icrc1_transfer using icrc_memo
// Then CMC notify_top_up