Commit Graph

524 Commits

Author SHA1 Message Date
chriseth
3a8a0708ff Merge pull request #1381 from ethereum/overflown_enum_compared
Enum overflow checking before writing to storage
2016-11-25 16:22:12 +01:00
chriseth
f2872bfa99 Peephole optimizer for unreacheable code. 2016-11-25 16:10:02 +01:00
Yoichi Hirai
df5d5edd1b
test: add a test about explicitly converting a string literal to string 2016-11-25 13:54:13 +01:00
Yoichi Hirai
e136ec8704
ast: string literals that are not valid UTF are not convertible to strings 2016-11-25 13:36:06 +01:00
Yoichi Hirai
aaf58a8c4e
test: add a test case converting an invalid UTF-8 into a string 2016-11-25 13:13:47 +01:00
chriseth
9e7b608e78 Merge pull request #1392 from ethereum/check_warning_contents
Check warning text in tests
2016-11-24 21:22:17 +01:00
Yoichi Hirai
a81f556302
test: various fixes 2016-11-24 19:22:26 +01:00
Yoichi Hirai
384c4546f1
interface: move searchForSubstring out of Error class into a separate file 2016-11-24 16:45:17 +01:00
Yoichi Hirai
feb10d015f
test: add a test that stores an invalid enum value 2016-11-24 11:31:45 +01:00
Yoichi Hirai
d4173cd54a
test: add a test about trying to log an event with too big enum values 2016-11-24 11:31:45 +01:00
Yoichi Hirai
d49904c92a
test: add a test that compares overflown enums 2016-11-24 11:31:45 +01:00
Yoichi Hirai
2faaddca05
interface: fix the substring search 2016-11-23 17:38:41 +01:00
Yoichi Hirai
cace51fc47
test: wrapping the error message checking in a macro 2016-11-23 17:38:41 +01:00
Yoichi Hirai
ab3db782ae
test: check the error texts
by changing parseAnalyseAndReturnError to return the whole Error, not just the type
2016-11-23 17:38:41 +01:00
chriseth
c9293f2f23 Enable the optimizer for test runs. 2016-11-23 16:48:13 +01:00
chriseth
0c874bbf27 Merge pull request #1425 from ethereum/fixLicensing
Fix licensing headers
2016-11-23 12:45:57 +01:00
VoR0220
3f9f725737 Fix licensing headers
Signed-off-by: VoR0220 <rj@erisindustries.com>
2016-11-23 12:22:33 +01:00
Yoichi Hirai
75686e3d75
test: add a test case about returning a struct in memory from a library
This fixes #1378
2016-11-22 17:09:22 +01:00
chriseth
7fb7d5ae39 Optimizer: Clear state for JUMPDESTs. 2016-11-22 14:58:24 +01:00
Alex Beregszaszi
a35ca910c7 Rename test contract names to capitalised 2016-11-17 17:23:35 +00:00
Alex Beregszaszi
1d6fe5c4e4 Add payable to constructor ABI tests 2016-11-17 17:23:35 +00:00
Alex Beregszaszi
7af360882e Add missing payable constructors 2016-11-17 17:23:35 +00:00
chriseth
2c14a96820 Some more assertions and style changes. 2016-11-16 15:09:01 +01:00
chriseth
b3eeb5fcf9 Some more tests. 2016-11-16 14:37:19 +01:00
chriseth
e1fec9b287 JSON tests. 2016-11-16 14:37:19 +01:00
chriseth
ec31d08775 Change encoding to address-funid and add "function" as ABI type. 2016-11-16 14:37:19 +01:00
chriseth
a8e7ed37a1 Disable broken tests that are not useful. 2016-11-16 14:37:19 +01:00
chriseth
739dabff8b Fix tests. 2016-11-16 14:37:19 +01:00
chriseth
7a292c9a05 Fix parser for function type disambiguity. 2016-11-16 14:37:19 +01:00
Yoichi Hirai
f3d0433ec3 test: add a test about external function type taking/returning internal functions 2016-11-16 14:37:18 +01:00
chriseth
e51f852504 Converted sub assembly to smart pointer. 2016-11-16 14:37:18 +01:00
chriseth
e543bd34c0 Stored combined creation and runtime tags.
Includes a change to Assembly to allow tags from sub-assemblies to be
used.

