bolt-cw-sdk 1.0.0

SDK for the BOLT protocol, providing utilities for interacting with the BOLT contracts.
Documentation
use tonic::codegen::tokio_stream::StreamExt;
use tonic::Status;

pub mod account;
pub mod helpers;
pub mod oracle_contract;
pub mod router_contract;
pub mod settlement_contract;
pub mod test_scenario;

pub async fn subscription_testing_get_n<Response>(
    stream: &mut tonic::codegen::tokio_stream::wrappers::ReceiverStream<Result<Response, Status>>,
    n: usize,
) -> Vec<Response> {
    let mut res = Vec::with_capacity(n);

    while res.len() != n {
        res.push(
            stream
                .next()
                .await
                .expect("Failed to get next")
                .expect("Failed to get response"),
        );
    }

    res
}