From a1050d539a1fa7c94271808e343d574756893ef9 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Tue, 24 Dec 2013 13:39:45 +0000 Subject: [PATCH] Bug fixes. --- main.cpp | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index a70daf96e..a9b54c678 100644 --- a/main.cpp +++ b/main.cpp @@ -182,7 +182,7 @@ std::ostream& operator<<(std::ostream& _out, RLP _d) int j = 0; for (auto i: _d.toList()) _out << (j++ ? ", " : " ") << i; - _out << "]"; + _out << " ]"; } return _out; @@ -192,7 +192,36 @@ using namespace std; int main() { - cout << "Hello World!" << endl; + { + string t = "\x0f"; + cout << RLP(Bytes((byte*)t.data(), t.size())) << endl; + // 15 + } + { + string t = "\x43""dog"; + cout << RLP(Bytes((byte*)t.data(), t.size())) << endl; + // "dog" + } + { + string t = "\x82\x0f\x43""dog"; + cout << RLP(Bytes((byte*)t.data(), t.size())) << endl; + // [ 15, "dog" ] + } + { + string t = "\x20\x45"; + cout << RLP(Bytes((byte*)t.data(), t.size())) << endl; + // 69 + } + { + string t = "\x21\x2a\x45"; + cout << RLP(Bytes((byte*)t.data(), t.size())) << endl; + // 10821 + } + { + string t = "\x7838""Lorem ipsum dolor sit amet, consectetur adipisicing elit"; + cout << RLP(Bytes((byte*)t.data(), t.size())) << endl; + // "Lorem ipsum dolor sit amet, consectetur adipisicing elit" + } return 0; }