Sorry, this get a bit bigger than I thought.
2016-11-16 14:37:18 +01:00
chriseth
ee3efa67a8 Fix tests. 2016-11-16 14:37:18 +01:00
chriseth
08763a206d Test passing functions as arrays to other contracts. 2016-11-16 14:37:18 +01:00
chriseth
925d674146 Disallow payable internal functions. 2016-11-16 14:37:18 +01:00
chriseth
e1df3bd77f Fix tests. 2016-11-16 14:37:18 +01:00
chriseth
f21f794f3c delete for function types 2016-11-16 14:37:18 +01:00
Yoichi Hirai
c9f9b2ab4d codegen: add a compilation mode and a runtime context to CompilerContext 2016-11-16 14:37:18 +01:00
chriseth
47794c1da4 Implement uninitialized storage functions. 2016-11-16 14:37:18 +01:00
chriseth
b6992d740a Tests for uninitialized storage functions. 2016-11-16 14:37:18 +01:00
Yoichi Hirai
3158a8ea7b test: add a test for storing an internal function in the constructor and then using the stored function in runtime 2016-11-16 14:37:18 +01:00
chriseth
87b148494b Tests. 2016-11-16 14:37:18 +01:00
Yoichi Hirai
6172590b87 Add a test around storing functions in an array 2016-11-16 14:37:17 +01:00
Yoichi Hirai
708b7b35ad Add a parser test for arrays containing functions 2016-11-16 14:37:17 +01:00
Yoichi Hirai
ab3d1b024d Add tests around calling functions returning functions returning functions 2016-11-16 14:37:17 +01:00
chriseth
95d7555e3c External functions in storage. 2016-11-16 14:37:17 +01:00
chriseth
6f19559de0 Fix some type checks and tests for internal / external function parameters. 2016-11-16 14:37:17 +01:00
chriseth
97a3588701 Function type state variables. 2016-11-16 14:37:17 +01:00
chriseth
dd173f83e3 Code generator for function types. 2016-11-16 14:37:17 +01:00
chriseth
cc8583ec7d Function types. 2016-11-16 14:37:17 +01:00
Alex Beregszaszi
227f6aab4f Change natspec/abi JSON expected message to be the same 2016-11-15 17:58:55 +00:00
Alex Beregszaszi
81c50143f2 Move JSON helpers to libdevcore/json 2016-11-15 17:38:18 +00:00
Alex Beregszaszi
9205662de9 Update tests to use JSON 2016-11-15 17:20:30 +00:00
Alex Beregszaszi
ae8403ed08 Rename ErrorTag to invalidJumpLabel in inline assembly 2016-11-15 10:30:33 +00:00
Alex Beregszaszi
bee926bf3f Add tests for the ErrorTag 2016-11-15 10:30:33 +00:00
chriseth
dce80911e1 Add tests 2016-11-15 09:16:33 +01:00
Yoichi Hirai
e6247195dd
test: add a testcase about using an invalid enum value as an external call argument 2016-11-14 20:46:30 +01:00
Yoichi Hirai
454e7618c8
test: add tests about returning invalid enum values from interface functions 2016-11-14 16:44:04 +01:00
Yoichi Hirai
4b6e7e0677
test: add a test conerting an enum into another enum, which should fail 2016-11-11 17:48:03 +01:00
Yoichi Hirai
eee629652e
parsing: ban empty enum definition. 2016-11-11 17:48:03 +01:00
Yoichi Hirai
457daecba1
test: add a test converting -1 as a literal into an enum
This shows #1334 fixes #1344
2016-11-11 17:48:03 +01:00
Yoichi Hirai
08a889a908
test: add a test case for #1343
The test witnesses that #1334 fixes #1343.
2016-11-11 17:48:03 +01:00
Yoichi Hirai
8856adce8f
test: add tests that witness issue #1311 2016-11-11 17:47:48 +01:00
Yoichi Hirai
33590d513e
test: add a test for #621 2016-11-11 15:51:54 +01:00
chriseth
a40dcfef12 Merge pull request #768 from roadriverrail/do_while_loops
Add support for do/while loops
2016-11-10 17:13:45 +01:00
Rhett Aultman
4524ad0870 Add support for do/while loops
This commit adds support for a standard do <statement> while <expr>;
form of statement.  While loops were already being supported; supporting
a do/while loop mostly involves reusing code from while loops but putting
the conditional checking last.
2016-11-10 07:07:25 -08:00
chriseth
81118de512 Merge pull request #1339 from ethereum/typo
test: fix a typo in calling_payable test
2016-11-09 11:29:41 +01:00
chriseth
63bde109a1 Fail if parsing fails in type checker tests. 2016-11-09 10:48:45 +01:00
Yoichi Hirai
88547a1c66
test: fix a typo in calling_payable test 2016-11-08 17:09:24 +01:00
Yoichi Hirai
2e92966684
libevmasm: fix comparison of SourceLocations 2016-11-08 11:11:08 +01:00
chriseth
681b130dc8 Test case for overflow in storage. 2016-10-31 16:40:19 +01:00
Yoichi Hirai
578b02bb37
Add tests for #1246 2016-10-25 16:48:26 +02:00
chriseth
e00a4b47c0 Merge pull request #1264 from ethereum/988
State variable under contract's name
2016-10-25 12:50:24 +02:00
Yoichi Hirai
58477c233d
test: add more tests about state variable access under base contract names 2016-10-24 19:31:51 +02:00
chriseth
6b028701a0 Test. 2016-10-24 16:43:08 +02:00
Yoichi Hirai
922e4b3ce7
test: add tests from #988 2016-10-24 16:34:52 +02:00
Yoichi Hirai
47b11ef2b8
test: add a test case for accessing a state variable under the contract's name
The test comes from the description of #988
2016-10-24 16:28:14 +02:00
Yoichi Hirai
df900c5583
test: add a test about using an inherited enum definition as an expression,
with an explicit mention of the base contract.  The test is about #1131.
2016-10-24 15:28:23 +02:00
chriseth
2b00804d1d Fix crash in throw. 2016-10-24 14:32:49 +02:00
chriseth
cb1fcaf6f6 Merge pull request #1240 from ethereum/1151
ast: super contract type does not contain native members
2016-10-24 11:45:54 +02:00
Yoichi Hirai
4b7fdaa0bd
test: add a test about accessing an enum member without the name of the enum 2016-10-21 13:01:45 +02:00
Yoichi Hirai
f967623a5b
test: add tests for #1131
The tests are about enum inheritance.
2016-10-21 13:01:45 +02:00
Alex Beregszaszi
13b2101ea7 Add tests for inline assembly in modifiers 2016-10-20 23:57:14 +01:00
Yoichi Hirai
6781ec105f
Add a test for #1151 2016-10-20 16:09:52 +02:00
Alex Beregszaszi
6cb2770344 Add two test cases for unbalanced inline assembly 2016-10-20 13:25:28 +01:00
Alex Beregszaszi
0e33b63468 Allow warnings for inline assembly block 2016-10-20 13:25:28 +01:00
Alex Beregszaszi
59603f7b8e Add tests for constant shifts 2016-10-20 00:03:09 +01:00
Alex Beregszaszi
0a3faf48d4 Add tests for magic variables in inline assembly 2016-10-19 20:44:15 +01:00
Alex Beregszaszi
8317eb0383 Add test case for bound types without self 2016-10-19 10:40:45 +01:00
Yoichi Hirai
0542df25df
Add a test for #1242
This is about `super` as an expression.
2016-10-18 13:25:00 +02:00
RJ
d9af51be51 Merge pull request #1079 from VoR0220/fixedTypeTestFramework
Solidity helper function for testing fixed points
2016-10-13 15:18:45 -05:00
chriseth
5fb0bcce45 Replace fixed by standard encode function.
This way, we can use
```
BOOST_CHECK(callContractFunction("t(fixed8x128)", make_pair(rational(2, 3), 128)) == encodeArgs(u256(9)));
```
which is a bit more self-explanatory, I would say.
2016-10-12 17:28:47 +02:00
Alex Beregszaszi
d0791fb365 Fix assignment after tags in inline assembly 2016-10-11 12:28:49 +01:00
chriseth
c4f4d6b971 Fix build error. 2016-10-10 22:14:46 +02:00
chriseth
0b1d449057 Merge pull request #1168 from ethereum/rename-dev-sha3
Rename dev::sha3 to dev::keccak256
2016-10-10 21:23:27 +02:00
Alex Beregszaszi
9f61ae924e Add test for address in inline assembly 2016-10-06 22:05:01 +01:00
Alex Beregszaszi
34df80c502 Add alias keccak256() for sha3() 2016-10-06 16:34:41 +02:00
Alex Beregszaszi
aefb6e5fcf Rename dev::sha3 to dev::keccak256 2016-10-06 14:53:40 +01:00
Alex Beregszaszi
c7508942fe Add test for suicide/selfdestruct 2016-10-06 12:44:33 +01:00
chriseth
212e016091 Merge pull request #1104 from ethereum/fixmemcosts
Fix memory resize costs during call
2016-09-17 12:30:41 +02:00
chriseth
5a45990458 Access output memory area so that we do not pay for resize during call. 2016-09-17 11:29:54 +02:00
chriseth
dd2f878e59 Test case. 2016-09-17 11:29:54 +02:00
chriseth
727c6fac85 Allow value transfer to library functions. 2016-09-17 11:29:27 +02:00
chriseth
031fd568cc Fix crash for TypeName[k]. 2016-09-15 18:16:34 +02:00
VoR0220
cbd933ceed
Solidity helper function for testing fixed points
Signed-off-by: VoR0220 <rj@erisindustries.com>
2016-09-09 21:03:23 -05:00
chriseth
6a55405160 Fix problem with release version string. 2016-09-08 17:56:28 +02:00
Alex Beregszaszi
65c4e65cb3 Tests for constructor visibility 2016-09-06 17:53:13 +02:00
Alex Beregszaszi
05ae5e4f5a Tests for constant constructors 2016-09-06 17:31:39 +02:00
chriseth
3588125692 Merge pull request #1014 from ethereum/strict-fallback
Reject constant modifier on the fallback function
2016-09-06 15:51:45 +02:00
Alex Beregszaszi
6ec40b3cde Reject constant modifier on the fallback function 2016-09-06 11:40:00 +01:00
chriseth
9ca7472089 Provide gas stipend manually for send(0). 2016-09-06 12:37:01 +02:00
chriseth
f687635e47 Merge pull request #665 from axic/feature/accept-ether
BREAKING: Add payable modifier
2016-09-06 12:25:19 +02:00
chriseth
171c74843b Merge pull request #995 from chriseth/fixutf8astjson
Do not emit non-utf8 strings for ast json.
2016-09-06 12:25:04 +02:00
chriseth
43c28c1ede Test case for non-utf8 characters in string literal. 2016-09-06 11:07:56 +02:00
chriseth
dff9633084 Test and fixes for payable fallback in ABI. 2016-09-06 10:59:13 +02:00
chriseth
384f189a6a Tests for payable / private combination. 2016-09-06 10:58:56 +02:00
chriseth
ff11aa1927 Change placeholder style. 2016-09-05 21:32:27 +02:00
chriseth
1eb7ddbb09 Make constant and payable mutually exclusive. 2016-09-05 21:28:28 +02:00
chriseth
9c64edf110 Change function type to include and propagate payable and constant modifier. 2016-09-05 21:28:28 +02:00
Alex Beregszaszi
962531af96 Merged in changes from chriseth/payable 2016-09-05 21:28:28 +02:00
Alex Beregszaszi
680b83b2a4 Mark every other test payable where neccesary in EndToEndTest 2016-09-05 21:28:28 +02:00
Alex Beregszaszi
34a6afbd77 Include EndToEnd test for payable keyword 2016-09-05 21:28:18 +02:00
Alex Beregszaszi
a7794b1a68 Include ABI JSON test for payable keyword 2016-09-05 21:28:18 +02:00
chriseth
02984b8de1 Require ";" after "_" 2016-09-05 14:54:50 +02:00
chriseth
459d2dd7cd Fix version pragmas in tests. 2016-09-01 00:03:01 +02:00
chriseth
3c412ed2f6 Version pragma. 2016-09-01 00:02:51 +02:00
chriseth
18abafe029 Merge pull request #960 from Denton-L/change-else-style
Change else style
2016-08-31 22:34:44 +02:00
Denton Liu
a8c5d2bbde Fix syntax error 2016-08-31 11:17:11 -04:00
winsvega
3ccd19868a Merge pull request #947 from winsvega/soltest
rename --ipc to --ipcpath
2016-08-31 12:45:36 +03:00
chriseth
546aca2a3e Test cases. 2016-08-30 15:31:50 +02:00
chriseth
4bfe09897e Make fallback function throw by default. 2016-08-30 15:31:50 +02:00
Dimitry
f892d1b9a3 rename --ipc to --ipcpath 2016-08-29 16:21:49 +04:00
Alex Beregszaszi
4019c832ca Add test for fallback function in JSON ABI 2016-08-26 19:03:46 +01:00
Denton Liu
ff756bc94d Make tests more consistent in style 2016-08-26 13:33:42 -04:00
chriseth
fb7836d87b Merge pull request #897 from Denton-L/remove-standard
BREAKING: Remove standard contracts
2016-08-26 19:32:18 +02:00
chriseth
ce42114c41 Fix tests. 2016-08-26 01:00:39 +02:00
chriseth
21b6aa92ff Disallow fallback function to return values. 2016-08-26 00:07:50 +02:00
chriseth
d5e4b7492e Merge pull request #928 from winsvega/solremove
remove sha256 and rmd160 hash
2016-08-24 19:41:12 +02:00
Dimitry
23acb383d5 remove sha256 and rmd160 hash 2016-08-24 19:52:49 +04:00
Denton Liu
e00f802f72 Remove standard contracts 2016-08-19 10:34:50 -04:00
Alex Sinyagin
4b9eb299d0 Rename root AST JSON node to SourceUnit 2016-08-18 15:38:20 +00:00
Alex Sinyagin
9139d763d3 Use the full names for JSON AST nodes 2016-08-18 13:12:15 +00:00
Alex Sinyagin
406f3a4b5d Add ast json converter for PlaceholderStatement 2016-08-18 12:30:00 +00:00
Alex Sinyagin
e9c894c9f8 Add ast json converter for ArrayTypeName 2016-08-18 12:30:00 +00:00
Alex Sinyagin
bdc2436ae3 Add ast json converter for ModifierInvocation and EventDefinition 2016-08-18 12:30:00 +00:00
Alex Sinyagin
a5d15e6895 Add ast json converter for ModifierDefinition 2016-08-18 12:29:59 +00:00
Alex Sinyagin
95832da16e Add ast json converter for EnumValue 2016-08-18 12:29:59 +00:00
Alex Sinyagin
a9e04217a4 Add ast json converter for EnumDefinition 2016-08-18 12:29:59 +00:00
Alex Sinyagin
af64219e17 Check source loctaion in the InhertanceSpecifier test 2016-08-18 12:29:59 +00:00
Alex Sinyagin
40ca2c9e97 Add ast json converter for UsingForDirective 2016-08-18 12:29:59 +00:00