lbrycrd/test/util/data
Daniel Kraft 57889e688d bitcoin-tx: Stricter check for valid integers
Just calling atoi to convert strings to integers does not check for
valid integers very thoroughly; in particular, it just ignores
everything starting from the first non-numeral character.  Even a string
like "foo" is fine and silently returns 0.

This meant that bitcoin-tx would not fail if such a string was passed in
various places where an integer is expected (like the locktime or an
input/output index); this means that it would, for instance, silently
accept a typo and interpret it in an unexpected way.

In this change, we use ParseInt64 for parsing strings to integers,
which actually verifies that the full string is valid as number.
New tests in the bitcoin-util-test cover the new error paths.
2018-07-07 14:25:09 +02:00
..
bitcoin-util-test.json bitcoin-tx: Stricter check for valid integers 2018-07-07 14:25:09 +02:00
blanktxv1.hex Move src/test/bitcoin-util-test.py to test/util/bitcoin-util-test.py 2017-03-20 10:40:31 -04:00
blanktxv1.json Expose a transaction's weight via RPC 2018-04-13 15:18:26 -04:00
blanktxv2.hex Move src/test/bitcoin-util-test.py to test/util/bitcoin-util-test.py 2017-03-20 10:40:31 -04:00
blanktxv2.json Expose a transaction's weight via RPC 2018-04-13 15:18:26 -04:00
tt-delin1-out.hex Move src/test/bitcoin-util-test.py to test/util/bitcoin-util-test.py 2017-03-20 10:40:31 -04:00
tt-delin1-out.json Expose a transaction's weight via RPC 2018-04-13 15:18:26 -04:00
tt-delout1-out.hex Move src/test/bitcoin-util-test.py to test/util/bitcoin-util-test.py 2017-03-20 10:40:31 -04:00
tt-delout1-out.json Expose a transaction's weight via RPC 2018-04-13 15:18:26 -04:00
tt-locktime317000-out.hex Move src/test/bitcoin-util-test.py to test/util/bitcoin-util-test.py 2017-03-20 10:40:31 -04:00
tt-locktime317000-out.json Expose a transaction's weight via RPC 2018-04-13 15:18:26 -04:00
tx394b54bb.hex Move src/test/bitcoin-util-test.py to test/util/bitcoin-util-test.py 2017-03-20 10:40:31 -04:00
txcreate1.hex Move src/test/bitcoin-util-test.py to test/util/bitcoin-util-test.py 2017-03-20 10:40:31 -04:00
txcreate1.json Expose a transaction's weight via RPC 2018-04-13 15:18:26 -04:00
txcreate2.hex Move src/test/bitcoin-util-test.py to test/util/bitcoin-util-test.py 2017-03-20 10:40:31 -04:00
txcreate2.json Expose a transaction's weight via RPC 2018-04-13 15:18:26 -04:00
txcreatedata1.hex Move src/test/bitcoin-util-test.py to test/util/bitcoin-util-test.py 2017-03-20 10:40:31 -04:00
txcreatedata1.json Expose a transaction's weight via RPC 2018-04-13 15:18:26 -04:00
txcreatedata2.hex Move src/test/bitcoin-util-test.py to test/util/bitcoin-util-test.py 2017-03-20 10:40:31 -04:00
txcreatedata2.json Expose a transaction's weight via RPC 2018-04-13 15:18:26 -04:00
txcreatedata_seq0.hex Move src/test/bitcoin-util-test.py to test/util/bitcoin-util-test.py 2017-03-20 10:40:31 -04:00
txcreatedata_seq0.json Expose a transaction's weight via RPC 2018-04-13 15:18:26 -04:00
txcreatedata_seq1.hex Move src/test/bitcoin-util-test.py to test/util/bitcoin-util-test.py 2017-03-20 10:40:31 -04:00
txcreatedata_seq1.json Expose a transaction's weight via RPC 2018-04-13 15:18:26 -04:00
txcreatemultisig1.hex Move src/test/bitcoin-util-test.py to test/util/bitcoin-util-test.py 2017-03-20 10:40:31 -04:00
txcreatemultisig1.json Expose a transaction's weight via RPC 2018-04-13 15:18:26 -04:00
txcreatemultisig2.hex Move src/test/bitcoin-util-test.py to test/util/bitcoin-util-test.py 2017-03-20 10:40:31 -04:00
txcreatemultisig2.json Expose a transaction's weight via RPC 2018-04-13 15:18:26 -04:00
txcreatemultisig3.hex Move src/test/bitcoin-util-test.py to test/util/bitcoin-util-test.py 2017-03-20 10:40:31 -04:00
txcreatemultisig3.json Expose a transaction's weight via RPC 2018-04-13 15:18:26 -04:00
txcreatemultisig4.hex Move src/test/bitcoin-util-test.py to test/util/bitcoin-util-test.py 2017-03-20 10:40:31 -04:00
txcreatemultisig4.json Expose a transaction's weight via RPC 2018-04-13 15:18:26 -04:00
txcreatemultisig5.json Expose a transaction's weight via RPC 2018-04-13 15:18:26 -04:00
txcreateoutpubkey1.hex Move src/test/bitcoin-util-test.py to test/util/bitcoin-util-test.py 2017-03-20 10:40:31 -04:00
txcreateoutpubkey1.json Expose a transaction's weight via RPC 2018-04-13 15:18:26 -04:00
txcreateoutpubkey2.hex Move src/test/bitcoin-util-test.py to test/util/bitcoin-util-test.py 2017-03-20 10:40:31 -04:00
txcreateoutpubkey2.json Expose a transaction's weight via RPC 2018-04-13 15:18:26 -04:00
txcreateoutpubkey3.hex Move src/test/bitcoin-util-test.py to test/util/bitcoin-util-test.py 2017-03-20 10:40:31 -04:00
txcreateoutpubkey3.json Expose a transaction's weight via RPC 2018-04-13 15:18:26 -04:00
txcreatescript1.hex Move src/test/bitcoin-util-test.py to test/util/bitcoin-util-test.py 2017-03-20 10:40:31 -04:00
txcreatescript1.json Expose a transaction's weight via RPC 2018-04-13 15:18:26 -04:00
txcreatescript2.hex Move src/test/bitcoin-util-test.py to test/util/bitcoin-util-test.py 2017-03-20 10:40:31 -04:00
txcreatescript2.json Expose a transaction's weight via RPC 2018-04-13 15:18:26 -04:00
txcreatescript3.hex Move src/test/bitcoin-util-test.py to test/util/bitcoin-util-test.py 2017-03-20 10:40:31 -04:00
txcreatescript3.json Expose a transaction's weight via RPC 2018-04-13 15:18:26 -04:00
txcreatescript4.hex Move src/test/bitcoin-util-test.py to test/util/bitcoin-util-test.py 2017-03-20 10:40:31 -04:00
txcreatescript4.json Expose a transaction's weight via RPC 2018-04-13 15:18:26 -04:00
txcreatesignv1.hex Move src/test/bitcoin-util-test.py to test/util/bitcoin-util-test.py 2017-03-20 10:40:31 -04:00
txcreatesignv1.json Expose a transaction's weight via RPC 2018-04-13 15:18:26 -04:00
txcreatesignv2.hex Move src/test/bitcoin-util-test.py to test/util/bitcoin-util-test.py 2017-03-20 10:40:31 -04:00