diff options
author | winsvega <winsvega@mail.ru> | 2015-01-06 06:39:02 +0800 |
---|---|---|
committer | winsvega <winsvega@mail.ru> | 2015-01-22 17:04:58 +0800 |
commit | 91ccc1b7ab56af5ecb94b0c9741067db0e5c8443 (patch) | |
tree | 0e48f0eb5742dab13a598bed05efac40f462856a /TestHelper.cpp | |
parent | a0ecb5d4e876aeff12a58e45563f0ea39f1bdf87 (diff) | |
download | dexon-solidity-91ccc1b7ab56af5ecb94b0c9741067db0e5c8443.tar dexon-solidity-91ccc1b7ab56af5ecb94b0c9741067db0e5c8443.tar.gz dexon-solidity-91ccc1b7ab56af5ecb94b0c9741067db0e5c8443.tar.bz2 dexon-solidity-91ccc1b7ab56af5ecb94b0c9741067db0e5c8443.tar.lz dexon-solidity-91ccc1b7ab56af5ecb94b0c9741067db0e5c8443.tar.xz dexon-solidity-91ccc1b7ab56af5ecb94b0c9741067db0e5c8443.tar.zst dexon-solidity-91ccc1b7ab56af5ecb94b0c9741067db0e5c8443.zip |
Transaction Tests
transaction tests
Transaction Test Work In Progress
transaction test work in progress
work in progress. check for transaction is valid
Transaction Tests Work In Progress
compiler error fix
Diffstat (limited to 'TestHelper.cpp')
-rw-r--r-- | TestHelper.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/TestHelper.cpp b/TestHelper.cpp index ea848c7c..1b854162 100644 --- a/TestHelper.cpp +++ b/TestHelper.cpp @@ -228,14 +228,21 @@ byte toByte(json_spirit::mValue const& _v) return 0; } +bytes importByteArray(const std::string& str) +{ + bytes data; + if (str.find_first_of("0x") == 0) + data = fromHex(str.substr(2)); + else + data = fromHex(str); + return data; +} + bytes importData(json_spirit::mObject& _o) { bytes data; if (_o["data"].type() == json_spirit::str_type) - if (_o["data"].get_str().find_first_of("0x") == 0) - data = fromHex(_o["data"].get_str().substr(2)); - else - data = fromHex(_o["data"].get_str()); + data = importByteArray(_o["data"].get_str()); else for (auto const& j: _o["data"].get_array()) data.push_back(toByte(j)); |