Function
serialize_txout
(txout: &TxOut, writer: &mut W)
Source from the content-addressed store, hash-verified
| 122 | } |
| 123 | |
| 124 | fn serialize_txout<W: borsh::io::Write>(txout: &TxOut, writer: &mut W) -> borsh::io::Result<()> { |
| 125 | BorshSerialize::serialize(&txout.value.to_sat(), writer)?; |
| 126 | BorshSerialize::serialize(&txout.script_pubkey.as_bytes(), writer) |
| 127 | } |
| 128 | |
| 129 | fn deserialize_txout<R: borsh::io::Read>(reader: &mut R) -> borsh::io::Result<TxOut> { |
| 130 | let value = Amount::from_sat(u64::deserialize_reader(reader)?); |
Tested by
no test coverage detected