MCPcopy Create free account
hub / github.com/BitVM/BitVM / deserialize_reader

Method deserialize_reader

final-spv/src/transaction.rs:76–98  ·  view source on GitHub ↗
(reader: &mut R)

Source from the content-addressed store, hash-verified

74impl BorshDeserialize for CircuitTransaction {
75 #[inline]
76 fn deserialize_reader<R: borsh::io::Read>(reader: &mut R) -> borsh::io::Result<Self> {
77 let version = Version(i32::deserialize_reader(reader)?);
78 let lock_time = LockTime::from_consensus(u32::deserialize_reader(reader)?);
79 let input_len = usize::deserialize_reader(reader)?;
80 let mut input = Vec::with_capacity(input_len);
81 for _ in 0..input_len {
82 input.push(deserialize_txin(reader)?);
83 }
84 let output_len = usize::deserialize_reader(reader)?;
85 let mut output = Vec::with_capacity(output_len);
86 for _ in 0..output_len {
87 output.push(deserialize_txout(reader)?);
88 }
89
90 let tx = Transaction {
91 version,
92 lock_time,
93 input,
94 output,
95 };
96
97 Ok(Self(tx))
98 }
99}
100
101fn serialize_txin<W: borsh::io::Write>(txin: &TxIn, writer: &mut W) -> borsh::io::Result<()> {

Callers

nothing calls this directly

Calls 3

deserialize_txinFunction · 0.85
deserialize_txoutFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected