File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66#define BITCOIN_QML_MODELS_BANLISTMODEL_H
77
88#include < net_types.h>
9+ #include < netaddress.h>
910
1011#include < QAbstractListModel>
1112#include < QList>
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ target_include_directories(bitcoinqml_unit_tests
3535 PRIVATE
3636 ${CMAKE_CURRENT_SOURCE_DIR } /..
3737 ${CMAKE_CURRENT_SOURCE_DIR } /../bitcoin/src
38+ ${CMAKE_CURRENT_SOURCE_DIR } /../bitcoin/src/univalue/include
3839)
3940
4041target_link_libraries (bitcoinqml_unit_tests
Original file line number Diff line number Diff line change 66
77#include < QSet>
88
9- #include < qml/models/banlistmodel.h>
109#include < test/mocks/mocknode.h>
10+ #include < qml/models/banlistmodel.h>
1111#include < util/translation.h>
1212
13- #include < gmock/gmock.h>
1413#include < netbase.h>
1514
1615#include < map>
17- #include < optional>
1816#include < stdexcept>
1917#include < utility>
2018
@@ -23,11 +21,11 @@ const TranslateFn G_TRANSLATION_FUN{nullptr};
2321namespace {
2422CSubNet ParseSubnet (const std::string& subnet)
2523{
26- const std::optional< CSubNet> parsed = LookupSubNet (subnet, /* allow_lookup= */ false );
27- if (!parsed.has_value ()) {
24+ CSubNet parsed = LookupSubNet (subnet);
25+ if (!parsed.IsValid ()) {
2826 throw std::runtime_error (" failed to parse subnet test fixture" );
2927 }
30- return * parsed;
28+ return parsed;
3129}
3230
3331CBanEntry MakeBanEntry (int64_t ban_until)
You can’t perform that action at this time.
0 commit comments