File tree 1 file changed +22
-2
lines changed
1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -1481,16 +1481,36 @@ export class SecretNetworkClient {
1481
1481
1482
1482
// IBC ACKs:
1483
1483
if ( txResp . code === TxResultCode . Success ) {
1484
- const packetSequences =
1484
+ let packetSequences =
1485
1485
arrayLog ?. filter (
1486
1486
( x ) => x . type === "send_packet" && x . key === "packet_sequence" ,
1487
1487
) || [ ] ;
1488
1488
1489
- const packetSrcChannels =
1489
+ let packetSrcChannels =
1490
1490
arrayLog ?. filter (
1491
1491
( x ) => x . type === "send_packet" && x . key === "packet_src_channel" ,
1492
1492
) || [ ] ;
1493
1493
1494
+ // if using secret.js we execute ibc request from another chain on cosmos-sdk < 0.50,
1495
+ // try to extract ibc packets info from rawLog
1496
+ if ( packetSequences . length == 0 && packetSrcChannels . length == 0 ) {
1497
+ try {
1498
+ const jsonRawLog = JSON . parse ( rawLog ) ;
1499
+ for ( const l of jsonRawLog ) {
1500
+ for ( const e of l . events ) {
1501
+ for ( const a of e . attributes ) {
1502
+ if ( `${ e . type } .${ a . key } ` == "send_packet.packet_sequence" ) {
1503
+ packetSequences . push ( a ) ;
1504
+ }
1505
+ if ( `${ e . type } .${ a . key } ` == "send_packet.packet_src_channel" ) {
1506
+ packetSrcChannels . push ( a ) ;
1507
+ }
1508
+ }
1509
+ }
1510
+ }
1511
+ } catch ( e ) { }
1512
+ }
1513
+
1494
1514
if ( explicitIbcTxOptions . resolveResponses ) {
1495
1515
for ( let msgIndex = 0 ; msgIndex < packetSequences ?. length ; msgIndex ++ ) {
1496
1516
// isDoneObject is used to cancel the second promise if the first one is resolved
You can’t perform that action at this time.
0 commit comments