Skip to content

Commit

Permalink
fix dedup issue for cosmos attributes (#5112)
Browse files Browse the repository at this point in the history
* fix dedup issue for cosmos attributes

* cargo fmt
  • Loading branch information
betterclever authored Jan 6, 2024
1 parent 20298b0 commit 3b59959
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion chain/cosmos/src/trigger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,15 @@ impl PartialEq for CosmosTrigger {
},
) => {
if let (Ok(a_event), Ok(b_event)) = (a_event_data.event(), b_event_data.event()) {
a_event.event_type == b_event.event_type && a_origin == b_origin
let mut attributes_a = a_event.attributes.clone();
attributes_a.sort_by(|a, b| a.key.cmp(&b.key));

let mut attributes_b = b_event.attributes.clone();
attributes_b.sort_by(|a, b| a.key.cmp(&b.key));

a_event.event_type == b_event.event_type
&& a_origin == b_origin
&& attributes_a == attributes_b
} else {
false
}
Expand Down

0 comments on commit 3b59959

Please sign in to comment.