mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
transaction address length test fix
This commit is contained in:
parent
078de706d2
commit
7b51526a2c
@ -21,7 +21,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "TestHelper.h"
|
#include "TestHelper.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace json_spirit;
|
using namespace json_spirit;
|
||||||
using namespace dev;
|
using namespace dev;
|
||||||
@ -152,6 +151,9 @@ void doTransactionTests(json_spirit::mValue& _v, bool _fillin)
|
|||||||
if (!txFromFields.signature().isValid())
|
if (!txFromFields.signature().isValid())
|
||||||
BOOST_THROW_EXCEPTION(Exception() << errinfo_comment("transaction from RLP signature is invalid") );
|
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());
|
o["sender"] = toString(txFromFields.sender());
|
||||||
}
|
}
|
||||||
catch(...)
|
catch(...)
|
||||||
|
@ -242,44 +242,14 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
"AddressMore20" : {
|
"WrongAddress" : {
|
||||||
"transaction" :
|
"transaction" :
|
||||||
{
|
{
|
||||||
"data" : "",
|
"data" : "",
|
||||||
"gasLimit" : "",
|
"gasLimit" : "",
|
||||||
"gasPrice" : "",
|
"gasPrice" : "",
|
||||||
"nonce" : "",
|
"nonce" : "",
|
||||||
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d871f",
|
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d8v",
|
||||||
"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",
|
|
||||||
"value" : "",
|
"value" : "",
|
||||||
"v" : "27",
|
"v" : "27",
|
||||||
"r" : "0x48b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353",
|
"r" : "0x48b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353",
|
||||||
|
Loading…
Reference in New Issue
Block a user