Skip to content

Commit

Permalink
Merge pull request #585 from breez/ok300-migrate-from-gl-structs
Browse files Browse the repository at this point in the history
Migrate remaining pb:: dependencies to cln::*
  • Loading branch information
ok300 authored Nov 6, 2023
2 parents a12e372 + 3a8b63f commit e393903
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 91 deletions.
2 changes: 1 addition & 1 deletion libs/sdk-core/src/breez_services.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,7 @@ impl BreezServices {
match paid_invoice_res {
Ok(Some(i)) => {
debug!("invoice stream got new invoice");
if let Some(gl_client::pb::incoming_payment::Details::Offchain(p)) = i.details {
if let Some(gl_client::signer::model::greenlight::incoming_payment::Details::Offchain(p)) = i.details {
let payment: Option<crate::models::Payment> = p.clone().try_into().ok();
if payment.is_some() {
let res = cloned
Expand Down
12 changes: 6 additions & 6 deletions libs/sdk-core/src/greenlight/backup_transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::{
};

use super::node_api::Greenlight;
use gl_client::{node, pb};
use gl_client::{node, pb::cln};
use std::sync::Arc;

const BREEZ_SDK_DATASTORE_PATH: [&str; 2] = ["breez-sdk", "backup"];
Expand All @@ -24,8 +24,8 @@ impl BackupTransport for GLBackupTransport {
async fn pull(&self) -> SdkResult<Option<BackupState>> {
let key = self.gl_key();
let mut c: node::ClnClient = self.inner.get_node_client().await?;
let response: pb::cln::ListdatastoreResponse = c
.list_datastore(pb::cln::ListdatastoreRequest { key })
let response: cln::ListdatastoreResponse = c
.list_datastore(cln::ListdatastoreRequest { key })
.await?
.into_inner();
let store = response.datastore;
Expand All @@ -45,12 +45,12 @@ impl BackupTransport for GLBackupTransport {
let key = self.gl_key();
info!("set_value key = {:?} data length={:?}", key, hex.len());
let mut c: node::ClnClient = self.inner.get_node_client().await?;
let mut mode = pb::cln::datastore_request::DatastoreMode::MustCreate;
let mut mode = cln::datastore_request::DatastoreMode::MustCreate;
if version.is_some() {
mode = pb::cln::datastore_request::DatastoreMode::MustReplace;
mode = cln::datastore_request::DatastoreMode::MustReplace;
}
let response = c
.datastore(pb::cln::DatastoreRequest {
.datastore(cln::DatastoreRequest {
key,
string: None,
hex: Some(hex),
Expand Down
Loading

0 comments on commit e393903

Please sign in to comment.