@@ -10,7 +10,10 @@ use protos::{
10
10
use sha2:: { Digest , Sha256 } ;
11
11
use token_factory_api:: TokenFactoryMsg ;
12
12
use ucs01_relay_api:: {
13
- middleware:: { InFlightPfmPacket , Memo , MiddlewareError , PacketForward , PacketForwardError } ,
13
+ middleware:: {
14
+ InFlightPfmPacket , Memo , MiddlewareError , PacketForward , PacketForwardError ,
15
+ PFM_ERROR_EVENT ,
16
+ } ,
14
17
protocol:: { TransferProtocol , ATTR_ERROR , ATTR_SUCCESS , IBC_SEND_ID } ,
15
18
types:: {
16
19
make_foreign_denom, DenomOrigin , EncodingError , GenericAck , Ics20Ack , Ics20Packet ,
@@ -554,7 +557,7 @@ impl<'a> TransferProtocol for Ics20Protocol<'a> {
554
557
return IbcReceiveResponse :: new (
555
558
Binary :: try_from ( Self :: ack_failure ( e. to_string ( ) ) ) . expect ( "impossible" ) ,
556
559
)
557
- . add_event ( Event :: new ( "forward_err" ) . add_attribute ( "error" , e. to_string ( ) ) )
560
+ . add_event ( Event :: new ( PFM_ERROR_EVENT ) . add_attribute ( "error" , e. to_string ( ) ) )
558
561
}
559
562
} ;
560
563
@@ -581,7 +584,8 @@ impl<'a> TransferProtocol for Ics20Protocol<'a> {
581
584
582
585
// TODO: persist full memo
583
586
let memo = match forward. next {
584
- Some ( next) => serde_json_wasm:: to_string ( & Memo :: Forward { forward : * next } ) . unwrap ( ) ,
587
+ Some ( next) => serde_json_wasm:: to_string ( & Memo :: Forward { forward : * next } )
588
+ . expect ( "can convert pfm memo to json string" ) ,
585
589
None => "" . to_owned ( ) ,
586
590
} ;
587
591
@@ -920,7 +924,7 @@ impl<'a> TransferProtocol for Ucs01Protocol<'a> {
920
924
return IbcReceiveResponse :: new (
921
925
Binary :: try_from ( Self :: ack_failure ( e. to_string ( ) ) ) . expect ( "impossible" ) ,
922
926
)
923
- . add_event ( Event :: new ( "forward_err" ) . add_attribute ( "error" , e. to_string ( ) ) )
927
+ . add_event ( Event :: new ( PFM_ERROR_EVENT ) . add_attribute ( "error" , e. to_string ( ) ) )
924
928
}
925
929
} ;
926
930
@@ -947,7 +951,8 @@ impl<'a> TransferProtocol for Ucs01Protocol<'a> {
947
951
948
952
// TODO: persist full memo
949
953
let memo = match forward. next {
950
- Some ( next) => serde_json_wasm:: to_string ( & Memo :: Forward { forward : * next } ) . unwrap ( ) ,
954
+ Some ( next) => serde_json_wasm:: to_string ( & Memo :: Forward { forward : * next } )
955
+ . expect ( "can convert pfm memo to json string" ) ,
951
956
None => "" . to_owned ( ) ,
952
957
} ;
953
958
0 commit comments