Skip to content

Commit fa655da

Browse files
author
MarcoFalke
committed
test: [refactor] Use ToIntegral in CheckInferDescriptor
1 parent fa55dd0 commit fa655da

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/test/descriptor_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <script/descriptor.h>
77
#include <script/sign.h>
88
#include <test/util/setup_common.h>
9+
#include <util/check.h>
910
#include <util/strencodings.h>
1011
#include <util/string.h>
1112

@@ -496,8 +497,7 @@ void CheckInferDescriptor(const std::string& script_hex, const std::string& expe
496497
hardened = true;
497498
}
498499
}
499-
uint32_t p;
500-
assert(ParseUInt32(std::string(elem.begin(), elem.end()), &p));
500+
const uint32_t p{*Assert(ToIntegral<uint32_t>(std::string_view{elem.begin(), elem.end()}))};
501501
info.path.push_back(p | (((uint32_t)hardened) << 31));
502502
}
503503

0 commit comments

Comments
 (0)