File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change 1- use std:: collections:: HashMap ;
2-
31use anyhow:: Context ;
42use namada_ibc:: apps:: nft_transfer:: types:: PORT_ID_STR as NFT_PORT_ID_STR ;
53use namada_ibc:: apps:: transfer:: types:: packet:: PacketData as FtPacketData ;
@@ -331,12 +329,17 @@ fn convert_account(
331329 token : Address ,
332330 is_sender : bool ,
333331) -> Result < ChainAddress , String > {
334- let memo = serde_json:: from_str :: < HashMap < String , serde_json:: Value > > (
335- packet_data. memo . as_ref ( ) ,
336- )
337- . map_err ( |e| e. to_string ( ) ) ?;
332+ let is_pfm = {
333+ use serde:: Deserialize ;
334+
335+ #[ derive( Deserialize ) ]
336+ struct PfmMemo {
337+ #[ allow( dead_code) ]
338+ forward : serde_json:: Value ,
339+ }
338340
339- let is_pfm = memo. contains_key ( "forward" ) ;
341+ serde_json:: from_str :: < PfmMemo > ( packet_data. memo . as_ref ( ) ) . is_ok ( )
342+ } ;
340343
341344 let receiver = if is_pfm {
342345 if is_sender {
You can’t perform that action at this time.
0 commit comments