aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--transaction.cpp4
-rw-r--r--ttTransactionTestFiller.json34
2 files changed, 5 insertions, 33 deletions
diff --git a/transaction.cpp b/transaction.cpp
index e1e27530..8c2e99cf 100644
--- a/transaction.cpp
+++ b/transaction.cpp
@@ -21,7 +21,6 @@
*/
#include "TestHelper.h"
-
using namespace std;
using namespace json_spirit;
using namespace dev;
@@ -152,6 +151,9 @@ void doTransactionTests(json_spirit::mValue& _v, bool _fillin)
if (!txFromFields.signature().isValid())
BOOST_THROW_EXCEPTION(Exception() << errinfo_comment("transaction from RLP signature is invalid") );
+ //cause Address is length20 array, when trying to create address from sting of another length, field "to" would be diffrent from RLP encoded Address
+ BOOST_CHECK_MESSAGE(Address(tObj["to"].get_str()) == txFromFields.receiveAddress(), "seems that transaction 'to' address has wrong format");
+
o["sender"] = toString(txFromFields.sender());
}
catch(...)
diff --git a/ttTransactionTestFiller.json b/ttTransactionTestFiller.json
index 3c39b9da..6967f428 100644
--- a/ttTransactionTestFiller.json
+++ b/ttTransactionTestFiller.json
@@ -242,44 +242,14 @@
}
},
- "AddressMore20" : {
+ "WrongAddress" : {
"transaction" :
{
"data" : "",
"gasLimit" : "",
"gasPrice" : "",
"nonce" : "",
- "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d871f",
- "value" : "",
- "v" : "27",
- "r" : "0x48b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353",
- "s" : "0xefffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804"
- }
- },
-
- "AddressLess20" : {
- "transaction" :
- {
- "data" : "",
- "gasLimit" : "",
- "gasPrice" : "",
- "nonce" : "",
- "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d",
- "value" : "",
- "v" : "27",
- "r" : "0x48b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353",
- "s" : "0xefffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804"
- }
- },
-
- "AddressMore20WithFirstZeros" : {
- "transaction" :
- {
- "data" : "",
- "gasLimit" : "",
- "gasPrice" : "",
- "nonce" : "",
- "to" : "0x00000000000000000000000095e7baea6a6c7c4c2dfeb977efac326af552d",
+ "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d8v",
"value" : "",
"v" : "27",
"r" : "0x48b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353",