Skip to content

Commit

Permalink
Merge rust-bitcoin#3167: Reduce vec macro usage
Browse files Browse the repository at this point in the history
2756b7f Removed unneeded usages of vec! macro (leichak)

Pull request description:

  Pull request for rust-bitcoin#3132.

ACKs for top commit:
  Kixunil:
    ACK 2756b7f
  apoelstra:
    ACK 2756b7f successfully ran local tests

Tree-SHA512: ae2f9570e59b03802ecaa314ee2136ff68fe9815253401bf1b67da425816010238193ffabf1ed6c32f4b7a290b8e6ccf91616d36c80388bf0047a0b59abba349
  • Loading branch information
apoelstra committed Aug 19, 2024
2 parents 47b5510 + 2756b7f commit d0b6a4c
Show file tree
Hide file tree
Showing 21 changed files with 146 additions and 161 deletions.
4 changes: 2 additions & 2 deletions bitcoin/src/bip152.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,11 +449,11 @@ mod test {

let compact = HeaderAndShortIds::from_block(&block, 42, 2, &[0, 1, 2]).unwrap();
let idxs = compact.prefilled_txs.iter().map(|t| t.idx).collect::<Vec<_>>();
assert_eq!(idxs, vec![0, 0, 0]);
assert_eq!(idxs, [0, 0, 0]);

let compact = HeaderAndShortIds::from_block(&block, 42, 2, &[2]).unwrap();
let idxs = compact.prefilled_txs.iter().map(|t| t.idx).collect::<Vec<_>>();
assert_eq!(idxs, vec![0, 1]);
assert_eq!(idxs, [0, 1]);
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion bitcoin/src/bip158.rs
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ impl<'a, R: BufRead + ?Sized> BitStreamReader<'a, R> {
///
/// ```
/// # use bitcoin::bip158::BitStreamReader;
/// # let data = vec![0xff];
/// # let data = [0xff];
/// # let mut input = data.as_slice();
/// let mut reader = BitStreamReader::new(&mut input); // input contains all 1's
/// let res = reader.read(1).expect("read failed");
Expand Down
4 changes: 2 additions & 2 deletions bitcoin/src/blockdata/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1795,7 +1795,7 @@ mod tests {

#[test]
fn sighashtype_fromstr_display() {
let sighashtypes = vec![
let sighashtypes = [
("SIGHASH_ALL", EcdsaSighashType::All),
("SIGHASH_NONE", EcdsaSighashType::None),
("SIGHASH_SINGLE", EcdsaSighashType::Single),
Expand All @@ -1807,7 +1807,7 @@ mod tests {
assert_eq!(sht.to_string(), s);
assert_eq!(EcdsaSighashType::from_str(s).unwrap(), sht);
}
let sht_mistakes = vec![
let sht_mistakes = [
"SIGHASH_ALL | SIGHASH_ANYONECANPAY",
"SIGHASH_NONE |SIGHASH_ANYONECANPAY",
"SIGHASH_SINGLE| SIGHASH_ANYONECANPAY",
Expand Down
97 changes: 47 additions & 50 deletions bitcoin/src/consensus/encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -906,65 +906,62 @@ mod tests {
#[test]
fn serialize_int_test() {
// bool
assert_eq!(serialize(&false), vec![0u8]);
assert_eq!(serialize(&true), vec![1u8]);
assert_eq!(serialize(&false), [0u8]);
assert_eq!(serialize(&true), [1u8]);
// u8
assert_eq!(serialize(&1u8), vec![1u8]);
assert_eq!(serialize(&0u8), vec![0u8]);
assert_eq!(serialize(&255u8), vec![255u8]);
assert_eq!(serialize(&1u8), [1u8]);
assert_eq!(serialize(&0u8), [0u8]);
assert_eq!(serialize(&255u8), [255u8]);
// u16
assert_eq!(serialize(&1u16), vec![1u8, 0]);
assert_eq!(serialize(&256u16), vec![0u8, 1]);
assert_eq!(serialize(&5000u16), vec![136u8, 19]);
assert_eq!(serialize(&1u16), [1u8, 0]);
assert_eq!(serialize(&256u16), [0u8, 1]);
assert_eq!(serialize(&5000u16), [136u8, 19]);
// u32
assert_eq!(serialize(&1u32), vec![1u8, 0, 0, 0]);
assert_eq!(serialize(&256u32), vec![0u8, 1, 0, 0]);
assert_eq!(serialize(&5000u32), vec![136u8, 19, 0, 0]);
assert_eq!(serialize(&500000u32), vec![32u8, 161, 7, 0]);
assert_eq!(serialize(&168430090u32), vec![10u8, 10, 10, 10]);
assert_eq!(serialize(&1u32), [1u8, 0, 0, 0]);
assert_eq!(serialize(&256u32), [0u8, 1, 0, 0]);
assert_eq!(serialize(&5000u32), [136u8, 19, 0, 0]);
assert_eq!(serialize(&500000u32), [32u8, 161, 7, 0]);
assert_eq!(serialize(&168430090u32), [10u8, 10, 10, 10]);
// i32
assert_eq!(serialize(&-1i32), vec![255u8, 255, 255, 255]);
assert_eq!(serialize(&-256i32), vec![0u8, 255, 255, 255]);
assert_eq!(serialize(&-5000i32), vec![120u8, 236, 255, 255]);
assert_eq!(serialize(&-500000i32), vec![224u8, 94, 248, 255]);
assert_eq!(serialize(&-168430090i32), vec![246u8, 245, 245, 245]);
assert_eq!(serialize(&1i32), vec![1u8, 0, 0, 0]);
assert_eq!(serialize(&256i32), vec![0u8, 1, 0, 0]);
assert_eq!(serialize(&5000i32), vec![136u8, 19, 0, 0]);
assert_eq!(serialize(&500000i32), vec![32u8, 161, 7, 0]);
assert_eq!(serialize(&168430090i32), vec![10u8, 10, 10, 10]);
assert_eq!(serialize(&-1i32), [255u8, 255, 255, 255]);
assert_eq!(serialize(&-256i32), [0u8, 255, 255, 255]);
assert_eq!(serialize(&-5000i32), [120u8, 236, 255, 255]);
assert_eq!(serialize(&-500000i32), [224u8, 94, 248, 255]);
assert_eq!(serialize(&-168430090i32), [246u8, 245, 245, 245]);
assert_eq!(serialize(&1i32), [1u8, 0, 0, 0]);
assert_eq!(serialize(&256i32), [0u8, 1, 0, 0]);
assert_eq!(serialize(&5000i32), [136u8, 19, 0, 0]);
assert_eq!(serialize(&500000i32), [32u8, 161, 7, 0]);
assert_eq!(serialize(&168430090i32), [10u8, 10, 10, 10]);
// u64
assert_eq!(serialize(&1u64), vec![1u8, 0, 0, 0, 0, 0, 0, 0]);
assert_eq!(serialize(&256u64), vec![0u8, 1, 0, 0, 0, 0, 0, 0]);
assert_eq!(serialize(&5000u64), vec![136u8, 19, 0, 0, 0, 0, 0, 0]);
assert_eq!(serialize(&500000u64), vec![32u8, 161, 7, 0, 0, 0, 0, 0]);
assert_eq!(serialize(&723401728380766730u64), vec![10u8, 10, 10, 10, 10, 10, 10, 10]);
assert_eq!(serialize(&1u64), [1u8, 0, 0, 0, 0, 0, 0, 0]);
assert_eq!(serialize(&256u64), [0u8, 1, 0, 0, 0, 0, 0, 0]);
assert_eq!(serialize(&5000u64), [136u8, 19, 0, 0, 0, 0, 0, 0]);
assert_eq!(serialize(&500000u64), [32u8, 161, 7, 0, 0, 0, 0, 0]);
assert_eq!(serialize(&723401728380766730u64), [10u8, 10, 10, 10, 10, 10, 10, 10]);
// i64
assert_eq!(serialize(&-1i64), vec![255u8, 255, 255, 255, 255, 255, 255, 255]);
assert_eq!(serialize(&-256i64), vec![0u8, 255, 255, 255, 255, 255, 255, 255]);
assert_eq!(serialize(&-5000i64), vec![120u8, 236, 255, 255, 255, 255, 255, 255]);
assert_eq!(serialize(&-500000i64), vec![224u8, 94, 248, 255, 255, 255, 255, 255]);
assert_eq!(
serialize(&-723401728380766730i64),
vec![246u8, 245, 245, 245, 245, 245, 245, 245]
);
assert_eq!(serialize(&1i64), vec![1u8, 0, 0, 0, 0, 0, 0, 0]);
assert_eq!(serialize(&256i64), vec![0u8, 1, 0, 0, 0, 0, 0, 0]);
assert_eq!(serialize(&5000i64), vec![136u8, 19, 0, 0, 0, 0, 0, 0]);
assert_eq!(serialize(&500000i64), vec![32u8, 161, 7, 0, 0, 0, 0, 0]);
assert_eq!(serialize(&723401728380766730i64), vec![10u8, 10, 10, 10, 10, 10, 10, 10]);
assert_eq!(serialize(&-1i64), [255u8, 255, 255, 255, 255, 255, 255, 255]);
assert_eq!(serialize(&-256i64), [0u8, 255, 255, 255, 255, 255, 255, 255]);
assert_eq!(serialize(&-5000i64), [120u8, 236, 255, 255, 255, 255, 255, 255]);
assert_eq!(serialize(&-500000i64), [224u8, 94, 248, 255, 255, 255, 255, 255]);
assert_eq!(serialize(&-723401728380766730i64), [246u8, 245, 245, 245, 245, 245, 245, 245]);
assert_eq!(serialize(&1i64), [1u8, 0, 0, 0, 0, 0, 0, 0]);
assert_eq!(serialize(&256i64), [0u8, 1, 0, 0, 0, 0, 0, 0]);
assert_eq!(serialize(&5000i64), [136u8, 19, 0, 0, 0, 0, 0, 0]);
assert_eq!(serialize(&500000i64), [32u8, 161, 7, 0, 0, 0, 0, 0]);
assert_eq!(serialize(&723401728380766730i64), [10u8, 10, 10, 10, 10, 10, 10, 10]);
}

#[test]
fn serialize_varint_test() {
assert_eq!(serialize(&VarInt(10)), vec![10u8]);
assert_eq!(serialize(&VarInt(0xFC)), vec![0xFCu8]);
assert_eq!(serialize(&VarInt(0xFD)), vec![0xFDu8, 0xFD, 0]);
assert_eq!(serialize(&VarInt(0xFFF)), vec![0xFDu8, 0xFF, 0xF]);
assert_eq!(serialize(&VarInt(0xF0F0F0F)), vec![0xFEu8, 0xF, 0xF, 0xF, 0xF]);
assert_eq!(serialize(&VarInt(10)), [10u8]);
assert_eq!(serialize(&VarInt(0xFC)), [0xFCu8]);
assert_eq!(serialize(&VarInt(0xFD)), [0xFDu8, 0xFD, 0]);
assert_eq!(serialize(&VarInt(0xFFF)), [0xFDu8, 0xFF, 0xF]);
assert_eq!(serialize(&VarInt(0xF0F0F0F)), [0xFEu8, 0xF, 0xF, 0xF, 0xF]);
assert_eq!(
serialize(&VarInt(0xF0F0F0F0F0E0)),
vec![0xFFu8, 0xE0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0, 0]
[0xFFu8, 0xE0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0, 0]
);
assert_eq!(
test_varint_encode(0xFF, &0x100000000_u64.to_le_bytes()).unwrap(),
Expand Down Expand Up @@ -1066,17 +1063,17 @@ mod tests {
#[test]
fn serialize_checkeddata_test() {
let cd = CheckedData::new(vec![1u8, 2, 3, 4, 5]);
assert_eq!(serialize(&cd), vec![5, 0, 0, 0, 162, 107, 175, 90, 1, 2, 3, 4, 5]);
assert_eq!(serialize(&cd), [5, 0, 0, 0, 162, 107, 175, 90, 1, 2, 3, 4, 5]);
}

#[test]
fn serialize_vector_test() {
assert_eq!(serialize(&vec![1u8, 2, 3]), vec![3u8, 1, 2, 3]);
assert_eq!(serialize(&vec![1u8, 2, 3]), [3u8, 1, 2, 3]);
}

#[test]
fn serialize_strbuf_test() {
assert_eq!(serialize(&"Andrew".to_string()), vec![6u8, 0x41, 0x6e, 0x64, 0x72, 0x65, 0x77]);
assert_eq!(serialize(&"Andrew".to_string()), [6u8, 0x41, 0x6e, 0x64, 0x72, 0x65, 0x77]);
}

#[test]
Expand Down
6 changes: 3 additions & 3 deletions bitcoin/src/crypto/sighash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1682,7 +1682,7 @@ mod tests {
c.taproot_signature_hash(0, &empty_prevouts, None, None, TapSighashType::All),
Err(TaprootError::PrevoutsSize(PrevoutsSizeError))
);
let two = vec![TxOut::NULL, TxOut::NULL];
let two = [TxOut::NULL, TxOut::NULL];
let too_many_prevouts = Prevouts::All(&two);
assert_eq!(
c.taproot_signature_hash(0, &too_many_prevouts, None, None, TapSighashType::All),
Expand Down Expand Up @@ -1967,7 +1967,7 @@ mod tests {

#[test]
fn sighashtype_fromstr_display() {
let sighashtypes = vec![
let sighashtypes = [
("SIGHASH_DEFAULT", TapSighashType::Default),
("SIGHASH_ALL", TapSighashType::All),
("SIGHASH_NONE", TapSighashType::None),
Expand All @@ -1980,7 +1980,7 @@ mod tests {
assert_eq!(sht.to_string(), s);
assert_eq!(TapSighashType::from_str(s).unwrap(), sht);
}
let sht_mistakes = vec![
let sht_mistakes = [
"SIGHASH_ALL | SIGHASH_ANYONECANPAY",
"SIGHASH_NONE |SIGHASH_ANYONECANPAY",
"SIGHASH_SINGLE| SIGHASH_ANYONECANPAY",
Expand Down
2 changes: 1 addition & 1 deletion bitcoin/src/network/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ mod tests {
#[cfg(feature = "serde")]
fn serde_roundtrip() {
use Network::*;
let tests = vec![
let tests = [
(Bitcoin, "bitcoin"),
(Testnet, "testnet"),
(Signet, "signet"),
Expand Down
2 changes: 1 addition & 1 deletion bitcoin/src/p2p/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ mod test {
address: [0, 0, 0, 0, 0, 0xffff, 0x0a00, 0x0001],
port: 8333
}),
vec![
[
1u8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 0x0a, 0, 0, 1,
0x20, 0x8d
]
Expand Down
12 changes: 6 additions & 6 deletions bitcoin/src/p2p/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ mod test {
let cmptblock = deserialize(&hex!("00000030d923ad36ff2d955abab07f8a0a6e813bc6e066b973e780c5e36674cad5d1cd1f6e265f2a17a0d35cbe701fe9d06e2c6324cfe135f6233e8b767bfa3fb4479b71115dc562ffff7f2006000000000000000000000000010002000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0302ee00ffffffff0100f9029500000000015100000000")).unwrap();
let blocktxn = deserialize(&hex!("2e93c0cff39ff605020072d96bc3a8d20b8447e294d08092351c8583e08d9b5a01020000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff0402dc0000ffffffff0200f90295000000001976a9142b4569203694fc997e13f2c0a1383b9e16c77a0d88ac0000000000000000266a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf90120000000000000000000000000000000000000000000000000000000000000000000000000")).unwrap();

let msgs = vec![
let msgs = [
NetworkMessage::Version(version_msg),
NetworkMessage::Verack,
NetworkMessage::Addr(vec![(
Expand Down Expand Up @@ -685,7 +685,7 @@ mod test {

// Test serializing.
let cs = CommandString("Andrew".into());
assert_eq!(serialize(&cs), vec![0x41u8, 0x6e, 0x64, 0x72, 0x65, 0x77, 0, 0, 0, 0, 0, 0]);
assert_eq!(serialize(&cs), [0x41u8, 0x6e, 0x64, 0x72, 0x65, 0x77, 0, 0, 0, 0, 0, 0]);

// Test deserializing
let cs: Result<CommandString, _> =
Expand All @@ -703,7 +703,7 @@ mod test {
#[rustfmt::skip]
fn serialize_verack_test() {
assert_eq!(serialize(&RawNetworkMessage::new(Magic::BITCOIN, NetworkMessage::Verack)),
vec![0xf9, 0xbe, 0xb4, 0xd9, 0x76, 0x65, 0x72, 0x61,
[0xf9, 0xbe, 0xb4, 0xd9, 0x76, 0x65, 0x72, 0x61,
0x63, 0x6B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x5d, 0xf6, 0xe0, 0xe2]);
}
Expand All @@ -712,7 +712,7 @@ mod test {
#[rustfmt::skip]
fn serialize_ping_test() {
assert_eq!(serialize(&RawNetworkMessage::new(Magic::BITCOIN, NetworkMessage::Ping(100))),
vec![0xf9, 0xbe, 0xb4, 0xd9, 0x70, 0x69, 0x6e, 0x67,
[0xf9, 0xbe, 0xb4, 0xd9, 0x70, 0x69, 0x6e, 0x67,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x08, 0x00, 0x00, 0x00, 0x24, 0x67, 0xf1, 0x1d,
0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]);
Expand All @@ -722,7 +722,7 @@ mod test {
#[rustfmt::skip]
fn serialize_mempool_test() {
assert_eq!(serialize(&RawNetworkMessage::new(Magic::BITCOIN, NetworkMessage::MemPool)),
vec![0xf9, 0xbe, 0xb4, 0xd9, 0x6d, 0x65, 0x6d, 0x70,
[0xf9, 0xbe, 0xb4, 0xd9, 0x6d, 0x65, 0x6d, 0x70,
0x6f, 0x6f, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x5d, 0xf6, 0xe0, 0xe2]);
}
Expand All @@ -731,7 +731,7 @@ mod test {
#[rustfmt::skip]
fn serialize_getaddr_test() {
assert_eq!(serialize(&RawNetworkMessage::new(Magic::BITCOIN, NetworkMessage::GetAddr)),
vec![0xf9, 0xbe, 0xb4, 0xd9, 0x67, 0x65, 0x74, 0x61,
[0xf9, 0xbe, 0xb4, 0xd9, 0x67, 0x65, 0x74, 0x61,
0x64, 0x64, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x5d, 0xf6, 0xe0, 0xe2]);
}
Expand Down
6 changes: 3 additions & 3 deletions bitcoin/src/pow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1682,7 +1682,7 @@ mod tests {

#[test]
fn u256_is_max_correct_negative() {
let tc = vec![U256::ZERO, U256::ONE, U256::from(u128::MAX)];
let tc = [U256::ZERO, U256::ONE, U256::from(u128::MAX)];
for t in tc {
assert!(!t.is_max())
}
Expand Down Expand Up @@ -1847,7 +1847,7 @@ mod tests {
#[test]
fn target_from_compact() {
// (nBits, target)
let tests = vec![
let tests = [
(0x0100_3456_u32, 0x00_u64), // High bit set.
(0x0112_3456_u32, 0x12_u64),
(0x0200_8000_u32, 0x80_u64),
Expand Down Expand Up @@ -1930,7 +1930,7 @@ mod tests {
#[test]
fn work_log2() {
// Compare work log2 to historical Bitcoin Core values found in Core logs.
let tests: Vec<(u128, f64)> = vec![
let tests: [(u128, f64); 5] = [
// (chainwork, core log2) // height
(0x200020002, 33.000022), // 1
(0xa97d67041c5e51596ee7, 79.405055), // 308004
Expand Down
2 changes: 1 addition & 1 deletion bitcoin/src/taproot/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1705,7 +1705,7 @@ mod test {
)
.unwrap();

let script_weights = vec![
let script_weights = [
(10, ScriptBuf::from_hex("51").unwrap()), // semantics of script don't matter for this test
(20, ScriptBuf::from_hex("52").unwrap()),
(20, ScriptBuf::from_hex("53").unwrap()),
Expand Down
6 changes: 3 additions & 3 deletions bitcoin/tests/bip_174.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ fn bip174_psbt_workflow() {
//

// Strings from BIP 174 test vector.
let test_vector = vec![
let test_vector = [
("cP53pDbR5WtAD8dYAW9hhTjuvvTVaEiQBdrz9XPrgLBeRFiyCbQr", "0h/0h/0h"), // from_priv, into_derivation_path?
("cR6SXDoyfQrcp4piaiHE97Rsgta9mNhGTen9XeonVgwsh4iSgw6d", "0h/0h/2h"),
];
Expand All @@ -76,7 +76,7 @@ fn bip174_psbt_workflow() {
//

// Strings from BIP 174 test vector.
let test_vector = vec![
let test_vector = [
("cT7J9YpCwY3AVRFSjN6ukeEeWY6mhpbJPxRaDaP5QTdygQRxP9Au", "0h/0h/1h"),
("cNBc3SWUip9PPm1GjRoLEJT6T41iNzCYtD7qro84FMnM5zEqeJsE", "0h/0h/3h"),
];
Expand Down Expand Up @@ -220,7 +220,7 @@ fn update_psbt(mut psbt: Psbt, fingerprint: Fingerprint) -> Psbt {

// Public key and its derivation path (these are the child pubkeys for our `Xpriv`,
// can be verified by deriving the key using this derivation path).
let pk_path = vec![
let pk_path = [
("029583bf39ae0a609747ad199addd634fa6108559d6c5cd39b4c2183f1ab96e07f", "0h/0h/0h"),
("02dab61ff49a14db6a7d02b0cd1fbb78fc4b18312b5b4e54dae4dba2fbfef536d7", "0h/0h/1h"),
("03089dc10c7ac6db54f91329af617333db388cead0c231f723379d1b99030b02dc", "0h/0h/2h"),
Expand Down
2 changes: 1 addition & 1 deletion bitcoin/tests/serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ fn serde_regression_witness() {
let w0 = Vec::from_hex("03d2e15674941bad4a996372cb87e1856d3652606d98562fe39c5e9e7e413f2105")
.unwrap();
let w1 = Vec::from_hex("000000").unwrap();
let vec = vec![w0, w1];
let vec = [w0, w1];
let witness = Witness::from_slice(&vec);

let got = serialize(&witness).unwrap();
Expand Down
10 changes: 5 additions & 5 deletions hashes/src/hash160.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,16 @@ mod tests {
#[derive(Clone)]
#[cfg(feature = "alloc")]
struct Test {
input: Vec<u8>,
output: Vec<u8>,
input: [u8; 65],
output: [u8; 20],
output_str: &'static str,
}

#[rustfmt::skip]
let tests = vec![
let tests = [
// Uncompressed pubkey obtained from Bitcoin key; data from validateaddress
Test {
input: vec![
input: [
0x04, 0xa1, 0x49, 0xd7, 0x6c, 0x5d, 0xe2, 0x7a, 0x2d,
0xdb, 0xfa, 0xa1, 0x24, 0x6c, 0x4a, 0xdc, 0xd2, 0xb6,
0xf7, 0xaa, 0x29, 0x54, 0xc2, 0xe2, 0x53, 0x03, 0xf5,
Expand All @@ -76,7 +76,7 @@ mod tests {
0x81, 0x64, 0xcc, 0xf9, 0x82, 0xa1, 0x38, 0x69, 0x1a,
0x55, 0x19,
],
output: vec![
output: [
0xda, 0x0b, 0x34, 0x52, 0xb0, 0x6f, 0xe3, 0x41,
0x62, 0x6a, 0xd0, 0x94, 0x9c, 0x18, 0x3f, 0xbd,
0xa5, 0x67, 0x68, 0x26,
Expand Down
Loading

0 comments on commit d0b6a4c

Please sign in to comment.