core-lightning/cln-grpc/src/pb.rs

34 lines
622 B
Rust
Raw Normal View History

tonic::include_proto!("cln");
use cln_rpc::primitives::{Amount as JAmount, Utxo as JUtxo};
impl From<JAmount> for Amount {
fn from(a: JAmount) -> Self {
Amount { msat: a.msat() }
}
}
2022-04-01 06:12:45 +02:00
impl From<&Amount> for JAmount {
fn from(a: &Amount) -> Self {
JAmount::from_msat(a.msat)
}
}
impl From<JUtxo> for Utxo {
fn from(a: JUtxo) -> Self {
Utxo {
txid: a.txid,
outnum: a.outnum,
}
}
}
impl From<&Utxo> for JUtxo {
fn from(a: &Utxo) -> Self {
JUtxo {
txid: a.txid.clone(),
outnum: a.outnum,
}
}
}