From a3feee79ef784228dcb8d9c20146f56aa3b8b1c4 Mon Sep 17 00:00:00 2001 From: Jacinta Ferrant Date: Fri, 3 Jan 2025 12:20:21 -0500 Subject: [PATCH] Remove useless vec from MessageSignature::from_raw Signed-off-by: Jacinta Ferrant --- stackslib/src/burnchains/tests/mod.rs | 5 +- stackslib/src/chainstate/stacks/auth.rs | 84 +++++++++---------- .../src/chainstate/stacks/index/test/mod.rs | 6 +- stackslib/src/chainstate/stacks/mod.rs | 30 +++---- stackslib/src/clarity_vm/clarity.rs | 2 +- stackslib/src/core/tests/mod.rs | 2 +- stackslib/src/net/codec.rs | 12 +-- 7 files changed, 67 insertions(+), 74 deletions(-) diff --git a/stackslib/src/burnchains/tests/mod.rs b/stackslib/src/burnchains/tests/mod.rs index 3d88763e2c..24fa52e4ff 100644 --- a/stackslib/src/burnchains/tests/mod.rs +++ b/stackslib/src/burnchains/tests/mod.rs @@ -910,10 +910,7 @@ fn verify_keys_accepted(node: &mut TestBurnchainNode, prev_keys: &[LeaderKeyRegi } } -fn verify_commits_accepted( - node: &TestBurnchainNode, - next_block_commits: &[LeaderBlockCommitOp], -) { +fn verify_commits_accepted(node: &TestBurnchainNode, next_block_commits: &[LeaderBlockCommitOp]) { // all commits accepted for commit in next_block_commits.iter() { let tx_opt = diff --git a/stackslib/src/chainstate/stacks/auth.rs b/stackslib/src/chainstate/stacks/auth.rs index 6d3d1f1241..5a060280f2 100644 --- a/stackslib/src/chainstate/stacks/auth.rs +++ b/stackslib/src/chainstate/stacks/auth.rs @@ -1436,7 +1436,7 @@ mod test { key_encoding: TransactionPublicKeyEncoding::Uncompressed, nonce: 123, tx_fee: 456, - signature: MessageSignature::from_raw(&vec![0xff; 65]), + signature: MessageSignature::from_raw(&[0xff; 65]), }; let spending_condition_p2pkh_uncompressed_bytes = vec![ @@ -1460,7 +1460,7 @@ mod test { key_encoding: TransactionPublicKeyEncoding::Compressed, nonce: 345, tx_fee: 456, - signature: MessageSignature::from_raw(&vec![0xfe; 65]), + signature: MessageSignature::from_raw(&[0xfe; 65]), }; let spending_condition_p2pkh_compressed_bytes = vec![ @@ -1504,8 +1504,8 @@ mod test { nonce: 123, tx_fee: 456, fields: vec![ - TransactionAuthField::Signature(TransactionPublicKeyEncoding::Uncompressed, MessageSignature::from_raw(&vec![0xff; 65])), - TransactionAuthField::Signature(TransactionPublicKeyEncoding::Uncompressed, MessageSignature::from_raw(&vec![0xfe; 65])), + TransactionAuthField::Signature(TransactionPublicKeyEncoding::Uncompressed, MessageSignature::from_raw(&[0xff; 65])), + TransactionAuthField::Signature(TransactionPublicKeyEncoding::Uncompressed, MessageSignature::from_raw(&[0xfe; 65])), TransactionAuthField::PublicKey(PubKey::from_hex("04ef2340518b5867b23598a9cf74611f8b98064f7d55cdb8c107c67b5efcbc5c771f112f919b00a6c6c5f51f7c63e1762fe9fac9b66ec75a053db7f51f4a52712b").unwrap()), ], signatures_required: 2 @@ -1546,11 +1546,11 @@ mod test { fields: vec![ TransactionAuthField::Signature( TransactionPublicKeyEncoding::Compressed, - MessageSignature::from_raw(&vec![0xff; 65]), + MessageSignature::from_raw(&[0xff; 65]), ), TransactionAuthField::Signature( TransactionPublicKeyEncoding::Compressed, - MessageSignature::from_raw(&vec![0xfe; 65]), + MessageSignature::from_raw(&[0xfe; 65]), ), TransactionAuthField::PublicKey( PubKey::from_hex( @@ -1615,8 +1615,8 @@ mod test { nonce: 123, tx_fee: 456, fields: vec![ - TransactionAuthField::Signature(TransactionPublicKeyEncoding::Uncompressed, MessageSignature::from_raw(&vec![0xff; 65])), - TransactionAuthField::Signature(TransactionPublicKeyEncoding::Uncompressed, MessageSignature::from_raw(&vec![0xfe; 65])), + TransactionAuthField::Signature(TransactionPublicKeyEncoding::Uncompressed, MessageSignature::from_raw(&[0xff; 65])), + TransactionAuthField::Signature(TransactionPublicKeyEncoding::Uncompressed, MessageSignature::from_raw(&[0xfe; 65])), TransactionAuthField::PublicKey(PubKey::from_hex("04ef2340518b5867b23598a9cf74611f8b98064f7d55cdb8c107c67b5efcbc5c771f112f919b00a6c6c5f51f7c63e1762fe9fac9b66ec75a053db7f51f4a52712b").unwrap()), ], signatures_required: 2 @@ -1657,11 +1657,11 @@ mod test { fields: vec![ TransactionAuthField::Signature( TransactionPublicKeyEncoding::Compressed, - MessageSignature::from_raw(&vec![0xff; 65]), + MessageSignature::from_raw(&[0xff; 65]), ), TransactionAuthField::Signature( TransactionPublicKeyEncoding::Compressed, - MessageSignature::from_raw(&vec![0xfe; 65]), + MessageSignature::from_raw(&[0xfe; 65]), ), TransactionAuthField::PublicKey( PubKey::from_hex( @@ -1725,7 +1725,7 @@ mod test { key_encoding: TransactionPublicKeyEncoding::Compressed, nonce: 345, tx_fee: 567, - signature: MessageSignature::from_raw(&vec![0xfe; 65]), + signature: MessageSignature::from_raw(&[0xfe; 65]), }; let spending_condition_p2wpkh_compressed_bytes = vec![ @@ -1759,11 +1759,11 @@ mod test { fields: vec![ TransactionAuthField::Signature( TransactionPublicKeyEncoding::Compressed, - MessageSignature::from_raw(&vec![0xff; 65]), + MessageSignature::from_raw(&[0xff; 65]), ), TransactionAuthField::Signature( TransactionPublicKeyEncoding::Compressed, - MessageSignature::from_raw(&vec![0xfe; 65]), + MessageSignature::from_raw(&[0xfe; 65]), ), TransactionAuthField::PublicKey( PubKey::from_hex( @@ -1818,7 +1818,7 @@ mod test { key_encoding: TransactionPublicKeyEncoding::Uncompressed, nonce: 123, tx_fee: 567, - signature: MessageSignature::from_raw(&vec![0xff; 65]) + signature: MessageSignature::from_raw(&[0xff; 65]) }), TransactionSpendingCondition::Singlesig(SinglesigSpendingCondition { signer: Hash160([0x11; 20]), @@ -1826,7 +1826,7 @@ mod test { key_encoding: TransactionPublicKeyEncoding::Compressed, nonce: 345, tx_fee: 567, - signature: MessageSignature::from_raw(&vec![0xff; 65]) + signature: MessageSignature::from_raw(&[0xff; 65]) }), TransactionSpendingCondition::Multisig(MultisigSpendingCondition { signer: Hash160([0x11; 20]), @@ -1834,8 +1834,8 @@ mod test { nonce: 123, tx_fee: 567, fields: vec![ - TransactionAuthField::Signature(TransactionPublicKeyEncoding::Uncompressed, MessageSignature::from_raw(&vec![0xff; 65])), - TransactionAuthField::Signature(TransactionPublicKeyEncoding::Uncompressed, MessageSignature::from_raw(&vec![0xfe; 65])), + TransactionAuthField::Signature(TransactionPublicKeyEncoding::Uncompressed, MessageSignature::from_raw(&[0xff; 65])), + TransactionAuthField::Signature(TransactionPublicKeyEncoding::Uncompressed, MessageSignature::from_raw(&[0xfe; 65])), TransactionAuthField::PublicKey(PubKey::from_hex("04ef2340518b5867b23598a9cf74611f8b98064f7d55cdb8c107c67b5efcbc5c771f112f919b00a6c6c5f51f7c63e1762fe9fac9b66ec75a053db7f51f4a52712b").unwrap()), ], signatures_required: 2 @@ -1846,8 +1846,8 @@ mod test { nonce: 456, tx_fee: 567, fields: vec![ - TransactionAuthField::Signature(TransactionPublicKeyEncoding::Compressed, MessageSignature::from_raw(&vec![0xff; 65])), - TransactionAuthField::Signature(TransactionPublicKeyEncoding::Compressed, MessageSignature::from_raw(&vec![0xfe; 65])), + TransactionAuthField::Signature(TransactionPublicKeyEncoding::Compressed, MessageSignature::from_raw(&[0xff; 65])), + TransactionAuthField::Signature(TransactionPublicKeyEncoding::Compressed, MessageSignature::from_raw(&[0xfe; 65])), TransactionAuthField::PublicKey(PubKey::from_hex("03ef2340518b5867b23598a9cf74611f8b98064f7d55cdb8c107c67b5efcbc5c77").unwrap()) ], signatures_required: 2 @@ -1858,8 +1858,8 @@ mod test { nonce: 123, tx_fee: 567, fields: vec![ - TransactionAuthField::Signature(TransactionPublicKeyEncoding::Uncompressed, MessageSignature::from_raw(&vec![0xff; 65])), - TransactionAuthField::Signature(TransactionPublicKeyEncoding::Uncompressed, MessageSignature::from_raw(&vec![0xfe; 65])), + TransactionAuthField::Signature(TransactionPublicKeyEncoding::Uncompressed, MessageSignature::from_raw(&[0xff; 65])), + TransactionAuthField::Signature(TransactionPublicKeyEncoding::Uncompressed, MessageSignature::from_raw(&[0xfe; 65])), TransactionAuthField::PublicKey(PubKey::from_hex("04ef2340518b5867b23598a9cf74611f8b98064f7d55cdb8c107c67b5efcbc5c771f112f919b00a6c6c5f51f7c63e1762fe9fac9b66ec75a053db7f51f4a52712b").unwrap()), ], signatures_required: 2 @@ -1870,8 +1870,8 @@ mod test { nonce: 456, tx_fee: 567, fields: vec![ - TransactionAuthField::Signature(TransactionPublicKeyEncoding::Compressed, MessageSignature::from_raw(&vec![0xff; 65])), - TransactionAuthField::Signature(TransactionPublicKeyEncoding::Compressed, MessageSignature::from_raw(&vec![0xfe; 65])), + TransactionAuthField::Signature(TransactionPublicKeyEncoding::Compressed, MessageSignature::from_raw(&[0xff; 65])), + TransactionAuthField::Signature(TransactionPublicKeyEncoding::Compressed, MessageSignature::from_raw(&[0xfe; 65])), TransactionAuthField::PublicKey(PubKey::from_hex("03ef2340518b5867b23598a9cf74611f8b98064f7d55cdb8c107c67b5efcbc5c77").unwrap()) ], signatures_required: 2 @@ -1882,9 +1882,9 @@ mod test { nonce: 123, tx_fee: 567, fields: vec![ - TransactionAuthField::Signature(TransactionPublicKeyEncoding::Uncompressed, MessageSignature::from_raw(&vec![0xff; 65])), - TransactionAuthField::Signature(TransactionPublicKeyEncoding::Uncompressed, MessageSignature::from_raw(&vec![0xfe; 65])), - TransactionAuthField::Signature(TransactionPublicKeyEncoding::Uncompressed, MessageSignature::from_raw(&vec![0xfd; 65])), + TransactionAuthField::Signature(TransactionPublicKeyEncoding::Uncompressed, MessageSignature::from_raw(&[0xff; 65])), + TransactionAuthField::Signature(TransactionPublicKeyEncoding::Uncompressed, MessageSignature::from_raw(&[0xfe; 65])), + TransactionAuthField::Signature(TransactionPublicKeyEncoding::Uncompressed, MessageSignature::from_raw(&[0xfd; 65])), ], signatures_required: 1 }), @@ -1894,9 +1894,9 @@ mod test { nonce: 456, tx_fee: 567, fields: vec![ - TransactionAuthField::Signature(TransactionPublicKeyEncoding::Compressed, MessageSignature::from_raw(&vec![0xff; 65])), - TransactionAuthField::Signature(TransactionPublicKeyEncoding::Compressed, MessageSignature::from_raw(&vec![0xfe; 65])), - TransactionAuthField::Signature(TransactionPublicKeyEncoding::Compressed, MessageSignature::from_raw(&vec![0xfd; 65])), + TransactionAuthField::Signature(TransactionPublicKeyEncoding::Compressed, MessageSignature::from_raw(&[0xff; 65])), + TransactionAuthField::Signature(TransactionPublicKeyEncoding::Compressed, MessageSignature::from_raw(&[0xfe; 65])), + TransactionAuthField::Signature(TransactionPublicKeyEncoding::Compressed, MessageSignature::from_raw(&[0xfd; 65])), ], signatures_required: 1 }), @@ -1906,7 +1906,7 @@ mod test { key_encoding: TransactionPublicKeyEncoding::Compressed, nonce: 345, tx_fee: 567, - signature: MessageSignature::from_raw(&vec![0xfe; 65]), + signature: MessageSignature::from_raw(&[0xfe; 65]), }), TransactionSpendingCondition::Multisig(MultisigSpendingCondition { signer: Hash160([0x11; 20]), @@ -1914,8 +1914,8 @@ mod test { nonce: 456, tx_fee: 567, fields: vec![ - TransactionAuthField::Signature(TransactionPublicKeyEncoding::Compressed, MessageSignature::from_raw(&vec![0xff; 65])), - TransactionAuthField::Signature(TransactionPublicKeyEncoding::Compressed, MessageSignature::from_raw(&vec![0xfe; 65])), + TransactionAuthField::Signature(TransactionPublicKeyEncoding::Compressed, MessageSignature::from_raw(&[0xff; 65])), + TransactionAuthField::Signature(TransactionPublicKeyEncoding::Compressed, MessageSignature::from_raw(&[0xfe; 65])), TransactionAuthField::PublicKey(PubKey::from_hex("03ef2340518b5867b23598a9cf74611f8b98064f7d55cdb8c107c67b5efcbc5c77").unwrap()) ], signatures_required: 2 @@ -1926,8 +1926,8 @@ mod test { nonce: 456, tx_fee: 567, fields: vec![ - TransactionAuthField::Signature(TransactionPublicKeyEncoding::Compressed, MessageSignature::from_raw(&vec![0xff; 65])), - TransactionAuthField::Signature(TransactionPublicKeyEncoding::Compressed, MessageSignature::from_raw(&vec![0xfe; 65])), + TransactionAuthField::Signature(TransactionPublicKeyEncoding::Compressed, MessageSignature::from_raw(&[0xff; 65])), + TransactionAuthField::Signature(TransactionPublicKeyEncoding::Compressed, MessageSignature::from_raw(&[0xfe; 65])), TransactionAuthField::PublicKey(PubKey::from_hex("03ef2340518b5867b23598a9cf74611f8b98064f7d55cdb8c107c67b5efcbc5c77").unwrap()) ], signatures_required: 2 @@ -1938,9 +1938,9 @@ mod test { nonce: 456, tx_fee: 567, fields: vec![ - TransactionAuthField::Signature(TransactionPublicKeyEncoding::Compressed, MessageSignature::from_raw(&vec![0xff; 65])), - TransactionAuthField::Signature(TransactionPublicKeyEncoding::Compressed, MessageSignature::from_raw(&vec![0xfe; 65])), - TransactionAuthField::Signature(TransactionPublicKeyEncoding::Compressed, MessageSignature::from_raw(&vec![0xfd; 65])), + TransactionAuthField::Signature(TransactionPublicKeyEncoding::Compressed, MessageSignature::from_raw(&[0xff; 65])), + TransactionAuthField::Signature(TransactionPublicKeyEncoding::Compressed, MessageSignature::from_raw(&[0xfe; 65])), + TransactionAuthField::Signature(TransactionPublicKeyEncoding::Compressed, MessageSignature::from_raw(&[0xfd; 65])), ], signatures_required: 1 }) @@ -2136,7 +2136,7 @@ mod test { nonce: 123, tx_fee: 567, key_encoding: TransactionPublicKeyEncoding::Uncompressed, - signature: MessageSignature::from_raw(&vec![0xff; 65]), + signature: MessageSignature::from_raw(&[0xff; 65]), }); let bad_p2wpkh_uncompressed_bytes = vec![ @@ -2161,8 +2161,8 @@ mod test { nonce: 456, tx_fee: 567, fields: vec![ - TransactionAuthField::Signature(TransactionPublicKeyEncoding::Uncompressed, MessageSignature::from_raw(&vec![0xff; 65])), - TransactionAuthField::Signature(TransactionPublicKeyEncoding::Uncompressed, MessageSignature::from_raw(&vec![0xfe; 65])), + TransactionAuthField::Signature(TransactionPublicKeyEncoding::Uncompressed, MessageSignature::from_raw(&[0xff; 65])), + TransactionAuthField::Signature(TransactionPublicKeyEncoding::Uncompressed, MessageSignature::from_raw(&[0xfe; 65])), TransactionAuthField::PublicKey(PubKey::from_hex("04b7e10dd2c02dec648880ea346ece86a7820c4fa5114fb500b2645f6c972092dbe2334a653db0ab8d8ccffa6c35d3919e4cf8da3aeedafc7b9eb8235d0f2e7fdc").unwrap()), ], signatures_required: 2 @@ -2199,8 +2199,8 @@ mod test { nonce: 456, tx_fee: 567, fields: vec![ - TransactionAuthField::Signature(TransactionPublicKeyEncoding::Uncompressed, MessageSignature::from_raw(&vec![0xff; 65])), - TransactionAuthField::Signature(TransactionPublicKeyEncoding::Uncompressed, MessageSignature::from_raw(&vec![0xfe; 65])), + TransactionAuthField::Signature(TransactionPublicKeyEncoding::Uncompressed, MessageSignature::from_raw(&[0xff; 65])), + TransactionAuthField::Signature(TransactionPublicKeyEncoding::Uncompressed, MessageSignature::from_raw(&[0xfe; 65])), TransactionAuthField::PublicKey(PubKey::from_hex("04b7e10dd2c02dec648880ea346ece86a7820c4fa5114fb500b2645f6c972092dbe2334a653db0ab8d8ccffa6c35d3919e4cf8da3aeedafc7b9eb8235d0f2e7fdc").unwrap()), ], signatures_required: 2 diff --git a/stackslib/src/chainstate/stacks/index/test/mod.rs b/stackslib/src/chainstate/stacks/index/test/mod.rs index a4335d8fff..369be2722e 100644 --- a/stackslib/src/chainstate/stacks/index/test/mod.rs +++ b/stackslib/src/chainstate/stacks/index/test/mod.rs @@ -100,11 +100,7 @@ where test_debug!("----- END TRIE ------\n"); } -pub fn merkle_test( - s: &mut TrieStorageConnection, - path: &[u8], - value: &[u8], -) { +pub fn merkle_test(s: &mut TrieStorageConnection, path: &[u8], value: &[u8]) { let (_, root_hash) = Trie::read_root(s).unwrap(); let triepath = TrieHash::from_bytes(&path[..]).unwrap(); diff --git a/stackslib/src/chainstate/stacks/mod.rs b/stackslib/src/chainstate/stacks/mod.rs index dcb9348a21..23990fe199 100644 --- a/stackslib/src/chainstate/stacks/mod.rs +++ b/stackslib/src/chainstate/stacks/mod.rs @@ -1165,7 +1165,7 @@ pub mod test { key_encoding: TransactionPublicKeyEncoding::Uncompressed, nonce: 123, tx_fee: 456, - signature: MessageSignature::from_raw(&vec![0xff; 65]) + signature: MessageSignature::from_raw(&[0xff; 65]) }), TransactionSpendingCondition::Singlesig(SinglesigSpendingCondition { signer: Hash160([0x11; 20]), @@ -1173,7 +1173,7 @@ pub mod test { key_encoding: TransactionPublicKeyEncoding::Compressed, nonce: 234, tx_fee: 567, - signature: MessageSignature::from_raw(&vec![0xff; 65]) + signature: MessageSignature::from_raw(&[0xff; 65]) }), TransactionSpendingCondition::Multisig(MultisigSpendingCondition { signer: Hash160([0x11; 20]), @@ -1181,8 +1181,8 @@ pub mod test { nonce: 345, tx_fee: 678, fields: vec![ - TransactionAuthField::Signature(TransactionPublicKeyEncoding::Uncompressed, MessageSignature::from_raw(&vec![0xff; 65])), - TransactionAuthField::Signature(TransactionPublicKeyEncoding::Uncompressed, MessageSignature::from_raw(&vec![0xfe; 65])), + TransactionAuthField::Signature(TransactionPublicKeyEncoding::Uncompressed, MessageSignature::from_raw(&[0xff; 65])), + TransactionAuthField::Signature(TransactionPublicKeyEncoding::Uncompressed, MessageSignature::from_raw(&[0xfe; 65])), TransactionAuthField::PublicKey(PubKey::from_hex("04ef2340518b5867b23598a9cf74611f8b98064f7d55cdb8c107c67b5efcbc5c771f112f919b00a6c6c5f51f7c63e1762fe9fac9b66ec75a053db7f51f4a52712b").unwrap()), ], signatures_required: 2 @@ -1193,8 +1193,8 @@ pub mod test { nonce: 456, tx_fee: 789, fields: vec![ - TransactionAuthField::Signature(TransactionPublicKeyEncoding::Compressed, MessageSignature::from_raw(&vec![0xff; 65])), - TransactionAuthField::Signature(TransactionPublicKeyEncoding::Compressed, MessageSignature::from_raw(&vec![0xfe; 65])), + TransactionAuthField::Signature(TransactionPublicKeyEncoding::Compressed, MessageSignature::from_raw(&[0xff; 65])), + TransactionAuthField::Signature(TransactionPublicKeyEncoding::Compressed, MessageSignature::from_raw(&[0xfe; 65])), TransactionAuthField::PublicKey(PubKey::from_hex("03ef2340518b5867b23598a9cf74611f8b98064f7d55cdb8c107c67b5efcbc5c77").unwrap()) ], signatures_required: 2 @@ -1205,7 +1205,7 @@ pub mod test { key_encoding: TransactionPublicKeyEncoding::Compressed, nonce: 567, tx_fee: 890, - signature: MessageSignature::from_raw(&vec![0xfe; 65]), + signature: MessageSignature::from_raw(&[0xfe; 65]), }), TransactionSpendingCondition::Multisig(MultisigSpendingCondition { signer: Hash160([0x11; 20]), @@ -1213,8 +1213,8 @@ pub mod test { nonce: 678, tx_fee: 901, fields: vec![ - TransactionAuthField::Signature(TransactionPublicKeyEncoding::Compressed, MessageSignature::from_raw(&vec![0xff; 65])), - TransactionAuthField::Signature(TransactionPublicKeyEncoding::Compressed, MessageSignature::from_raw(&vec![0xfe; 65])), + TransactionAuthField::Signature(TransactionPublicKeyEncoding::Compressed, MessageSignature::from_raw(&[0xff; 65])), + TransactionAuthField::Signature(TransactionPublicKeyEncoding::Compressed, MessageSignature::from_raw(&[0xfe; 65])), TransactionAuthField::PublicKey(PubKey::from_hex("03ef2340518b5867b23598a9cf74611f8b98064f7d55cdb8c107c67b5efcbc5c77").unwrap()) ], signatures_required: 2 @@ -1229,8 +1229,8 @@ pub mod test { nonce: 678, tx_fee: 901, fields: vec![ - TransactionAuthField::Signature(TransactionPublicKeyEncoding::Compressed, MessageSignature::from_raw(&vec![0xff; 65])), - TransactionAuthField::Signature(TransactionPublicKeyEncoding::Compressed, MessageSignature::from_raw(&vec![0xfe; 65])), + TransactionAuthField::Signature(TransactionPublicKeyEncoding::Compressed, MessageSignature::from_raw(&[0xff; 65])), + TransactionAuthField::Signature(TransactionPublicKeyEncoding::Compressed, MessageSignature::from_raw(&[0xfe; 65])), TransactionAuthField::PublicKey(PubKey::from_hex("03ef2340518b5867b23598a9cf74611f8b98064f7d55cdb8c107c67b5efcbc5c77").unwrap()) ], signatures_required: 2 @@ -1241,8 +1241,8 @@ pub mod test { nonce: 345, tx_fee: 678, fields: vec![ - TransactionAuthField::Signature(TransactionPublicKeyEncoding::Uncompressed, MessageSignature::from_raw(&vec![0xff; 65])), - TransactionAuthField::Signature(TransactionPublicKeyEncoding::Uncompressed, MessageSignature::from_raw(&vec![0xfe; 65])), + TransactionAuthField::Signature(TransactionPublicKeyEncoding::Uncompressed, MessageSignature::from_raw(&[0xff; 65])), + TransactionAuthField::Signature(TransactionPublicKeyEncoding::Uncompressed, MessageSignature::from_raw(&[0xfe; 65])), TransactionAuthField::PublicKey(PubKey::from_hex("04ef2340518b5867b23598a9cf74611f8b98064f7d55cdb8c107c67b5efcbc5c771f112f919b00a6c6c5f51f7c63e1762fe9fac9b66ec75a053db7f51f4a52712b").unwrap()), ], signatures_required: 2 @@ -1253,8 +1253,8 @@ pub mod test { nonce: 456, tx_fee: 789, fields: vec![ - TransactionAuthField::Signature(TransactionPublicKeyEncoding::Compressed, MessageSignature::from_raw(&vec![0xff; 65])), - TransactionAuthField::Signature(TransactionPublicKeyEncoding::Compressed, MessageSignature::from_raw(&vec![0xfe; 65])), + TransactionAuthField::Signature(TransactionPublicKeyEncoding::Compressed, MessageSignature::from_raw(&[0xff; 65])), + TransactionAuthField::Signature(TransactionPublicKeyEncoding::Compressed, MessageSignature::from_raw(&[0xfe; 65])), TransactionAuthField::PublicKey(PubKey::from_hex("03ef2340518b5867b23598a9cf74611f8b98064f7d55cdb8c107c67b5efcbc5c77").unwrap()) ], signatures_required: 2 diff --git a/stackslib/src/clarity_vm/clarity.rs b/stackslib/src/clarity_vm/clarity.rs index 739f85d3e8..9db8cc8596 100644 --- a/stackslib/src/clarity_vm/clarity.rs +++ b/stackslib/src/clarity_vm/clarity.rs @@ -2568,7 +2568,7 @@ mod tests { key_encoding: TransactionPublicKeyEncoding::Compressed, nonce: 0, tx_fee: 1, - signature: MessageSignature::from_raw(&vec![0xfe; 65]), + signature: MessageSignature::from_raw(&[0xfe; 65]), }); let contract = "(define-public (foo) (ok 1))"; diff --git a/stackslib/src/core/tests/mod.rs b/stackslib/src/core/tests/mod.rs index 672413b1bb..55cf8ae884 100644 --- a/stackslib/src/core/tests/mod.rs +++ b/stackslib/src/core/tests/mod.rs @@ -1666,7 +1666,7 @@ fn mempool_db_test_rbf() { key_encoding: TransactionPublicKeyEncoding::Uncompressed, nonce: 123, tx_fee: 456, - signature: MessageSignature::from_raw(&vec![0xff; 65]), + signature: MessageSignature::from_raw(&[0xff; 65]), }); let stx_address = StacksAddress { version: 1, diff --git a/stackslib/src/net/codec.rs b/stackslib/src/net/codec.rs index ff37ceaf65..4639c774da 100644 --- a/stackslib/src/net/codec.rs +++ b/stackslib/src/net/codec.rs @@ -1792,7 +1792,7 @@ pub mod test { burn_stable_block_height: 0x00001111, burn_stable_block_hash: BurnchainHeaderHash([0x22; 32]), additional_data: 0x33333333, - signature: MessageSignature::from_raw(&vec![0x44; 65]), + signature: MessageSignature::from_raw(&[0x44; 65]), payload_len: 0x000007ff, }; let preamble_bytes: Vec = vec![ @@ -2344,7 +2344,7 @@ pub mod test { let data = StackerDBChunkData { slot_id: 2, slot_version: 3, - sig: MessageSignature::from_raw(&vec![0x44; 65]), + sig: MessageSignature::from_raw(&[0x44; 65]), data: vec![ 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, ], @@ -2371,7 +2371,7 @@ pub mod test { let data = StackerDBChunkData { slot_id: 2, slot_version: 3, - sig: MessageSignature::from_raw(&vec![0x44; 65]), + sig: MessageSignature::from_raw(&[0x44; 65]), data: vec![ 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, ], @@ -2636,7 +2636,7 @@ pub mod test { StacksMessageType::StackerDBChunk(StackerDBChunkData { slot_id: 2, slot_version: 3, - sig: MessageSignature::from_raw(&vec![0x44; 65]), + sig: MessageSignature::from_raw(&[0x44; 65]), data: vec![0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff] }), StacksMessageType::StackerDBPushChunk(StackerDBPushChunkData { @@ -2645,7 +2645,7 @@ pub mod test { chunk_data: StackerDBChunkData { slot_id: 2, slot_version: 3, - sig: MessageSignature::from_raw(&vec![0x44; 65]), + sig: MessageSignature::from_raw(&[0x44; 65]), data: vec![0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff] } }), @@ -2734,7 +2734,7 @@ pub mod test { burn_stable_block_height: 0x00001111, burn_stable_block_hash: BurnchainHeaderHash([0x22; 32]), additional_data: 0x33333333, - signature: MessageSignature::from_raw(&vec![0x44; 65]), + signature: MessageSignature::from_raw(&[0x44; 65]), payload_len: (relayers_bytes.len() + payload_bytes.len()) as u32, };