From 35c4a2c823a9f34b80759e3eecc14c219d4d9e01 Mon Sep 17 00:00:00 2001 From: Sami Ahmed Date: Fri, 3 Apr 2026 22:21:02 -0700 Subject: [PATCH] Fix CI: update test for UTXO model, remove bootstrap from installer - Update script_P2SH_tests.cpp to use new MapPrevTx (COutPoint->CUtxoEntry) - Remove obsolete bootstrap download from NSIS installer (requires inetc plugin; nodes now sync fast from network) Co-Authored-By: Claude Opus 4.6 --- contrib/nsis/setup.nsi | 50 ---------------------------------- src/test/script_P2SH_tests.cpp | 16 +++++++++-- 2 files changed, 14 insertions(+), 52 deletions(-) diff --git a/contrib/nsis/setup.nsi b/contrib/nsis/setup.nsi index fc24283..51ded57 100644 --- a/contrib/nsis/setup.nsi +++ b/contrib/nsis/setup.nsi @@ -32,9 +32,6 @@ RequestExecutionLevel user !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_DIRECTORY -; Bootstrap page -Page custom BootstrapPage - !insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_PAGE_FINISH @@ -43,34 +40,6 @@ Page custom BootstrapPage !insertmacro MUI_LANGUAGE "English" -; Bootstrap selection variable -Var BootstrapChoice - -; Bootstrap page function -Function BootstrapPage - !insertmacro MUI_HEADER_TEXT "Blockchain Sync" "Choose how to synchronize the blockchain" - - nsDialogs::Create 1018 - Pop $0 - - ${NSD_CreateLabel} 0 10u 100% 20u "The Triangles blockchain requires ~1GB of data. Choose sync method:" - Pop $0 - - ${NSD_CreateRadioButton} 10u 40u 100% 12u "Download bootstrap (~1.3GB) — Recommended (fast)" - Pop $1 - ${NSD_Check} $1 - - ${NSD_CreateRadioButton} 10u 60u 100% 12u "Sync from network — Slow (may take days)" - Pop $2 - - ${NSD_CreateLabel} 10u 80u 100% 30u "Bootstrap will download a recent blockchain snapshot, saving hours or days of sync time. Network bandwidth required: ~1.3GB." - Pop $0 - - nsDialogs::Show - - ${NSD_GetState} $1 $BootstrapChoice -FunctionEnd - Section "Install" SetOutPath "$INSTDIR" @@ -84,25 +53,6 @@ Section "Install" ; Create data directory CreateDirectory "$APPDATA\Triangles" - ; Download blockchain bootstrap if selected - ${If} $BootstrapChoice == ${BST_CHECKED} - DetailPrint "Downloading blockchain bootstrap..." - inetc::get /CAPTION "Downloading Blockchain" /CANCELTEXT "Skip" \ - "http://bootstrap.cryptographic-triangles.org/tri-blockchain.tar.gz" \ - "$TEMP\tri-blockchain.tar.gz" /END - Pop $0 - ${If} $0 == "OK" - DetailPrint "Extracting blockchain..." - nsExec::ExecToLog '"$INSTDIR\7z.exe" x "$TEMP\tri-blockchain.tar.gz" -o"$TEMP" -y' - nsExec::ExecToLog '"$INSTDIR\7z.exe" x "$TEMP\tri-blockchain.tar" -o"$APPDATA\Triangles" -y' - Delete "$TEMP\tri-blockchain.tar.gz" - Delete "$TEMP\tri-blockchain.tar" - DetailPrint "Blockchain bootstrap installed!" - ${Else} - DetailPrint "Bootstrap download failed or skipped — will sync from network" - ${EndIf} - ${EndIf} - ; Uninstaller WriteUninstaller "$INSTDIR\uninstall.exe" diff --git a/src/test/script_P2SH_tests.cpp b/src/test/script_P2SH_tests.cpp index 1faf9df..0f0bc41 100644 --- a/src/test/script_P2SH_tests.cpp +++ b/src/test/script_P2SH_tests.cpp @@ -236,7 +236,7 @@ BOOST_AUTO_TEST_CASE(switchover) BOOST_AUTO_TEST_CASE(AreInputsStandard) { - std::map > mapInputs; + MapPrevTx mapInputs; CBasicKeyStore keystore; CKey key[3]; vector keys; @@ -273,7 +273,19 @@ BOOST_AUTO_TEST_CASE(AreInputsStandard) oneOfEleven << OP_11 << OP_CHECKMULTISIG; txFrom.vout[5].scriptPubKey.SetDestination(oneOfEleven.GetID()); - mapInputs[txFrom.GetHash()] = make_pair(CTxIndex(), txFrom); + // Populate UTXO entries for each output of txFrom + uint256 hashFrom = txFrom.GetHash(); + for (unsigned int i = 0; i < txFrom.vout.size(); i++) + { + CUtxoEntry entry; + entry.nValue = txFrom.vout[i].nValue; + entry.nHeight = 1; + entry.scriptPubKey = txFrom.vout[i].scriptPubKey; + entry.fCoinBase = false; + entry.fCoinStake = false; + entry.nTxTime = 0; + mapInputs[COutPoint(hashFrom, i)] = entry; + } CTransaction txTo; txTo.vout.resize(1);