fixed segfaults on accessing temp objects vector buffers

This commit is contained in:
Arkady Paronyan 2014-10-03 17:53:04 +04:00
parent 5e6121d3fe
commit 77598cc3f0

View File

@ -46,12 +46,14 @@ BOOST_AUTO_TEST_CASE(crypto_tests)
t.nonce = 0; t.nonce = 0;
t.receiveAddress = h160(fromHex("944400f4b88ac9589a0f17ed4671da26bddb668b")); t.receiveAddress = h160(fromHex("944400f4b88ac9589a0f17ed4671da26bddb668b"));
t.value = 1000; t.value = 1000;
cnote << RLP(t.rlp(false)); auto rlp = t.rlp(false);
cnote << toHex(t.rlp(false)); cnote << RLP(rlp);
cnote << toHex(rlp);
cnote << t.sha3(false); cnote << t.sha3(false);
t.sign(p.secret()); t.sign(p.secret());
cnote << RLP(t.rlp(true)); rlp = t.rlp(true);
cnote << toHex(t.rlp(true)); cnote << RLP(rlp);
cnote << toHex(rlp);
cnote << t.sha3(true); cnote << t.sha3(true);
BOOST_REQUIRE(t.sender() == p.address()); BOOST_REQUIRE(t.sender() == p.address());
} }
@ -72,12 +74,14 @@ int cryptoTest()
t.nonce = 0; t.nonce = 0;
t.receiveAddress = h160(fromHex("944400f4b88ac9589a0f17ed4671da26bddb668b")); t.receiveAddress = h160(fromHex("944400f4b88ac9589a0f17ed4671da26bddb668b"));
t.value = 1000; t.value = 1000;
cnote << RLP(t.rlp(false)); auto rlp = t.rlp(false);
cnote << toHex(t.rlp(false)); cnote << RLP(rlp);
cnote << toHex(rlp);
cnote << t.sha3(false); cnote << t.sha3(false);
t.sign(p.secret()); t.sign(p.secret());
cnote << RLP(t.rlp(true)); rlp = t.rlp(true);
cnote << toHex(t.rlp(true)); cnote << RLP(rlp);
cnote << toHex(rlp);
cnote << t.sha3(true); cnote << t.sha3(true);
assert(t.sender() == p.address()); assert(t.sender() == p.address());
} }