Fixes end-to-end tests.

This commit is contained in:
Erik Kundt 2018-07-16 12:23:06 +02:00
parent 70c58b4886
commit ed2aa3b869
4 changed files with 16 additions and 16 deletions

View File

@ -385,7 +385,7 @@ contract Wallet is multisig, multiowned, daylimit {
emit Deposit(msg.sender, msg.value); emit Deposit(msg.sender, msg.value);
} }
// Outside-visible transact entry point. Executes transacion immediately if below daily spend limit. // Outside-visible transact entry point. Executes transaction immediately if below daily spend limit.
// If not, goes into multisig process. We provide a hash on return to allow the sender to provide // If not, goes into multisig process. We provide a hash on return to allow the sender to provide
// shortcuts for the other confirmations (allowing them to avoid replicating the _to, _value // shortcuts for the other confirmations (allowing them to avoid replicating the _to, _value
// and _data arguments). They still get the option of using them if they want, anyways. // and _data arguments). They still get the option of using them if they want, anyways.

View File

@ -199,7 +199,7 @@ BOOST_AUTO_TEST_CASE(multiple_params)
BOOST_AUTO_TEST_CASE(multiple_methods_order) BOOST_AUTO_TEST_CASE(multiple_methods_order)
{ {
// methods are expected to be in alpabetical order // methods are expected to be in alphabetical order
char const* sourceCode = R"( char const* sourceCode = R"(
contract test { contract test {
function f(uint a) public returns (uint d) { return a * 7; } function f(uint a) public returns (uint d) { return a * 7; }

View File

@ -2344,7 +2344,7 @@ BOOST_AUTO_TEST_CASE(packed_keccak256)
function a(bytes32 input) public returns (bytes32 hash) { function a(bytes32 input) public returns (bytes32 hash) {
uint24 b = 65536; uint24 b = 65536;
uint c = 256; uint c = 256;
return keccak256(abi.encodePacked(8, input, b, input, c)); return keccak256(abi.encodePacked(uint8(8), input, b, input, c));
} }
} }
)"; )";
@ -2396,7 +2396,7 @@ BOOST_AUTO_TEST_CASE(packed_sha256)
function a(bytes32 input) public returns (bytes32 hash) { function a(bytes32 input) public returns (bytes32 hash) {
uint24 b = 65536; uint24 b = 65536;
uint c = 256; uint c = 256;
return sha256(abi.encodePacked(8, input, b, input, c)); return sha256(abi.encodePacked(uint8(8), input, b, input, c));
} }
} }
)"; )";
@ -2423,7 +2423,7 @@ BOOST_AUTO_TEST_CASE(packed_ripemd160)
function a(bytes32 input) public returns (bytes32 hash) { function a(bytes32 input) public returns (bytes32 hash) {
uint24 b = 65536; uint24 b = 65536;
uint c = 256; uint c = 256;
return ripemd160(abi.encodePacked(8, input, b, input, c)); return ripemd160(abi.encodePacked(uint8(8), input, b, input, c));
} }
} }
)"; )";
@ -3822,7 +3822,7 @@ BOOST_AUTO_TEST_CASE(keccak256_multiple_arguments_with_numeric_literals)
contract c { contract c {
function foo(uint a, uint16 b) public returns (bytes32 d) function foo(uint a, uint16 b) public returns (bytes32 d)
{ {
d = keccak256(abi.encodePacked(a, b, 145)); d = keccak256(abi.encodePacked(a, b, uint8(145)));
} }
} }
)"; )";
@ -3847,7 +3847,7 @@ BOOST_AUTO_TEST_CASE(keccak256_multiple_arguments_with_string_literals)
} }
function bar(uint a, uint16 b) public returns (bytes32 d) function bar(uint a, uint16 b) public returns (bytes32 d)
{ {
d = keccak256(abi.encodePacked(a, b, 145, "foo")); d = keccak256(abi.encodePacked(a, b, uint8(145), "foo"));
} }
} }
)"; )";
@ -6649,9 +6649,9 @@ BOOST_AUTO_TEST_CASE(return_multiple_strings_of_various_sizes)
"ABCDEFGHIJKLMNOPQRSTUVXYZABCDEFGHIJKLMNOPQRSTUVXYZABCDEFGHIJKLMNOPQRSTUVXYZ" "ABCDEFGHIJKLMNOPQRSTUVXYZABCDEFGHIJKLMNOPQRSTUVXYZABCDEFGHIJKLMNOPQRSTUVXYZ"
"ABCDEFGHIJKLMNOPQRSTUVXYZABCDEFGHIJKLMNOPQRSTUVXYZABCDEFGHIJKLMNOPQRSTUVXYZ" "ABCDEFGHIJKLMNOPQRSTUVXYZABCDEFGHIJKLMNOPQRSTUVXYZABCDEFGHIJKLMNOPQRSTUVXYZ"
); );
vector<size_t> lengthes{0, 30, 32, 63, 64, 65, 210, 300}; vector<size_t> lengths{0, 30, 32, 63, 64, 65, 210, 300};
for (auto l1: lengthes) for (auto l1: lengths)
for (auto l2: lengthes) for (auto l2: lengths)
{ {
bytes dyn1 = encodeArgs(u256(l1), s1.substr(0, l1)); bytes dyn1 = encodeArgs(u256(l1), s1.substr(0, l1));
bytes dyn2 = encodeArgs(u256(l2), s2.substr(0, l2)); bytes dyn2 = encodeArgs(u256(l2), s2.substr(0, l2));
@ -6718,9 +6718,9 @@ BOOST_AUTO_TEST_CASE(bytes_in_function_calls)
compileAndRun(sourceCode, 0, "Main"); compileAndRun(sourceCode, 0, "Main");
string s1("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"); string s1("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz");
string s2("ABCDEFGHIJKLMNOPQRSTUVXYZABCDEFGHIJKLMNOPQRSTUVXYZABCDEFGHIJKLMNOPQRSTUVXYZ"); string s2("ABCDEFGHIJKLMNOPQRSTUVXYZABCDEFGHIJKLMNOPQRSTUVXYZABCDEFGHIJKLMNOPQRSTUVXYZ");
vector<size_t> lengthes{0, 31, 64, 65}; vector<size_t> lengths{0, 31, 64, 65};
for (auto l1: lengthes) for (auto l1: lengths)
for (auto l2: lengthes) for (auto l2: lengths)
{ {
bytes dyn1 = encodeArgs(u256(l1), s1.substr(0, l1)); bytes dyn1 = encodeArgs(u256(l1), s1.substr(0, l1));
bytes dyn2 = encodeArgs(u256(l2), s2.substr(0, l2)); bytes dyn2 = encodeArgs(u256(l2), s2.substr(0, l2));
@ -6759,8 +6759,8 @@ BOOST_AUTO_TEST_CASE(return_bytes_internal)
)"; )";
compileAndRun(sourceCode, 0, "Main"); compileAndRun(sourceCode, 0, "Main");
string s1("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"); string s1("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz");
vector<size_t> lengthes{0, 31, 64, 65}; vector<size_t> lengths{0, 31, 64, 65};
for (auto l1: lengthes) for (auto l1: lengths)
{ {
bytes dyn1 = encodeArgs(u256(l1), s1.substr(0, l1)); bytes dyn1 = encodeArgs(u256(l1), s1.substr(0, l1));
bytes args1 = encodeArgs(u256(0x20)) + dyn1; bytes args1 = encodeArgs(u256(0x20)) + dyn1;

View File

@ -104,7 +104,7 @@ public:
"\nOptimized: " + toHex(optimizedOutput)); "\nOptimized: " + toHex(optimizedOutput));
} }
/// @returns the number of intructions in the given bytecode, not taking the metadata hash /// @returns the number of instructions in the given bytecode, not taking the metadata hash
/// into account. /// into account.
size_t numInstructions(bytes const& _bytecode, boost::optional<Instruction> _which = boost::optional<Instruction>{}) size_t numInstructions(bytes const& _bytecode, boost::optional<Instruction> _which = boost::optional<Instruction>{})
{ {