aboutsummaryrefslogtreecommitdiffstats
path: root/crypto.cpp
diff options
context:
space:
mode:
authorArkady Paronyan <arkady@comindware.com>2014-10-03 21:53:04 +0800
committerArkady Paronyan <arkady@comindware.com>2014-10-03 21:53:04 +0800
commit77598cc3f09656c6ae037325aa3a0d04bb8eefbf (patch)
treecd7506529e6125aa1fa07c33dcb049c74b157453 /crypto.cpp
parent5e6121d3fe27ca9c93b99e5fa43a0e4a6465860c (diff)
downloaddexon-solidity-77598cc3f09656c6ae037325aa3a0d04bb8eefbf.tar
dexon-solidity-77598cc3f09656c6ae037325aa3a0d04bb8eefbf.tar.gz
dexon-solidity-77598cc3f09656c6ae037325aa3a0d04bb8eefbf.tar.bz2
dexon-solidity-77598cc3f09656c6ae037325aa3a0d04bb8eefbf.tar.lz
dexon-solidity-77598cc3f09656c6ae037325aa3a0d04bb8eefbf.tar.xz
dexon-solidity-77598cc3f09656c6ae037325aa3a0d04bb8eefbf.tar.zst
dexon-solidity-77598cc3f09656c6ae037325aa3a0d04bb8eefbf.zip
fixed segfaults on accessing temp objects vector buffers
Diffstat (limited to 'crypto.cpp')
-rw-r--r--crypto.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/crypto.cpp b/crypto.cpp
index d2943984..55feb1a5 100644
--- a/crypto.cpp
+++ b/crypto.cpp
@@ -46,12 +46,14 @@ BOOST_AUTO_TEST_CASE(crypto_tests)
t.nonce = 0;
t.receiveAddress = h160(fromHex("944400f4b88ac9589a0f17ed4671da26bddb668b"));
t.value = 1000;
- cnote << RLP(t.rlp(false));
- cnote << toHex(t.rlp(false));
+ auto rlp = t.rlp(false);
+ cnote << RLP(rlp);
+ cnote << toHex(rlp);
cnote << t.sha3(false);
t.sign(p.secret());
- cnote << RLP(t.rlp(true));
- cnote << toHex(t.rlp(true));
+ rlp = t.rlp(true);
+ cnote << RLP(rlp);
+ cnote << toHex(rlp);
cnote << t.sha3(true);
BOOST_REQUIRE(t.sender() == p.address());
}
@@ -72,12 +74,14 @@ int cryptoTest()
t.nonce = 0;
t.receiveAddress = h160(fromHex("944400f4b88ac9589a0f17ed4671da26bddb668b"));
t.value = 1000;
- cnote << RLP(t.rlp(false));
- cnote << toHex(t.rlp(false));
+ auto rlp = t.rlp(false);
+ cnote << RLP(rlp);
+ cnote << toHex(rlp);
cnote << t.sha3(false);
t.sign(p.secret());
- cnote << RLP(t.rlp(true));
- cnote << toHex(t.rlp(true));
+ rlp = t.rlp(true);
+ cnote << RLP(rlp);
+ cnote << toHex(rlp);
cnote << t.sha3(true);
assert(t.sender() == p.address());
}