diff options
author | subtly <subtly@users.noreply.github.com> | 2014-11-06 02:08:25 +0800 |
---|---|---|
committer | subtly <subtly@users.noreply.github.com> | 2014-11-06 02:08:25 +0800 |
commit | d59a648985274fa587e9f0b69f681ea240ac8d1c (patch) | |
tree | b8cfc6d31db2a7f72daddc7d7ca0827aea9f968f /crypto.cpp | |
parent | 90a0998968e88dc9fc65476c963b028c0eeaeff4 (diff) | |
parent | 7586bd27610099ebc0f7119e62d556d1db185bd6 (diff) | |
download | dexon-solidity-d59a648985274fa587e9f0b69f681ea240ac8d1c.tar dexon-solidity-d59a648985274fa587e9f0b69f681ea240ac8d1c.tar.gz dexon-solidity-d59a648985274fa587e9f0b69f681ea240ac8d1c.tar.bz2 dexon-solidity-d59a648985274fa587e9f0b69f681ea240ac8d1c.tar.lz dexon-solidity-d59a648985274fa587e9f0b69f681ea240ac8d1c.tar.xz dexon-solidity-d59a648985274fa587e9f0b69f681ea240ac8d1c.tar.zst dexon-solidity-d59a648985274fa587e9f0b69f681ea240ac8d1c.zip |
Merge branch 'develop' into crypto
Conflicts:
test/crypto.cpp
Diffstat (limited to 'crypto.cpp')
-rw-r--r-- | crypto.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -451,14 +451,14 @@ BOOST_AUTO_TEST_CASE(eth_keypairs) BOOST_REQUIRE(p.address() == Address(fromHex("8a40bfaa73256b60764c1bf40675a99083efb075"))); { eth::Transaction t(1000, 0, 0, h160(fromHex("944400f4b88ac9589a0f17ed4671da26bddb668b")), bytes(), 0, p.secret()); - auto rlp = t.rlp(false); + auto rlp = t.rlp(eth::WithoutSignature); cnote << RLP(rlp); cnote << toHex(rlp); - cnote << t.sha3(false); - rlp = t.rlp(true); + cnote << t.sha3(eth::WithoutSignature); + rlp = t.rlp(eth::WithSignature); cnote << RLP(rlp); cnote << toHex(rlp); - cnote << t.sha3(true); + cnote << t.sha3(eth::WithSignature); BOOST_REQUIRE(t.sender() == p.address()); } @@ -475,15 +475,15 @@ int cryptoTest() BOOST_REQUIRE(p.address() == Address(fromHex("8a40bfaa73256b60764c1bf40675a99083efb075"))); { eth::Transaction t(1000, 0, 0, h160(fromHex("944400f4b88ac9589a0f17ed4671da26bddb668b")), bytes(), 0, p.secret()); - auto rlp = t.rlp(false); + auto rlp = t.rlp(eth::WithoutSignature); cnote << RLP(rlp); cnote << toHex(rlp); - cnote << t.sha3(false); - rlp = t.rlp(true); + cnote << t.sha3(eth::WithoutSignature); + rlp = t.rlp(eth::WithSignature); cnote << RLP(rlp); cnote << toHex(rlp); - cnote << t.sha3(true); - BOOST_REQUIRE(t.sender() == p.address()); + cnote << t.sha3(eth::WithSignature); + assert(t.sender() == p.address()); } @@ -508,8 +508,8 @@ int cryptoTest() auto msg = t.rlp(false); cout << "TX w/o SIG: " << RLP(msg) << endl; - cout << "RLP(TX w/o SIG): " << toHex(t.rlpString(false)) << endl; - std::string hmsg = sha3(t.rlpString(false), false); + cout << "RLP(TX w/o SIG): " << toHex(t.rlp(false)) << endl; + std::string hmsg = sha3(t.rlp(false), false); cout << "SHA256(RLP(TX w/o SIG)): 0x" << toHex(hmsg) << endl; bytes privkey = sha3Bytes("123"); |