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

Function test_borsh_serialization

final-spv/src/transaction.rs:224–241  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

222
223 #[test]
224 fn test_borsh_serialization() {
225 let original_tx = Transaction {
226 version: Version(1),
227 lock_time: LockTime::from_consensus(0),
228 input: vec![],
229 output: vec![],
230 };
231 let bridge_tx = CircuitTransaction(original_tx);
232
233 // Serialize
234 let serialized = borsh::to_vec(&bridge_tx).unwrap();
235
236 // Deserialize
237 let deserialized: CircuitTransaction = borsh::from_slice(&serialized).unwrap();
238
239 assert_eq!(bridge_tx, deserialized);
240 assert_eq!(bridge_tx.txid(), deserialized.txid());
241 }
242
243 #[test]
244 fn test_deref_traits() {

Callers

nothing calls this directly

Calls 1

CircuitTransactionClass · 0.85

Tested by

no test coverage detected