From 557d5807d802e4d0d5c7abc60fa4f9c32152ad84 Mon Sep 17 00:00:00 2001 From: Sami Ahmed Date: Sat, 4 Apr 2026 00:24:23 -0700 Subject: [PATCH] Fix CI: update transaction_tests for UTXO model, fix inetc plugin install - transaction_tests.cpp: use COutPoint+CUtxoEntry instead of old MapPrevTx - build-all.yml: use msys2 shell for inetc plugin download/install Co-Authored-By: Claude Opus 4.6 --- .github/workflows/build-all.yml | 21 ++++++++++++++++----- src/test/transaction_tests.cpp | 30 ++++++++++++++++++++++++++++-- 2 files changed, 44 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-all.yml b/.github/workflows/build-all.yml index c9824de..224d50e 100644 --- a/.github/workflows/build-all.yml +++ b/.github/workflows/build-all.yml @@ -165,12 +165,23 @@ jobs: run: pacman -S --noconfirm mingw-w64-x86_64-nsis - name: Install NSIS inetc plugin - shell: pwsh run: | - $nsisDir = (msys2 -c "cygpath -w /mingw64/share/nsis") - Invoke-WebRequest -Uri "https://nsis.sourceforge.io/mediawiki/images/c/c9/Inetc.zip" -OutFile "$env:TEMP\Inetc.zip" - Expand-Archive "$env:TEMP\Inetc.zip" -DestinationPath "$env:TEMP\inetc" - Copy-Item "$env:TEMP\inetc\Plugins\x86-unicode\INetC.dll" "$nsisDir\Plugins\unicode\" -Force + NSIS_DIR="/mingw64/share/nsis" + cd /tmp + curl -L -o Inetc.zip "https://nsis.sourceforge.io/mediawiki/images/c/c9/Inetc.zip" + unzip -o Inetc.zip -d inetc_extract + # Try both common directory layouts in the zip + if [ -f "inetc_extract/Plugins/x86-unicode/INetC.dll" ]; then + cp inetc_extract/Plugins/x86-unicode/INetC.dll "$NSIS_DIR/Plugins/unicode/" + elif [ -f "inetc_extract/Plugins/unicode/INetC.dll" ]; then + cp inetc_extract/Plugins/unicode/INetC.dll "$NSIS_DIR/Plugins/unicode/" + else + echo "=== inetc zip contents ===" + find inetc_extract -name "*.dll" -o -name "*.DLL" | head -20 + echo "=== Trying any INetC.dll found ===" + find inetc_extract -iname "inetc.dll" -exec cp {} "$NSIS_DIR/Plugins/unicode/" \; + fi + ls -la "$NSIS_DIR/Plugins/unicode/" | grep -i inet || echo "WARNING: INetC.dll not found after install" - name: Build NSIS installer run: makensis //DVERSION=$VERSION contrib/nsis/setup.nsi diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp index 2637e65..24a8665 100644 --- a/src/test/transaction_tests.cpp +++ b/src/test/transaction_tests.cpp @@ -61,14 +61,40 @@ SetupDummyInputs(CBasicKeyStore& keystoreRet, MapPrevTx& inputsRet) dummyTransactions[0].vout[0].scriptPubKey << key[0].GetPubKey() << OP_CHECKSIG; dummyTransactions[0].vout[1].nValue = 50*CENT; dummyTransactions[0].vout[1].scriptPubKey << key[1].GetPubKey() << OP_CHECKSIG; - inputsRet[dummyTransactions[0].GetHash()] = make_pair(CTxIndex(), dummyTransactions[0]); + { + uint256 hash0 = dummyTransactions[0].GetHash(); + for (unsigned int i = 0; i < dummyTransactions[0].vout.size(); i++) + { + CUtxoEntry entry; + entry.nValue = dummyTransactions[0].vout[i].nValue; + entry.nHeight = 1; + entry.scriptPubKey = dummyTransactions[0].vout[i].scriptPubKey; + entry.fCoinBase = false; + entry.fCoinStake = false; + entry.nTxTime = 0; + inputsRet[COutPoint(hash0, i)] = entry; + } + } dummyTransactions[1].vout.resize(2); dummyTransactions[1].vout[0].nValue = 21*CENT; dummyTransactions[1].vout[0].scriptPubKey.SetDestination(key[2].GetPubKey().GetID()); dummyTransactions[1].vout[1].nValue = 22*CENT; dummyTransactions[1].vout[1].scriptPubKey.SetDestination(key[3].GetPubKey().GetID()); - inputsRet[dummyTransactions[1].GetHash()] = make_pair(CTxIndex(), dummyTransactions[1]); + { + uint256 hash1 = dummyTransactions[1].GetHash(); + for (unsigned int i = 0; i < dummyTransactions[1].vout.size(); i++) + { + CUtxoEntry entry; + entry.nValue = dummyTransactions[1].vout[i].nValue; + entry.nHeight = 1; + entry.scriptPubKey = dummyTransactions[1].vout[i].scriptPubKey; + entry.fCoinBase = false; + entry.fCoinStake = false; + entry.nTxTime = 0; + inputsRet[COutPoint(hash1, i)] = entry; + } + } return dummyTransactions; }