crypto-com / chain-indexing

Other
35 stars 28 forks source link

Problem: duplicate attribute key on IBC MsgAcknowledgement #790

Closed vincentysc closed 2 years ago

vincentysc commented 2 years ago

Since the events in MsgAcknowledgement in type acknowledge_packet are duplicated, the code will get the last events.

Example:

 {
                "type": "send_packet",
                "attributes": [
                    {
                        "key": "packet_data",
                        "value": "{"amount":"4975060000","denom":"transfer/channel-0/basetcro","receiver":"tcro1q3aradsw9nldnnkna42dfmtakg8hxdcuvz7zhe","sender":"tcrc1k480peuqy544gcfqd0rnaxq7g002633j2rk8cj"}"
                    },
                    {
                        "key": "packet_data_hex",
                        "value": "7b22616d6f756e74223a2234393735303630303030222c2264656e6f6d223a227472616e736665722f6368616e6e656c2d302f626173657463726f222c227265636569766572223a227463726f317133617261647377396e6c646e6e6b6e61343264666d74616b67386878646375767a377a6865222c2273656e646572223a2274637263316b3438307065757179353434676366716430726e61787137673030323633336a32726b38636a227d"
                    },
                    {
                        "key": "packet_timeout_height",
                        "value": "0-0"
                    },
                    {
                        "key": "packet_timeout_timestamp",
                        "value": "1668099806572469970"
                    },
                    {
                        "key": "packet_sequence",
                        "value": "714"
                    },
                    {
                        "key": "packet_src_port",
                        "value": "transfer"
                    },
                    {
                        "key": "packet_src_channel",
                        "value": "channel-0"
                    },
                    {
                        "key": "packet_dst_port",
                        "value": "transfer"
                    },
                    {
                        "key": "packet_dst_channel",
                        "value": "channel-131"
                    },
                    {
                        "key": "packet_channel_ordering",
                        "value": "ORDER_UNORDERED"
                    },
                    {
                        "key": "packet_connection",
                        "value": "connection-0"
                    },

                   // Get the events below only 
                    {
                        "key": "packet_data",
                        "value": "{"amount":"4975060000","denom":"transfer/channel-0/basetcro","receiver":"tcro1q3aradsw9nldnnkna42dfmtakg8hxdcuvz7zhe","sender":"tcrc1k480peuqy544gcfqd0rnaxq7g002633j2rk8cj"}"
                    },
                    {
                        "key": "packet_data_hex",
                        "value": "7b22616d6f756e74223a2234393735303630303030222c2264656e6f6d223a227472616e736665722f6368616e6e656c2d302f626173657463726f222c227265636569766572223a227463726f317133617261647377396e6c646e6e6b6e61343264666d74616b67386878646375767a377a6865222c2273656e646572223a2274637263316b3438307065757179353434676366716430726e61787137673030323633336a32726b38636a227d"
                    },
                    {
                        "key": "packet_timeout_height",
                        "value": "0-0"
                    },
                    {
                        "key": "packet_timeout_timestamp",
                        "value": "1668099806572469970"
                    },
                    {
                        "key": "packet_sequence",
                        "value": "714"
                    },
                    {
                        "key": "packet_src_port",
                        "value": "transfer"
                    },
                    {
                        "key": "packet_src_channel",
                        "value": "channel-0"
                    },
                    {
                        "key": "packet_dst_port",
                        "value": "transfer"
                    },
                    {
                        "key": "packet_dst_channel",
                        "value": "channel-131"
                    },
                    {
                        "key": "packet_channel_ordering",
                        "value": "ORDER_UNORDERED"
                    },
                    {
                        "key": "packet_connection",
                        "value": "connection-0"
                    }
                ]
            }