From f5a49f679a1ec2b8aef466f41d85bbfa99b9a74a Mon Sep 17 00:00:00 2001 From: Daniel Kirchner Date: Fri, 11 May 2018 14:06:31 +0200 Subject: Adjust tests. --- test/libsolidity/ABIDecoderTests.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/libsolidity/ABIDecoderTests.cpp') diff --git a/test/libsolidity/ABIDecoderTests.cpp b/test/libsolidity/ABIDecoderTests.cpp index beb7b5af..b3ebb7a5 100644 --- a/test/libsolidity/ABIDecoderTests.cpp +++ b/test/libsolidity/ABIDecoderTests.cpp @@ -579,7 +579,7 @@ BOOST_AUTO_TEST_CASE(struct_simple) a = s.a; b = s.b; c = s.c; - d = uint(s.d); + d = uint16(s.d); } } )"; -- cgit v1.2.3 From a211b8911885ded6ddcd4d7400994a85235fe8e4 Mon Sep 17 00:00:00 2001 From: Christian Parpart Date: Wed, 6 Jun 2018 11:15:22 +0200 Subject: Enforce disallowing empty structs This patch enfoces an error when it encounters an empty struct, effectively eliminating the deprecation warning. Also adjust 419_interface_structs to explicitely test for (non-empty) structs, as this behaviour "may" change in the future. --- test/libsolidity/ABIDecoderTests.cpp | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'test/libsolidity/ABIDecoderTests.cpp') diff --git a/test/libsolidity/ABIDecoderTests.cpp b/test/libsolidity/ABIDecoderTests.cpp index b3ebb7a5..b588ca1b 100644 --- a/test/libsolidity/ABIDecoderTests.cpp +++ b/test/libsolidity/ABIDecoderTests.cpp @@ -659,26 +659,6 @@ BOOST_AUTO_TEST_CASE(struct_function) ) } -BOOST_AUTO_TEST_CASE(empty_struct) -{ - string sourceCode = R"( - contract C { - struct S { } - function f(uint a, S s, uint b) public pure returns (uint x, uint y) { - assembly { x := a y := b } - } - function g() public returns (uint, uint) { - return this.f(7, S(), 8); - } - } - )"; - NEW_ENCODER( - compileAndRun(sourceCode, 0, "C"); - ABI_CHECK(callContractFunction("f(uint256,(),uint256)", 7, 8), encodeArgs(7, 8)); - ABI_CHECK(callContractFunction("g()"), encodeArgs(7, 8)); - ) -} - BOOST_AUTO_TEST_CASE(mediocre_struct) { string sourceCode = R"( -- cgit v1.2.3 From 7763d21cc6181204b1454437b051ac56d3e89339 Mon Sep 17 00:00:00 2001 From: Leonardo Alt Date: Mon, 4 Jun 2018 12:31:18 +0200 Subject: Revert if calldata is too short or points out of bounds --- test/libsolidity/ABIDecoderTests.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'test/libsolidity/ABIDecoderTests.cpp') diff --git a/test/libsolidity/ABIDecoderTests.cpp b/test/libsolidity/ABIDecoderTests.cpp index b588ca1b..17cb2223 100644 --- a/test/libsolidity/ABIDecoderTests.cpp +++ b/test/libsolidity/ABIDecoderTests.cpp @@ -266,7 +266,6 @@ BOOST_AUTO_TEST_CASE(calldata_arrays_too_large) } } )"; - bool newEncoder = false; BOTH_ENCODERS( compileAndRun(sourceCode); bytes args = encodeArgs( @@ -275,9 +274,8 @@ BOOST_AUTO_TEST_CASE(calldata_arrays_too_large) ); ABI_CHECK( callContractFunction("f(uint256,uint256[],uint256)", args), - newEncoder ? encodeArgs() : encodeArgs(7) + encodeArgs() ); - newEncoder = true; ) } @@ -449,13 +447,11 @@ BOOST_AUTO_TEST_CASE(short_input_value_type) function f(uint a, uint b) public pure returns (uint) { return a; } } )"; - bool newDecoder = false; BOTH_ENCODERS( compileAndRun(sourceCode); ABI_CHECK(callContractFunction("f(uint256,uint256)", 1, 2), encodeArgs(1)); ABI_CHECK(callContractFunctionNoEncoding("f(uint256,uint256)", bytes(64, 0)), encodeArgs(0)); - ABI_CHECK(callContractFunctionNoEncoding("f(uint256,uint256)", bytes(63, 0)), newDecoder ? encodeArgs() : encodeArgs(0)); - newDecoder = true; + ABI_CHECK(callContractFunctionNoEncoding("f(uint256,uint256)", bytes(63, 0)), encodeArgs()); ) } @@ -466,15 +462,13 @@ BOOST_AUTO_TEST_CASE(short_input_array) function f(uint[] a) public pure returns (uint) { return 7; } } )"; - bool newDecoder = false; BOTH_ENCODERS( compileAndRun(sourceCode); ABI_CHECK(callContractFunctionNoEncoding("f(uint256[])", encodeArgs(0x20, 0)), encodeArgs(7)); - ABI_CHECK(callContractFunctionNoEncoding("f(uint256[])", encodeArgs(0x20, 1)), newDecoder ? encodeArgs() : encodeArgs(7)); - ABI_CHECK(callContractFunctionNoEncoding("f(uint256[])", encodeArgs(0x20, 1) + bytes(31, 0)), newDecoder ? encodeArgs() : encodeArgs(7)); + ABI_CHECK(callContractFunctionNoEncoding("f(uint256[])", encodeArgs(0x20, 1)), encodeArgs()); + ABI_CHECK(callContractFunctionNoEncoding("f(uint256[])", encodeArgs(0x20, 1) + bytes(31, 0)), encodeArgs()); ABI_CHECK(callContractFunctionNoEncoding("f(uint256[])", encodeArgs(0x20, 1) + bytes(32, 0)), encodeArgs(7)); ABI_CHECK(callContractFunctionNoEncoding("f(uint256[])", encodeArgs(0x20, 2, 5, 6)), encodeArgs(7)); - newDecoder = true; ) } -- cgit v1.2.3 From 12c4eb769762d55a71ba05cf1b74b99797026f51 Mon Sep 17 00:00:00 2001 From: Erik Kundt Date: Wed, 27 Jun 2018 13:22:33 +0200 Subject: Updates compiled unit tests to new constructor syntax. --- test/libsolidity/ABIDecoderTests.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test/libsolidity/ABIDecoderTests.cpp') diff --git a/test/libsolidity/ABIDecoderTests.cpp b/test/libsolidity/ABIDecoderTests.cpp index b588ca1b..c122d806 100644 --- a/test/libsolidity/ABIDecoderTests.cpp +++ b/test/libsolidity/ABIDecoderTests.cpp @@ -287,7 +287,7 @@ BOOST_AUTO_TEST_CASE(decode_from_memory_simple) contract C { uint public _a; uint[] public _b; - function C(uint a, uint[] b) { + constructor(uint a, uint[] b) { _a = a; _b = b; } @@ -312,7 +312,7 @@ BOOST_AUTO_TEST_CASE(decode_function_type) string sourceCode = R"( contract D { function () external returns (uint) public _a; - function D(function () external returns (uint) a) { + constructor(function () external returns (uint) a) { _a = a; } } @@ -346,13 +346,13 @@ BOOST_AUTO_TEST_CASE(decode_function_type_array) string sourceCode = R"( contract D { function () external returns (uint)[] public _a; - function D(function () external returns (uint)[] a) { + constructor(function () external returns (uint)[] a) { _a = a; } } contract E { function () external returns (uint)[3] public _a; - function E(function () external returns (uint)[3] a) { + constructor(function () external returns (uint)[3] a) { _a = a; } } @@ -414,7 +414,7 @@ BOOST_AUTO_TEST_CASE(decode_from_memory_complex) uint public _a; uint[] public _b; bytes[2] public _c; - function C(uint a, uint[] b, bytes[2] c) { + constructor(uint a, uint[] b, bytes[2] c) { _a = a; _b = b; _c = c; -- cgit v1.2.3 From e251cdcf47667ad3e7c88446d8b26cb3ae1bd0f2 Mon Sep 17 00:00:00 2001 From: Christian Parpart Date: Thu, 28 Jun 2018 15:19:53 +0200 Subject: test: ensure compiled tests do not use var-keyword in preparation of var-keyword removal --- test/libsolidity/ABIDecoderTests.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/libsolidity/ABIDecoderTests.cpp') diff --git a/test/libsolidity/ABIDecoderTests.cpp b/test/libsolidity/ABIDecoderTests.cpp index c122d806..54154df7 100644 --- a/test/libsolidity/ABIDecoderTests.cpp +++ b/test/libsolidity/ABIDecoderTests.cpp @@ -374,7 +374,7 @@ BOOST_AUTO_TEST_CASE(decode_function_type_array) } // uses "decode from memory" function test1_dynamic() public returns (uint) { - var x = new function() external returns (uint)[](3); + function () external returns (uint)[] memory x = new function() external returns (uint)[](4); x[0] = this.f1; x[1] = this.f2; x[2] = this.f3; @@ -387,7 +387,7 @@ BOOST_AUTO_TEST_CASE(decode_function_type_array) } // uses "decode from calldata" function test2_dynamic() public returns (uint) { - var x = new function() external returns (uint)[](3); + function () external returns (uint)[] memory x = new function() external returns (uint)[](3); x[0] = this.f1; x[1] = this.f2; x[2] = this.f3; @@ -558,7 +558,7 @@ BOOST_AUTO_TEST_CASE(storage_ptr) r[2] = 3; s.x = 11; s.y = 12; - var (a, b, c, d) = L.f(r, s); + (uint a, uint b, uint c, uint d) = L.f(r, s); return (r[2], s.x, a, b, c, d); } } -- cgit v1.2.3 From fc2b006fe1266339776820ee0dd2c756bc9766d5 Mon Sep 17 00:00:00 2001 From: Erik Kundt Date: Fri, 29 Jun 2018 16:52:41 +0200 Subject: Updates unit test to specify visibility. --- test/libsolidity/ABIDecoderTests.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'test/libsolidity/ABIDecoderTests.cpp') diff --git a/test/libsolidity/ABIDecoderTests.cpp b/test/libsolidity/ABIDecoderTests.cpp index b4f829ca..6504f6bc 100644 --- a/test/libsolidity/ABIDecoderTests.cpp +++ b/test/libsolidity/ABIDecoderTests.cpp @@ -285,7 +285,7 @@ BOOST_AUTO_TEST_CASE(decode_from_memory_simple) contract C { uint public _a; uint[] public _b; - constructor(uint a, uint[] b) { + constructor(uint a, uint[] b) public { _a = a; _b = b; } @@ -310,24 +310,24 @@ BOOST_AUTO_TEST_CASE(decode_function_type) string sourceCode = R"( contract D { function () external returns (uint) public _a; - constructor(function () external returns (uint) a) { + constructor(function () external returns (uint) a) public { _a = a; } } contract C { - function f() returns (uint) { + function f() public returns (uint) { return 3; } - function g(function () external returns (uint) _f) returns (uint) { + function g(function () external returns (uint) _f) public returns (uint) { return _f(); } // uses "decode from memory" - function test1() returns (uint) { + function test1() public returns (uint) { D d = new D(this.f); return d._a()(); } // uses "decode from calldata" - function test2() returns (uint) { + function test2() public returns (uint) { return this.g(this.f); } } @@ -344,13 +344,13 @@ BOOST_AUTO_TEST_CASE(decode_function_type_array) string sourceCode = R"( contract D { function () external returns (uint)[] public _a; - constructor(function () external returns (uint)[] a) { + constructor(function () external returns (uint)[] a) public { _a = a; } } contract E { function () external returns (uint)[3] public _a; - constructor(function () external returns (uint)[3] a) { + constructor(function () external returns (uint)[3] a) public { _a = a; } } @@ -412,7 +412,7 @@ BOOST_AUTO_TEST_CASE(decode_from_memory_complex) uint public _a; uint[] public _b; bytes[2] public _c; - constructor(uint a, uint[] b, bytes[2] c) { + constructor(uint a, uint[] b, bytes[2] c) public { _a = a; _b = b; _c = c; -- cgit v1.2.3 From f48d01d0660747b0071e9d82a0261ce15bcc4c35 Mon Sep 17 00:00:00 2001 From: Chase McDermott Date: Wed, 11 Jul 2018 23:18:50 -0500 Subject: Added default data locations to parameters for end to end tests. --- test/libsolidity/ABIDecoderTests.cpp | 58 ++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 29 deletions(-) (limited to 'test/libsolidity/ABIDecoderTests.cpp') diff --git a/test/libsolidity/ABIDecoderTests.cpp b/test/libsolidity/ABIDecoderTests.cpp index 6504f6bc..2cfa27d6 100644 --- a/test/libsolidity/ABIDecoderTests.cpp +++ b/test/libsolidity/ABIDecoderTests.cpp @@ -128,7 +128,7 @@ BOOST_AUTO_TEST_CASE(fixed_arrays) { string sourceCode = R"( contract C { - function f(uint16[3] a, uint16[2][3] b, uint i, uint j, uint k) + function f(uint16[3] memory a, uint16[2][3] memory b, uint i, uint j, uint k) public pure returns (uint, uint) { return (a[i], b[j][k]); } @@ -154,7 +154,7 @@ BOOST_AUTO_TEST_CASE(dynamic_arrays) { string sourceCode = R"( contract C { - function f(uint a, uint16[] b, uint c) + function f(uint a, uint16[] memory b, uint c) public pure returns (uint, uint, uint) { return (b.length, b[a], c); } @@ -178,7 +178,7 @@ BOOST_AUTO_TEST_CASE(dynamic_nested_arrays) { string sourceCode = R"( contract C { - function f(uint a, uint16[][] b, uint[2][][3] c, uint d) + function f(uint a, uint16[][] memory b, uint[2][][3] memory c, uint d) public pure returns (uint, uint, uint, uint, uint, uint, uint) { return (a, b.length, b[1].length, b[1][1], c[1].length, c[1][1][1], d); } @@ -229,7 +229,7 @@ BOOST_AUTO_TEST_CASE(byte_arrays) { string sourceCode = R"( contract C { - function f(uint a, bytes b, uint c) + function f(uint a, bytes memory b, uint c) public pure returns (uint, uint, byte, uint) { return (a, b.length, b[3], c); } @@ -285,7 +285,7 @@ BOOST_AUTO_TEST_CASE(decode_from_memory_simple) contract C { uint public _a; uint[] public _b; - constructor(uint a, uint[] b) public { + constructor(uint a, uint[] memory b) public { _a = a; _b = b; } @@ -344,13 +344,13 @@ BOOST_AUTO_TEST_CASE(decode_function_type_array) string sourceCode = R"( contract D { function () external returns (uint)[] public _a; - constructor(function () external returns (uint)[] a) public { + constructor(function () external returns (uint)[] memory a) public { _a = a; } } contract E { function () external returns (uint)[3] public _a; - constructor(function () external returns (uint)[3] a) public { + constructor(function () external returns (uint)[3] memory a) public { _a = a; } } @@ -364,10 +364,10 @@ BOOST_AUTO_TEST_CASE(decode_function_type_array) function f3() public returns (uint) { return 3; } - function g(function () external returns (uint)[] _f, uint i) public returns (uint) { + function g(function () external returns (uint)[] memory _f, uint i) public returns (uint) { return _f[i](); } - function h(function () external returns (uint)[3] _f, uint i) public returns (uint) { + function h(function () external returns (uint)[3] memory _f, uint i) public returns (uint) { return _f[i](); } // uses "decode from memory" @@ -412,7 +412,7 @@ BOOST_AUTO_TEST_CASE(decode_from_memory_complex) uint public _a; uint[] public _b; bytes[2] public _c; - constructor(uint a, uint[] b, bytes[2] c) public { + constructor(uint a, uint[] memory b, bytes[2] memory c) public { _a = a; _b = b; _c = c; @@ -459,7 +459,7 @@ BOOST_AUTO_TEST_CASE(short_input_array) { string sourceCode = R"( contract C { - function f(uint[] a) public pure returns (uint) { return 7; } + function f(uint[] memory a) public pure returns (uint) { return 7; } } )"; BOTH_ENCODERS( @@ -476,7 +476,7 @@ BOOST_AUTO_TEST_CASE(short_dynamic_input_array) { string sourceCode = R"( contract C { - function f(bytes[1] a) public pure returns (uint) { return 7; } + function f(bytes[1] memory a) public pure returns (uint) { return 7; } } )"; NEW_ENCODER( @@ -489,8 +489,8 @@ BOOST_AUTO_TEST_CASE(short_input_bytes) { string sourceCode = R"( contract C { - function e(bytes a) public pure returns (uint) { return 7; } - function f(bytes[] a) public pure returns (uint) { return 7; } + function e(bytes memory a) public pure returns (uint) { return 7; } + function f(bytes[] memory a) public pure returns (uint) { return 7; } } )"; NEW_ENCODER( @@ -511,9 +511,9 @@ BOOST_AUTO_TEST_CASE(cleanup_int_inside_arrays) string sourceCode = R"( contract C { enum E { A, B } - function f(uint16[] a) public pure returns (uint r) { assembly { r := mload(add(a, 0x20)) } } - function g(int16[] a) public pure returns (uint r) { assembly { r := mload(add(a, 0x20)) } } - function h(E[] a) public pure returns (uint r) { assembly { r := mload(add(a, 0x20)) } } + function f(uint16[] memory a) public pure returns (uint r) { assembly { r := mload(add(a, 0x20)) } } + function g(int16[] memory a) public pure returns (uint r) { assembly { r := mload(add(a, 0x20)) } } + function h(E[] memory a) public pure returns (uint r) { assembly { r := mload(add(a, 0x20)) } } } )"; NEW_ENCODER( @@ -569,7 +569,7 @@ BOOST_AUTO_TEST_CASE(struct_simple) string sourceCode = R"( contract C { struct S { uint a; uint8 b; uint8 c; bytes2 d; } - function f(S s) public pure returns (uint a, uint b, uint c, uint d) { + function f(S memory s) public pure returns (uint a, uint b, uint c, uint d) { a = s.a; b = s.b; c = s.c; @@ -588,7 +588,7 @@ BOOST_AUTO_TEST_CASE(struct_cleanup) string sourceCode = R"( contract C { struct S { int16 a; uint8 b; bytes2 c; } - function f(S s) public pure returns (uint a, uint b, uint c) { + function f(S memory s) public pure returns (uint a, uint b, uint c) { assembly { a := mload(s) b := mload(add(s, 0x20)) @@ -611,7 +611,7 @@ BOOST_AUTO_TEST_CASE(struct_short) string sourceCode = R"( contract C { struct S { int a; uint b; bytes16 c; } - function f(S s) public pure returns (S q) { + function f(S memory s) public pure returns (S memory q) { q = s; } } @@ -638,7 +638,7 @@ BOOST_AUTO_TEST_CASE(struct_function) string sourceCode = R"( contract C { struct S { function () external returns (uint) f; uint b; } - function f(S s) public returns (uint, uint) { + function f(S memory s) public returns (uint, uint) { return (s.f(), s.b); } function test() public returns (uint, uint) { @@ -658,7 +658,7 @@ BOOST_AUTO_TEST_CASE(mediocre_struct) string sourceCode = R"( contract C { struct S { C c; } - function f(uint a, S[2] s1, uint b) public returns (uint r1, C r2, uint r3) { + function f(uint a, S[2] memory s1, uint b) public returns (uint r1, C r2, uint r3) { r1 = a; r2 = s1[0].c; r3 = b; @@ -679,7 +679,7 @@ BOOST_AUTO_TEST_CASE(mediocre2_struct) string sourceCode = R"( contract C { struct S { C c; uint[] x; } - function f(uint a, S[2] s1, uint b) public returns (uint r1, C r2, uint r3) { + function f(uint a, S[2] memory s1, uint b) public returns (uint r1, C r2, uint r3) { r1 = a; r2 = s1[0].c; r3 = b; @@ -707,7 +707,7 @@ BOOST_AUTO_TEST_CASE(complex_struct) enum E {A, B, C} struct T { uint x; E e; uint8 y; } struct S { C c; T[] t;} - function f(uint a, S[2] s1, S[] s2, uint b) public returns + function f(uint a, S[2] memory s1, S[] memory s2, uint b) public returns (uint r1, C r2, uint r3, uint r4, C r5, uint r6, E r7, uint8 r8) { r1 = a; r2 = s1[0].c; @@ -767,10 +767,10 @@ BOOST_AUTO_TEST_CASE(return_dynamic_types_cross_call_simple) string sourceCode = R"( contract C { - function dyn() public returns (bytes) { + function dyn() public returns (bytes memory) { return "1234567890123456789012345678901234567890"; } - function f() public returns (bytes) { + function f() public returns (bytes memory) { return this.dyn(); } } @@ -788,7 +788,7 @@ BOOST_AUTO_TEST_CASE(return_dynamic_types_cross_call_advanced) string sourceCode = R"( contract C { - function dyn() public returns (bytes a, uint b, bytes20[] c, uint d) { + function dyn() public returns (bytes memory a, uint b, bytes20[] memory c, uint d) { a = "1234567890123456789012345678901234567890"; b = uint(-1); c = new bytes20[](4); @@ -796,7 +796,7 @@ BOOST_AUTO_TEST_CASE(return_dynamic_types_cross_call_advanced) c[3] = bytes20(6789); d = 0x1234; } - function f() public returns (bytes, uint, bytes20[], uint) { + function f() public returns (bytes memory, uint, bytes20[] memory, uint) { return this.dyn(); } } @@ -815,7 +815,7 @@ BOOST_AUTO_TEST_CASE(return_dynamic_types_cross_call_out_of_range) { string sourceCode = R"( contract C { - function dyn(uint x) public returns (bytes a) { + function dyn(uint x) public returns (bytes memory a) { assembly { mstore(0, 0x20) mstore(0x20, 0x21) -- cgit v1.2.3 From 893f4cf092c98d13116741d1ebc19846f6873536 Mon Sep 17 00:00:00 2001 From: Erik Kundt Date: Wed, 11 Jul 2018 15:57:07 +0200 Subject: Specifies visibility in unit tests. --- test/libsolidity/ABIDecoderTests.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/libsolidity/ABIDecoderTests.cpp') diff --git a/test/libsolidity/ABIDecoderTests.cpp b/test/libsolidity/ABIDecoderTests.cpp index 2cfa27d6..28f982c4 100644 --- a/test/libsolidity/ABIDecoderTests.cpp +++ b/test/libsolidity/ABIDecoderTests.cpp @@ -182,7 +182,7 @@ BOOST_AUTO_TEST_CASE(dynamic_nested_arrays) public pure returns (uint, uint, uint, uint, uint, uint, uint) { return (a, b.length, b[1].length, b[1][1], c[1].length, c[1][1][1], d); } - function test() view returns (uint, uint, uint, uint, uint, uint, uint) { + function test() public view returns (uint, uint, uint, uint, uint, uint, uint) { uint16[][] memory b = new uint16[][](3); b[0] = new uint16[](2); b[0][0] = 0x55; -- cgit v1.2.3 From 7d7abeb1496dddfab7eb8705dbfc3d06284cf25d Mon Sep 17 00:00:00 2001 From: Daniel Kirchner Date: Mon, 6 Aug 2018 14:59:37 +0200 Subject: Disallow ambiguous conversions between number literals and bytesXX types. --- test/libsolidity/ABIDecoderTests.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/libsolidity/ABIDecoderTests.cpp') diff --git a/test/libsolidity/ABIDecoderTests.cpp b/test/libsolidity/ABIDecoderTests.cpp index 28f982c4..f91a4f85 100644 --- a/test/libsolidity/ABIDecoderTests.cpp +++ b/test/libsolidity/ABIDecoderTests.cpp @@ -792,8 +792,8 @@ BOOST_AUTO_TEST_CASE(return_dynamic_types_cross_call_advanced) a = "1234567890123456789012345678901234567890"; b = uint(-1); c = new bytes20[](4); - c[0] = bytes20(1234); - c[3] = bytes20(6789); + c[0] = bytes20(uint160(1234)); + c[3] = bytes20(uint160(6789)); d = 0x1234; } function f() public returns (bytes memory, uint, bytes20[] memory, uint) { -- cgit v1.2.3 From b000a022f2d7c1057ade755ed1ea8c70380688a5 Mon Sep 17 00:00:00 2001 From: Chase McDermott Date: Tue, 7 Aug 2018 15:19:50 +0200 Subject: Update tests --- test/libsolidity/ABIDecoderTests.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/libsolidity/ABIDecoderTests.cpp') diff --git a/test/libsolidity/ABIDecoderTests.cpp b/test/libsolidity/ABIDecoderTests.cpp index f91a4f85..94319985 100644 --- a/test/libsolidity/ABIDecoderTests.cpp +++ b/test/libsolidity/ABIDecoderTests.cpp @@ -234,7 +234,7 @@ BOOST_AUTO_TEST_CASE(byte_arrays) return (a, b.length, b[3], c); } - function f_external(uint a, bytes b, uint c) + function f_external(uint a, bytes calldata b, uint c) external pure returns (uint, uint, byte, uint) { return (a, b.length, b[3], c); } @@ -261,7 +261,7 @@ BOOST_AUTO_TEST_CASE(calldata_arrays_too_large) { string sourceCode = R"( contract C { - function f(uint a, uint[] b, uint c) external pure returns (uint) { + function f(uint a, uint[] calldata b, uint c) external pure returns (uint) { return 7; } } -- cgit v1.2.3