Skip to content

Commit 6441c77

Browse files
committed
Merge bitcoin/bitcoin#30687: test: replace deprecated secp256k1 context flags usage
60055f1 test: replace deprecated secp256k1 context flags usage (Sebastian Falbesoner) Pull request description: The flags `SECP256K1_CONTEXT_{SIGN,VERIFY}` have been marked as deprecated since libsecp256k1 version 0.2 (released in December 2022), with the recommendation to use SECP256K1_CONTEXT_NONE instead, see bitcoin-core/secp256k1#1126 and https://github.com/bitcoin-core/secp256k1/blob/1988855079fa8161521b86515e77965120fdc734/CHANGELOG.md?plain=1#L132. Note that in contrast to other deprecated functions/variables, these defines don't have a deprecated attribute and hence don't lead to a compiler warning (see bitcoin-core/secp256k1#1126 (comment)), so they are not easily detected. ACKs for top commit: TheCharlatan: ACK 60055f1 ismaelsadeeq: utACK 60055f1 tdb3: light CR and test ACK 60055f1 Tree-SHA512: d93cf49e018a58469620c0d2f50242141f22dabc70afb2a7cd64e416f4f55588714510ae5a877376dd1e6b6f7494261969489af4b18a1c9dff0d0dfdf93f1fa8
2 parents d54fbc8 + 60055f1 commit 6441c77

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/test/fuzz/secp256k1_ec_seckey_import_export_der.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ int ec_seckey_export_der(const secp256k1_context* ctx, unsigned char* seckey, si
1717
FUZZ_TARGET(secp256k1_ec_seckey_import_export_der)
1818
{
1919
FuzzedDataProvider fuzzed_data_provider{buffer.data(), buffer.size()};
20-
secp256k1_context* secp256k1_context_sign = secp256k1_context_create(SECP256K1_CONTEXT_SIGN);
20+
secp256k1_context* secp256k1_context_sign = secp256k1_context_create(SECP256K1_CONTEXT_NONE);
2121
{
2222
std::vector<uint8_t> out32(32);
2323
(void)ec_seckey_import_der(secp256k1_context_sign, out32.data(), ConsumeFixedLengthByteVector(fuzzed_data_provider, CKey::SIZE).data(), CKey::SIZE);

src/test/key_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ BOOST_AUTO_TEST_CASE(bip341_test_h)
362362
BOOST_AUTO_TEST_CASE(key_schnorr_tweak_smoke_test)
363363
{
364364
// Sanity check to ensure we get the same tweak using CPubKey vs secp256k1 functions
365-
secp256k1_context* secp256k1_context_sign = secp256k1_context_create(SECP256K1_CONTEXT_SIGN);
365+
secp256k1_context* secp256k1_context_sign = secp256k1_context_create(SECP256K1_CONTEXT_NONE);
366366

367367
CKey key;
368368
key.MakeNewKey(true);

0 commit comments

Comments
 (0)