Skip to content

Commit 83d8f0a

Browse files
chore: run clang-format and add trivial headers
1 parent 6b41290 commit 83d8f0a

File tree

5 files changed

+26
-23
lines changed

5 files changed

+26
-23
lines changed

src/bench/bls.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ static void BLS_ToBytes_Signature(benchmark::Bench& bench)
364364
CBLSSecretKey sk;
365365
sk.MakeNewKey();
366366
auto sig = sk.Sign(uint256::ONE, false);
367-
367+
368368
bench.run([&] {
369369
auto bytes = sig.ToBytes(false);
370370
ankerl::nanobench::doNotOptimizeAway(bytes);
@@ -376,7 +376,7 @@ static void BLS_ToByteVector_Signature(benchmark::Bench& bench)
376376
CBLSSecretKey sk;
377377
sk.MakeNewKey();
378378
auto sig = sk.Sign(uint256::ONE, false);
379-
379+
380380
bench.run([&] {
381381
auto bytes = sig.ToByteVector(false);
382382
ankerl::nanobench::doNotOptimizeAway(bytes);
@@ -388,7 +388,7 @@ static void BLS_ToBytes_PubKey(benchmark::Bench& bench)
388388
CBLSSecretKey sk;
389389
sk.MakeNewKey();
390390
auto pk = sk.GetPublicKey();
391-
391+
392392
bench.run([&] {
393393
auto bytes = pk.ToBytes(false);
394394
ankerl::nanobench::doNotOptimizeAway(bytes);
@@ -400,7 +400,7 @@ static void BLS_ToByteVector_PubKey(benchmark::Bench& bench)
400400
CBLSSecretKey sk;
401401
sk.MakeNewKey();
402402
auto pk = sk.GetPublicKey();
403-
403+
404404
bench.run([&] {
405405
auto bytes = pk.ToByteVector(false);
406406
ankerl::nanobench::doNotOptimizeAway(bytes);
@@ -412,7 +412,7 @@ static void BLS_Serialize_Signature_Array(benchmark::Bench& bench)
412412
CBLSSecretKey sk;
413413
sk.MakeNewKey();
414414
auto sig = sk.Sign(uint256::ONE, false);
415-
415+
416416
bench.run([&] {
417417
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
418418
ss << sig;
@@ -425,7 +425,7 @@ static void BLS_Serialize_Signature_Vector(benchmark::Bench& bench)
425425
CBLSSecretKey sk;
426426
sk.MakeNewKey();
427427
auto sig = sk.Sign(uint256::ONE, false);
428-
428+
429429
bench.run([&] {
430430
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
431431
auto vec = sig.ToByteVector(false);

src/governance/vote.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include <hash.h>
99
#include <primitives/transaction.h>
10+
#include <span.h>
1011
#include <uint256.h>
1112
#include <util/string.h>
1213

src/masternode/node.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ class CActiveMasternodeManager
6767
[[nodiscard]] bool Decrypt(const EncryptedObj<Obj>& obj, size_t idx, Obj& ret_obj, int version) const
6868
EXCLUSIVE_LOCKS_REQUIRED(!cs);
6969
[[nodiscard]] CBLSSignature Sign(const uint256& hash, const bool is_legacy) const EXCLUSIVE_LOCKS_REQUIRED(!cs);
70-
[[nodiscard]] std::array<uint8_t, BLS_CURVE_SIG_SIZE> SignBasic(const uint256& hash) const EXCLUSIVE_LOCKS_REQUIRED(!cs);
70+
[[nodiscard]] std::array<uint8_t, BLS_CURVE_SIG_SIZE> SignBasic(const uint256& hash) const
71+
EXCLUSIVE_LOCKS_REQUIRED(!cs);
7172

7273
/* TODO: Reconsider external locking */
7374
[[nodiscard]] COutPoint GetOutPoint() const { READ_LOCK(cs); return m_info.outpoint; }

src/serialize.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#include <algorithm>
1212
#include <atomic>
13+
#include <array>
1314
#include <concepts>
1415
#include <cstdint>
1516
#include <cstring>

src/test/bls_tests.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -597,14 +597,14 @@ BOOST_AUTO_TEST_CASE(bls_tobytes_vs_tobytevector_signature)
597597
{
598598
// Test that ToBytes() and ToByteVector() produce identical results for signatures
599599
bls::bls_legacy_scheme.store(false);
600-
600+
601601
CBLSSecretKey sk;
602602
sk.MakeNewKey();
603603
auto sig = sk.Sign(uint256::ONE, false);
604-
604+
605605
auto bytes_array = sig.ToBytes(false);
606606
auto bytes_vector = sig.ToByteVector(false);
607-
607+
608608
BOOST_CHECK_EQUAL(bytes_array.size(), BLS_CURVE_SIG_SIZE);
609609
BOOST_CHECK_EQUAL(bytes_vector.size(), BLS_CURVE_SIG_SIZE);
610610
BOOST_CHECK(std::equal(bytes_array.begin(), bytes_array.end(), bytes_vector.begin()));
@@ -614,14 +614,14 @@ BOOST_AUTO_TEST_CASE(bls_tobytes_vs_tobytevector_pubkey)
614614
{
615615
// Test that ToBytes() and ToByteVector() produce identical results for public keys
616616
bls::bls_legacy_scheme.store(false);
617-
617+
618618
CBLSSecretKey sk;
619619
sk.MakeNewKey();
620620
auto pk = sk.GetPublicKey();
621-
621+
622622
auto bytes_array = pk.ToBytes(false);
623623
auto bytes_vector = pk.ToByteVector(false);
624-
624+
625625
BOOST_CHECK_EQUAL(bytes_array.size(), BLS_CURVE_PUBKEY_SIZE);
626626
BOOST_CHECK_EQUAL(bytes_vector.size(), BLS_CURVE_PUBKEY_SIZE);
627627
BOOST_CHECK(std::equal(bytes_array.begin(), bytes_array.end(), bytes_vector.begin()));
@@ -631,13 +631,13 @@ BOOST_AUTO_TEST_CASE(bls_tobytes_vs_tobytevector_seckey)
631631
{
632632
// Test that ToBytes() and ToByteVector() produce identical results for secret keys
633633
bls::bls_legacy_scheme.store(false);
634-
634+
635635
CBLSSecretKey sk;
636636
sk.MakeNewKey();
637-
637+
638638
auto bytes_array = sk.ToBytes(false);
639639
auto bytes_vector = sk.ToByteVector(false);
640-
640+
641641
BOOST_CHECK_EQUAL(bytes_array.size(), BLS_CURVE_SECKEY_SIZE);
642642
BOOST_CHECK_EQUAL(bytes_vector.size(), BLS_CURVE_SECKEY_SIZE);
643643
BOOST_CHECK(std::equal(bytes_array.begin(), bytes_array.end(), bytes_vector.begin()));
@@ -647,29 +647,29 @@ BOOST_AUTO_TEST_CASE(bls_signature_array_serialization)
647647
{
648648
// Test that BLS signatures serialize correctly with std::array
649649
bls::bls_legacy_scheme.store(false);
650-
650+
651651
CBLSSecretKey sk;
652652
sk.MakeNewKey();
653653
auto sig = sk.Sign(uint256::ONE, false);
654-
654+
655655
// Serialize using standard serialization
656656
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
657657
ss << sig;
658-
658+
659659
// Deserialize
660660
CBLSSignature sig2;
661661
ss >> sig2;
662-
662+
663663
BOOST_CHECK(sig == sig2);
664-
664+
665665
// Verify the serialized size is exactly BLS_CURVE_SIG_SIZE (no size prefix)
666666
CDataStream ss2(SER_NETWORK, PROTOCOL_VERSION);
667667
ss2 << sig;
668668
BOOST_CHECK_EQUAL(ss2.size(), BLS_CURVE_SIG_SIZE);
669-
669+
670670
// Test array assignment from ToBytes
671671
std::array<uint8_t, BLS_CURVE_SIG_SIZE> sig_array = sig.ToBytes(false);
672-
672+
673673
// Construct signature from array via Span
674674
CBLSSignature sig3(Span{sig_array}, false);
675675
BOOST_CHECK(sig == sig3);

0 commit comments

Comments
 (0)