-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add packet clearing and no packet clearing tests * Update tracing subscriber initialisation to avoid crashing in tests * Remove unnecessary generic Setup in init_preset_bootstraps * Migrate packet timeout test * Add packet filtering test * Add test for acknowledgment relaying and fix acknowledgment relaying for cosmos chains * Cleanup comments * Remove tools crate and anything related to legacy tests
- Loading branch information
Showing
143 changed files
with
638 additions
and
15,019 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 16 additions & 4 deletions
20
crates/cosmos/cosmos-chain-components/src/types/messages/packet/packet_filter.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,23 @@ | ||
use std::collections::HashMap; | ||
|
||
use ibc::core::host::types::identifiers::{ChannelId, PortId}; | ||
|
||
#[derive(Clone, Default)] | ||
pub struct PacketFilterConfig; | ||
pub struct PacketFilterConfig { | ||
pub filter_map: HashMap<(ChannelId, PortId), bool>, | ||
} | ||
|
||
impl PacketFilterConfig { | ||
pub fn new(filter_map: HashMap<(ChannelId, PortId), bool>) -> Self { | ||
Self { filter_map } | ||
} | ||
} | ||
|
||
impl PacketFilterConfig { | ||
/// TODO: Use proper packet filtering | ||
pub fn is_allowed(&self, _port_id: &PortId, _channel_id: &ChannelId) -> bool { | ||
true | ||
pub fn is_allowed(&self, port_id: &PortId, channel_id: &ChannelId) -> bool { | ||
*self | ||
.filter_map | ||
.get(&(channel_id.clone(), port_id.clone())) | ||
.unwrap_or(&true) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.