Skip to content

Commit 0d2fa14

Browse files
jtimonlaanwj
authored andcommitted
Move scriptutils.o to wallet
1 parent 6a8d15c commit 0d2fa14

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

src/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ libbitcoin_wallet_a_SOURCES = \
173173
crypter.cpp \
174174
rpcdump.cpp \
175175
rpcwallet.cpp \
176+
scriptutils.cpp \
176177
wallet.cpp \
177178
walletdb.cpp \
178179
$(BITCOIN_CORE_H)
@@ -216,7 +217,6 @@ libbitcoin_common_a_SOURCES = \
216217
script/script.cpp \
217218
script/sign.cpp \
218219
script/standard.cpp \
219-
scriptutils.cpp \
220220
$(BITCOIN_CORE_H)
221221

222222
# util: shared between all executables.

src/test/multisig_tests.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@
88
#include "script/script.h"
99
#include "script/interpreter.h"
1010
#include "script/sign.h"
11-
#include "scriptutils.h"
1211
#include "uint256.h"
1312

13+
#ifdef ENABLE_WALLET
14+
#include "scriptutils.h"
15+
#endif
16+
1417
#include <boost/assign/std/vector.hpp>
1518
#include <boost/foreach.hpp>
1619
#include <boost/test/unit_test.hpp>
@@ -195,8 +198,10 @@ BOOST_AUTO_TEST_CASE(multisig_Solver1)
195198
CTxDestination addr;
196199
BOOST_CHECK(ExtractDestination(s, addr));
197200
BOOST_CHECK(addr == keyaddr[0]);
201+
#ifdef ENABLE_WALLET
198202
BOOST_CHECK(IsMine(keystore, s));
199203
BOOST_CHECK(!IsMine(emptykeystore, s));
204+
#endif
200205
}
201206
{
202207
vector<valtype> solutions;
@@ -208,8 +213,10 @@ BOOST_AUTO_TEST_CASE(multisig_Solver1)
208213
CTxDestination addr;
209214
BOOST_CHECK(ExtractDestination(s, addr));
210215
BOOST_CHECK(addr == keyaddr[0]);
216+
#ifdef ENABLE_WALLET
211217
BOOST_CHECK(IsMine(keystore, s));
212218
BOOST_CHECK(!IsMine(emptykeystore, s));
219+
#endif
213220
}
214221
{
215222
vector<valtype> solutions;
@@ -220,9 +227,11 @@ BOOST_AUTO_TEST_CASE(multisig_Solver1)
220227
BOOST_CHECK_EQUAL(solutions.size(), 4U);
221228
CTxDestination addr;
222229
BOOST_CHECK(!ExtractDestination(s, addr));
230+
#ifdef ENABLE_WALLET
223231
BOOST_CHECK(IsMine(keystore, s));
224232
BOOST_CHECK(!IsMine(emptykeystore, s));
225233
BOOST_CHECK(!IsMine(partialkeystore, s));
234+
#endif
226235
}
227236
{
228237
vector<valtype> solutions;
@@ -237,9 +246,11 @@ BOOST_AUTO_TEST_CASE(multisig_Solver1)
237246
BOOST_CHECK(addrs[0] == keyaddr[0]);
238247
BOOST_CHECK(addrs[1] == keyaddr[1]);
239248
BOOST_CHECK(nRequired == 1);
249+
#ifdef ENABLE_WALLET
240250
BOOST_CHECK(IsMine(keystore, s));
241251
BOOST_CHECK(!IsMine(emptykeystore, s));
242252
BOOST_CHECK(!IsMine(partialkeystore, s));
253+
#endif
243254
}
244255
{
245256
vector<valtype> solutions;

src/test/script_P2SH_tests.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
#include "main.h"
88
#include "script/script.h"
99
#include "script/sign.h"
10+
11+
#ifdef ENABLE_WALLET
1012
#include "scriptutils.h"
13+
#endif
1114

1215
#include <vector>
1316

@@ -95,7 +98,9 @@ BOOST_AUTO_TEST_CASE(sign)
9598
txTo[i].vin[0].prevout.n = i;
9699
txTo[i].vin[0].prevout.hash = txFrom.GetHash();
97100
txTo[i].vout[0].nValue = 1;
101+
#ifdef ENABLE_WALLET
98102
BOOST_CHECK_MESSAGE(IsMine(keystore, txFrom.vout[i].scriptPubKey), strprintf("IsMine %d", i));
103+
#endif
99104
}
100105
for (int i = 0; i < 8; i++)
101106
{
@@ -189,7 +194,9 @@ BOOST_AUTO_TEST_CASE(set)
189194
txTo[i].vin[0].prevout.hash = txFrom.GetHash();
190195
txTo[i].vout[0].nValue = 1*CENT;
191196
txTo[i].vout[0].scriptPubKey = inner[i];
197+
#ifdef ENABLE_WALLET
192198
BOOST_CHECK_MESSAGE(IsMine(keystore, txFrom.vout[i].scriptPubKey), strprintf("IsMine %d", i));
199+
#endif
193200
}
194201
for (int i = 0; i < 4; i++)
195202
{

0 commit comments

Comments
 (0)