diff options
-rw-r--r-- | main.cpp | 10 | ||||
-rw-r--r-- | rlp.cpp | 6 |
2 files changed, 8 insertions, 8 deletions
@@ -35,19 +35,19 @@ using namespace eth; int main(int argc, char** argv) { - RLPStream s; +/* RLPStream s; BlockInfo::genesis().fillStream(s, false); std::cout << RLP(s.out()) << std::endl; std::cout << asHex(s.out()) << std::endl; - std::cout << sha3(s.out()) << std::endl; + std::cout << sha3(s.out()) << std::endl;*/ -// hexPrefixTest(); -// rlpTest(); + hexPrefixTest(); + rlpTest(); trieTest(); // daggerTest(); // cryptoTest(); // stateTest(); - peerTest(argc, argv); +// peerTest(argc, argv); return 0; } @@ -35,12 +35,12 @@ int rlpTest() assert(asString(rlp("dog")) == "\x83""dog"); // 2-item list - string twoItemListString = "\xc2\x0f\x83""dog"; + string twoItemListString = "\xc5\x0f\x83""dog"; RLP twoItemList(twoItemListString); assert(twoItemList.itemCount() == 2); assert(twoItemList[0] == 15); assert(twoItemList[1] == "dog"); - assert(asString(rlpList(15, "dog")) == "\xc2\x0f\x83""dog"); + assert(asString(rlpList(15, "dog")) == "\xc5\x0f\x83""dog"); // null assert(RLP("\x80") == ""); @@ -56,7 +56,7 @@ int rlpTest() // 32-byte (256-bit) int assert(RLP("\xa0\x10\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f") == bigint("0x100102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f")); - assert(asString(rlp(bigint("0x100102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f"))) == "\x37\x10\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"); + assert(asString(rlp(bigint("0x100102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f"))) == "\xa0\x10\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"); // 56-character string. assert(RLP("\xb8\x38""Lorem ipsum dolor sit amet, consectetur adipisicing elit") == "Lorem ipsum dolor sit amet, consectetur adipisicing elit"); |