From 665d873883192dacd67118580ad39c1c2a463c68 Mon Sep 17 00:00:00 2001 From: Tom Trevethan Date: Thu, 27 Aug 2026 14:16:55 +0100 Subject: [PATCH 1/2] broaden the CMake guard for simplicity to also match Clang on any platform fix is_valid() in test framework for elements amounts --- src/CMakeLists.txt | 2 +- test/functional/test_framework/messages.py | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d3062f67dd..08871f28d9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -114,7 +114,7 @@ target_link_libraries(elementssimplicity ) # macOS Apple Clang is stricter than Linux GCC on this vendored code -if(APPLE) +if(CMAKE_C_COMPILER_ID MATCHES "Clang") target_compile_options(elementssimplicity PRIVATE -Wno-error=conditional-uninitialized -Wno-error=implicit-fallthrough diff --git a/test/functional/test_framework/messages.py b/test/functional/test_framework/messages.py index 370a839700..c1d21fb821 100755 --- a/test/functional/test_framework/messages.py +++ b/test/functional/test_framework/messages.py @@ -986,8 +986,14 @@ def calc_witness_hash(self): def is_valid(self): self.calc_sha256() for tout in self.vout: - if tout.nValue < 0 or tout.nValue > 21000000 * COIN: - return False + value = tout.nValue + # ELEMENTS: nValue is a CTxOutValue. Only explicit (unblinded) + # amounts can be range-checked here; confidential outputs are + # validated via rangeproofs elsewhere, not by this sanity check. + if value.vchCommitment[0] == 1: + amount = value.getAmount() + if amount < 0 or amount > 21000000 * COIN: + return False return True # Calculate the transaction weight using witness and non-witness From 176ab792eaeb9b59b6e9301a0d839c06d7b2615b Mon Sep 17 00:00:00 2001 From: Tom Trevethan Date: Thu, 27 Aug 2026 14:17:47 +0100 Subject: [PATCH 2/2] temporary comment change to test multiple commit CI --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 08871f28d9..cbc9e2f6e3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -113,7 +113,7 @@ target_link_libraries(elementssimplicity core_interface ) -# macOS Apple Clang is stricter than Linux GCC on this vendored code +# Clang is stricter than Linux GCC on this vendored code if(CMAKE_C_COMPILER_ID MATCHES "Clang") target_compile_options(elementssimplicity PRIVATE -Wno-error=conditional-uninitialized