Commit graph

12 commits

Author SHA1 Message Date
Jonas Schnelli
9623e93473 [Univalue] add univalue over subtree
similar to secp256k1 include and compile univalue over a subtree
2015-10-01 10:49:57 +02:00
Daniel Kraft
e938122b7b Stop parsing JSON after first finished construct.
Fix https://github.com/bitcoin/bitcoin/issues/6558.  In particular, stop
parsing JSON after the first object or array is finished.  Check that no
other garbage follows, and fail the parser if it does.
2015-08-20 12:48:43 +02:00
Wladimir J. van der Laan
7650449a67 univalue: Avoid unnecessary roundtrip through double for numbers
JSON makes no distinction between numbers and reals, and our code
doesn't need to do so either.

This removes VREAL, as well as its specific post-processing in
`UniValue::write`. Non-monetary amounts do not need to be forcibly
formatted with 8 decimals, so the extra roundtrip was unnecessary
(and potentially loses precision).
2015-07-18 09:04:18 +02:00
Jonas Schnelli
77aeb7c964 UniValue: don't escape solidus, keep espacing of reverse solidus 2015-06-25 08:10:08 +02:00
Daniel Kraft
0cc7b2352e Fix univalue handling of \u0000 characters.
Univalue's parsing of \u escape sequences did not handle NUL characters
correctly.  They were, effectively, dropped.  The extended test-case
fails with the old code, and is fixed with this patch.
2015-06-11 12:09:05 +02:00
Jonas Schnelli
44c7474446 univalue: add type check unit tests 2015-06-04 13:58:14 +02:00
Jonas Schnelli
0c5b2cf69a univalue: add support for real, fix percision and make it json_spirit compatible
- avoid breaking the API because of different number/percision handling
2015-06-04 09:16:06 +02:00
Jeff Garzik
efc7883772 UniValue: prefer .size() to .count(), to harmonize w/ existing tree 2015-06-04 09:16:05 +02:00
Wladimir J. van der Laan
92fd887fd4 tests: add a BasicTestingSetup and apply to all tests
Make sure that chainparams and logging is properly initialized. Doing
this for every test may be overkill, but this initialization is so
simple that that does not matter.

This should fix the travis issues.
2015-03-12 09:45:22 +01:00
Michael Ford
78253fcbad Remove references to X11 licence 2014-12-16 15:56:50 +08:00
Jeff Garzik
dc271fc025 UniValue tests: use more BOOST_CHECK() 2014-08-20 01:09:21 -04:00
Jeff Garzik
e85267be63 UniValue: add unit tests 2014-08-20 00:28:46 -04:00