MCPcopy Create free account
hub / github.com/ElementsProject/lightning / try_from

Method try_from

cln-grpc/src/pb.rs:40–47  ·  view source on GitHub ↗
(a: Outpoint)

Source from the content-addressed store, hash-verified

38 impl TryFrom<Outpoint> for JOutpoint {
39 type Error = tonic::Status;
40 fn try_from(a: Outpoint) -> Result<Self, Self::Error> {
41 Ok(JOutpoint {
42 txid: bitcoin::hashes::sha256::Hash::from_slice(&a.txid).map_err(|e| {
43 tonic::Status::invalid_argument(format!("Invalid outpoint txid: {e}"))
44 })?,
45 outnum: a.outnum,
46 })
47 }
48 }
49
50 impl TryFrom<Feerate> for cln_rpc::primitives::Feerate {

Callers

nothing calls this directly

Calls 4

from_sliceFunction · 0.85
invalid_argumentFunction · 0.85
AmountClass · 0.85
mapMethod · 0.80

Tested by

no test coverage detected