duckdb-cudasp-extension/scripts/test_false_case.sql
2025-10-28 12:14:18 +02:00

21 lines
1.4 KiB
SQL

-- Test to verify the GPU implementation can return NO MATCH
-- Use height=100 data but with WRONG scan_private_key and spend_public_key
-- This should return 0 (no match) because we're using the wrong keys
SELECT COUNT(*) FROM cudasp_scan(
(SELECT txid, height, tweak_key, outputs FROM test_data WHERE height = 100),
BLOB '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01', -- Wrong scan_private_key (just 1)
BLOB '\x79\xbe\x66\x7e\xf9\xdc\xbb\xac\x55\xa0\x62\x95\xce\x87\x0b\x07\x02\x9b\xfc\xdb\x2d\xce\x28\xd9\x59\xf2\x81\x5b\x16\xf8\x17\x98\xb8\xd4\x10\xfb\x8f\xd0\x47\x9c\x19\x54\x85\xa6\x48\xb4\x17\xfd\xa8\x08\x11\x0e\xfc\xfb\xa4\x5d\x65\xc4\xa3\x26\x77\xda\x3a\x48', -- Different spend_public_key
CAST([] AS BLOB[])
);
-- Expected: 0
-- Also test height=200 with wrong keys
SELECT COUNT(*) FROM cudasp_scan(
(SELECT txid, height, tweak_key, outputs FROM test_data WHERE height = 200),
BLOB '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01',
BLOB '\x79\xbe\x66\x7e\xf9\xdc\xbb\xac\x55\xa0\x62\x95\xce\x87\x0b\x07\x02\x9b\xfc\xdb\x2d\xce\x28\xd9\x59\xf2\x81\x5b\x16\xf8\x17\x98\xb8\xd4\x10\xfb\x8f\xd0\x47\x9c\x19\x54\x85\xa6\x48\xb4\x17\xfd\xa8\x08\x11\x0e\xfc\xfb\xa4\x5d\x65\xc4\xa3\x26\x77\xda\x3a\x48',
CAST([] AS BLOB[])
);
-- Expected: 0