messy implementation used for lykin testing
This commit is contained in:
parent
0aa616d92b
commit
b0b2532976
|
@ -7,7 +7,12 @@
|
|||
use async_std::stream::Stream;
|
||||
use kuska_ssb::api::dto::CreateHistoryStreamIn;
|
||||
|
||||
use crate::{error::GolgiError, messages::SsbMessageValue, sbot::Sbot, utils};
|
||||
use crate::{
|
||||
error::GolgiError,
|
||||
messages::{SsbMessageKVT, SsbMessageValue},
|
||||
sbot::Sbot,
|
||||
utils,
|
||||
};
|
||||
|
||||
impl Sbot {
|
||||
/// Call the `createHistoryStream` RPC method.
|
||||
|
@ -38,9 +43,11 @@ impl Sbot {
|
|||
pub async fn create_history_stream(
|
||||
&mut self,
|
||||
id: String,
|
||||
) -> Result<impl Stream<Item = Result<SsbMessageValue, GolgiError>>, GolgiError> {
|
||||
//) -> Result<impl Stream<Item = Result<SsbMessageValue, GolgiError>>, GolgiError> {
|
||||
) -> Result<impl Stream<Item = Result<SsbMessageKVT, GolgiError>>, GolgiError> {
|
||||
let mut sbot_connection = self.get_sbot_connection().await?;
|
||||
let args = CreateHistoryStreamIn::new(id);
|
||||
let args = CreateHistoryStreamIn::new(id).keys_values(true, true);
|
||||
//.limit(10);
|
||||
let req_id = sbot_connection
|
||||
.client
|
||||
.create_history_stream_req_send(&args)
|
||||
|
@ -48,7 +55,8 @@ impl Sbot {
|
|||
let history_stream = utils::get_source_stream(
|
||||
sbot_connection.rpc_reader,
|
||||
req_id,
|
||||
utils::ssb_message_res_parse,
|
||||
//utils::ssb_message_res_parse,
|
||||
utils::kvt_res_parse,
|
||||
)
|
||||
.await;
|
||||
Ok(history_stream)
|
||||
|
|
Loading…
Reference in New Issue