core-lightning/cln-grpc/src/pb.rs
2022-04-02 09:46:01 +10:30

34 lines
622 B
Rust

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() }
}
}
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,
}
}
}