[64-bit ints] Change CScriptNum::getint to return int64_t
Summary:
As part of the effort to upgrade Script integers to 64-bits, we upgrade the code to handle CScriptNum::getint to return int64_t.
There's only a few usages of that function anyway:
- In core_write.cpp, to write script assembly, and tinyformat can handle int64_t for %d
- In interpreter.cpp, to convert to integers (e.g. for OP_ROLL). Here we're just careful to avoid overflows.
- In scriptnum_tests.cpp, to compare to ScriptNum10. This test is now remarkably outdated (almost 9 years, looking at the copyright?), and doesn't really test something we worry about anymore. Instead, we remove CScriptNum10 and change the tests to actually test the behavior of CScriptNum.
(NB: BCH added getint32 and getint64 for the same change, but this is unnecessary and it's cleaner to just stick to one function)
Depends on D17290.
Test Plan: ninja check
Reviewers: Fabien, #bitcoin_abc
Reviewed By: Fabien, #bitcoin_abc
Differential Revision: https://reviews.bitcoinabc.org/D16996