rust-bitcoin-unsafe-fast/src/util/psbt/mod.rs

35 lines
853 B
Rust
Raw Normal View History

//! # Partially Signed Transactions
//!
//! Implementation of BIP174 Partially Signed Bitcoin Transaction Format as
//! defined at https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki
//! except we define PSBTs containing non-standard SigHash types as invalid.
mod error;
pub use self::error::Error;
pub mod raw;
2018-09-09 03:50:45 +00:00
mod map;
pub use self::map::Map;
#[cfg(test)]
mod tests {
use consensus::encode::{deserialize, serialize};
use util::psbt::raw;
#[test]
fn serialize_then_deserialize_psbtkvpair() {
let expected = raw::Pair {
key: raw::Key {
type_value: 0u8,
key: vec![42u8, 69u8],
},
value: vec![69u8, 42u8, 4u8],
};
let actual: raw::Pair = deserialize(&serialize(&expected)).unwrap();
assert_eq!(expected, actual);
}
}