cargo_tangle/
lib.rs

1pub mod command;
2pub mod foundry;
3pub mod utils;
4
5#[cfg(test)]
6mod tests;
7
8pub use blueprint_chain_setup::anvil;
9use blueprint_tangle_extra::util::TxProgressExt;
10use tangle_subxt::subxt::{Config, blocks::ExtrinsicEvents, client::OnlineClientT, tx::TxProgress};
11use tangle_subxt::tangle_testnet_runtime::api::runtime_types::tangle_primitives::services::field::BoundedString;
12
13pub(crate) async fn wait_for_in_block_success<T: Config>(
14    res: TxProgress<T, impl OnlineClientT<T>>,
15) -> ExtrinsicEvents<T> {
16    res.wait_for_in_block()
17        .await
18        .unwrap()
19        .fetch_events()
20        .await
21        .unwrap()
22}
23
24/// Helper function to decode a `BoundedString` to a regular String
25pub(crate) fn decode_bounded_string(bounded_string: &BoundedString) -> String {
26    String::from_utf8_lossy(&bounded_string.0.0).to_string()
27}