Daniel Kirchner
daa69df447
Error on invalid arithmetic with constant expressions.
2018-04-11 21:17:10 +02:00
chriseth
d50d1f0ac1
Merge pull request #3580 from ethereum/asm-bitshift-optim
...
Add simplification rule for bitwise shifting
2018-04-11 17:18:31 +02:00
Alex Beregszaszi
5f76f47f2e
Add end to end tests for SHL/SHR/SAR instructions (constantinople only)
2018-04-10 15:29:54 +01:00
Federico Bond
4e037281ac
Error on duplicated super constructor calls
2018-04-09 11:22:35 +02:00
chriseth
c6da5c1650
Merge pull request #3822 from ethereum/swap-comparison
...
Replace comparison operators with opposites if preceded by SWAP1
2018-04-05 11:57:26 +02:00
Alex Beregszaszi
8dc9113e37
Add end-to-end test for SwapComparison and CommutativeSwap peephole optimisers
2018-04-05 10:54:39 +02:00
chriseth
65f18a18de
More specific push implementation.
2018-04-04 16:50:45 +02:00
chriseth
0cbe55005d
Create empty dynamic memory arrays more efficiently.
2018-04-04 12:37:04 +02:00
chriseth
e64e397f24
Add memory array init test.
2018-04-03 14:34:32 +02:00
chriseth
6777f7a57f
Optimize across MLOAD if MSIZE is not used.
2018-04-03 14:34:32 +02:00
chriseth
5c8a6aac69
Prevent encoding of weird types and support packed encoding of external function types.
2018-03-29 09:57:11 +01:00
bitshift
2c56e53046
Changes deprecation and adjusts tests.
2018-03-27 03:30:03 +01:00
bitshift
be35a65eb3
Adds unit tests for moved function.
2018-03-27 03:30:03 +01:00
chriseth
78abe81f08
Merge branch 'develop' into externalFunctionsInLibraries
2018-03-14 18:07:55 +01:00
chriseth
d0c96d53e9
Merge pull request #3734 from ethereum/soltestOptions
...
test: Rename test/TestHelper.* to test/Options.* and add Options::val…
2018-03-14 18:05:48 +01:00
chriseth
abc7a45230
Merge pull request #3725 from ethereum/blockhashNoCall
...
Allow ``block.blockhash`` without it being called.
2018-03-14 18:04:40 +01:00
Daniel Kirchner
d63d41b3b5
test: Rename test/TestHelper.* to test/Options.* and add Options::validate().
2018-03-14 12:04:04 +01:00
chriseth
834d63de2c
Allow `block.blockhash
` without being called.
2018-03-13 17:34:21 +01:00
chriseth
eecc26deec
Make external library functions accessible.
2018-03-13 17:18:46 +01:00
chriseth
51f9e350b1
Tests.
2018-03-13 16:55:41 +01:00
chriseth
a3593df43b
Test for using staticcall for view and pure functions.
2018-03-06 15:30:18 +01:00
Daniel Kirchner
2213f9946b
Improved gasleft tests.
2018-03-05 18:45:02 +01:00
Daniel Kirchner
298bdeec49
Remove unstable test case.
2018-03-05 13:28:27 +01:00
Daniel Kirchner
c633c0eacb
Move msg.gas to global function gasleft(). Closes #2971 .
2018-03-05 11:18:04 +01:00
chriseth
d64aa0eaad
Some more scoping tests.
2018-02-27 12:41:32 +01:00
chriseth
88a5c66f4a
Only active variables at the point of their declaration.
2018-02-27 12:17:25 +01:00
chriseth
388718b59f
Introduce emit statement.
2018-02-22 15:17:30 +01:00
chriseth
89a8f4096c
Provide proper input for test call.
2018-02-20 19:31:26 +01:00
chriseth
2b5a5a8669
Make addmod and mulmod revert if the last argument is zero.
2018-02-15 13:52:17 +01:00
chriseth
aea9e7fe54
Add tests for selectors for public variables.
2018-02-13 14:15:02 +01:00
chriseth
6807010dc7
Prevent libraries from being called.
2018-01-19 16:27:44 +01:00
Yoichi Hirai
14707b27e2
Merge pull request #3183 from federicobond/fix-event-parsing
...
Fix event parsing. Refs #3175
2017-12-12 11:12:18 +01:00
Federico Bond
14fd647b85
Fix event parsing. Refs #3175
2017-11-22 23:08:12 -03:00
chriseth
6dbc34e16e
If statement for Iulia / inline assembly.
2017-11-22 16:25:24 +01:00
Balajiganapathi S
165857b1d4
Allow constant integer variables as array lengths.
2017-11-22 01:41:46 +00:00
chriseth
a3db1fc197
Do not accept truncated function selectors.
2017-10-17 23:17:36 +02:00
chriseth
6001bd1406
Allocate one byte per memory byte array element instead of 32.
2017-10-16 22:29:31 +02:00
Alex Beregszaszi
9ee619c9bb
Snarks test using Byzantium precompiles
...
* Snark tests.
* Verifying routine.
* Example proof.
* Update precompiled positions to Byzantium ruleset.
2017-10-09 11:09:20 +02:00
Alex Beregszaszi
7cb4d714c7
Fix overload resolution when conflict is with members of address (balance, transfer, etc)
2017-09-28 13:57:19 +01:00
Alex Beregszaszi
9ea812598d
Fix other test to use ABI_CHECK
2017-09-27 00:50:35 +01:00
chriseth
95ec2fd0b6
Fix encoded EndToEnd inputs.
2017-09-25 19:33:38 +02:00
chriseth
8e4f242274
Improved error messages for EndToEnd tests.
2017-09-25 10:49:25 +01:00
Alex Beregszaszi
3b813ed295
Support multiple assignment in inline assembly
2017-09-20 11:16:23 +02:00
Alex Beregszaszi
ada68bcee6
Add tests for constant bytes/strings
2017-09-18 22:25:50 +01:00
chriseth
70d70e7816
Implement struct encoder.
2017-09-16 12:31:12 +01:00
chriseth
6385641f6e
Fix tests.
2017-09-16 12:31:12 +01:00
chriseth
44825d1c1e
Expect test to fail until implemented.
2017-09-16 12:12:44 +01:00
chriseth
22f85d5af3
Update tests and error messages.
2017-09-16 12:12:43 +01:00
chriseth
2e72bd163a
Allow structs as part of function interfaces.
2017-09-16 12:12:43 +01:00
Alex Beregszaszi
5c9dbd5083
Merge pull request #2473 from ethereum/functiontype-sig
...
Add .selector member on function types
2017-09-13 17:35:48 +01:00
Alex Beregszaszi
8b166c3636
Use hashing function in tests
2017-09-13 11:40:57 +01:00
Alex Beregszaszi
fd1f8ab38b
Rename .sig to .selector on function types
2017-09-13 11:40:57 +01:00
Alex Beregszaszi
88946f9f03
Add tests for function type sigs
2017-09-13 11:40:57 +01:00
chriseth
c83768c426
Fix tests
2017-09-06 13:52:29 +02:00
Alex Beregszaszi
50047bf82c
Change tests to use view or pure as appropriate
2017-09-06 13:50:49 +02:00
chriseth
38446a9669
ABI encoder tests.
2017-08-14 13:11:38 +01:00
chriseth
95acbc7a9f
Some more ABI tests.
2017-08-10 15:49:02 +02:00
chriseth
38e9505a83
Merge pull request #2673 from ethereum/builtin-gas
...
Disallow gas modifier on sha256/ripemd160/ecrecover
2017-08-04 14:43:15 +02:00
Alex Beregszaszi
b7642dc8a7
Disallow gas modifier on sha255/ripemd160/ecrecover
2017-08-01 20:55:01 +01:00
Alex Beregszaszi
f63bb0a442
Add test for call/callcode/delegatecall to invalid address
2017-08-01 20:51:52 +01:00
Alex Beregszaszi
b3061225bc
.delegatecall() should always return a boolean of execution status
2017-08-01 20:50:03 +01:00
Alex Beregszaszi
6ea4b7fa37
Add test for tight packing keccak256/sha256/ripemd160
2017-08-01 02:11:17 +01:00
chriseth
6dba8cf0f4
Use keccak256 instead of sha3
2017-07-28 16:57:34 +02:00
chriseth
368a8a62c1
Test case for invalid ecrecover call.
2017-07-28 15:32:42 +02:00
chriseth
7c7c2baa82
Re-allow multiple modifiers per function.
2017-07-27 13:45:39 +02:00
Alex Beregszaszi
ee3a2c0599
Add end-to-end test
2017-07-13 15:18:40 +02:00
chriseth
b7a59652f1
Merge pull request #2501 from ethereum/undef-macros
...
Move UndefMacros from libdevcore to libsolidity/parsing
2017-07-12 15:07:20 +02:00
chriseth
0cb93a5f7b
Test for internal "variable already present" error.
2017-07-04 19:33:54 +02:00
Alex Beregszaszi
b615b01449
Move UndefMacros from libdevcore to libsolidity/parsing
2017-07-02 00:09:46 +01:00
Yoichi Hirai
4dfc413b8e
test: add a test passing an invalid boolean value as an event argument
...
Fixes #1381
2017-07-01 10:35:51 +01:00
Yoichi Hirai
fdc9ef14ad
test: add an assertion about storing an invalid boolean into the memory
2017-07-01 10:35:51 +01:00
Yoichi Hirai
7cbf6a86dd
test: add a test about storing an invalid boolean
2017-07-01 10:35:51 +01:00
chriseth
46caff4597
Test for negative stack height.
2017-06-28 16:55:49 +01:00
chriseth
1a3066c3a1
Test about semantics of "swap" in storage.
2017-06-26 16:31:36 +02:00
chriseth
f36e021ffc
Test for passing empty string literal as function argument.
2017-06-22 17:39:29 +02:00
chriseth
2f0826ffd7
Functionality tests for for.
2017-06-16 10:56:21 +01:00
chriseth
b098b363b5
Test for embedded functions.
2017-06-08 15:52:45 +02:00
chriseth
64ddb176bb
Test for accessing outer inline assembly scope.
2017-06-08 15:52:45 +02:00
chriseth
97cc968a13
Initial EVM1.5 assembly implementation.
2017-06-08 15:52:44 +02:00
Alex Beregszaszi
dcb7c51920
Add inline assembly test for sha3/keccak256
2017-05-30 13:57:44 +01:00
Alex Beregszaszi
ff33297786
Add test for sha3() == keccak256()
2017-05-30 12:33:04 +01:00
Alex Beregszaszi
9e1c509cf5
Use keccak256() in tests (and not sha3())
2017-05-30 12:33:04 +01:00
chriseth
28f10f4783
Remove error label / invalid jump label.
2017-04-28 13:14:52 +02:00
chriseth
478f2997ea
Storage access from inline assembly.
2017-04-25 16:49:04 +02:00
chriseth
4afd54b235
Convert storge access tests to new explicit slot / offset access.
2017-04-25 16:49:04 +02:00
chriseth
f13c8af3f9
Make tests comply with stack height checks.
2017-04-25 16:49:03 +02:00
Alex Beregszaszi
5a71e4f1a7
Add more complex tests for interfaces
2017-03-17 17:06:53 +00:00
chriseth
0c8a766146
Merge pull request #1698 from ethereum/exp-notation
...
Fix scientific notation in number literals
2017-03-15 14:55:45 +01:00
Alex Beregszaszi
b28be08b6d
Add tests for negative base
2017-03-15 13:07:28 +00:00
Alex Beregszaszi
b0a23fa77d
Add tests for fractional numbers in exponential notation
2017-03-15 13:06:27 +00:00
Alex Beregszaszi
6014c3fe16
Add tests for scientific notation
2017-03-15 13:06:26 +00:00
Yoichi Hirai
d134fda0c0
Merge pull request #1729 from ethereum/constantvariables
...
Only allow pure expressions for constant state variables.
2017-03-15 10:03:35 +01:00
chriseth
47cd8964b8
Require and Assert.
2017-03-14 14:21:33 +01:00
chriseth
592cec7e90
Disallow constants that are neither value types nor strings.
2017-03-13 13:30:23 +01:00
chriseth
14948e514d
Allow enum values for constants.
2017-03-13 13:30:23 +01:00
chriseth
49cfacced2
End to end tests for constants.
2017-03-13 13:30:23 +01:00
chriseth
fe5f85ef34
Test for array singletons.
2017-03-06 14:42:28 +01:00
Yoichi Hirai
cfbbd89daf
Merge pull request #1702 from ethereum/assertError
...
Change effect of assert to invalid opcode.
2017-03-03 18:25:50 +01:00
Alex Beregszaszi
4d290e551c
Disallow setting .gas() on .transfer()
2017-02-24 00:27:36 +00:00
Alex Beregszaszi
cde027d144
Fix test for gas overloading in .transfer()
2017-02-24 00:18:18 +00:00
Alex Beregszaszi
81006dae98
Support gas modifier on addr.transfer()
2017-02-24 00:18:18 +00:00
Alex Beregszaszi
16e48219d3
Add test for address.transfer()
2017-02-24 00:17:45 +00:00
chriseth
4b1e8111cc
Remove assert for now.
2017-02-23 19:43:40 +01:00
chriseth
0d8a9c3289
Merge pull request #1661 from ethereum/asm-revert
...
Implement REVERT (EIP140)
2017-02-13 14:56:22 +01:00
chriseth
e2349f9d5d
Merge pull request #1676 from ethereum/test-modifytimestamp
...
Add blockTimestamp and do not rely on mining time (soltest)
2017-02-13 14:54:06 +01:00
Alex Beregszaszi
30cfad3548
Check for state changes in revert() tests
2017-02-10 22:44:29 +00:00
Alex Beregszaszi
f26fe5bc1c
Add tests for revert()
2017-02-10 22:44:29 +00:00
Alex Beregszaszi
8429c03f2a
Add tests for assert()
2017-02-10 13:29:17 +00:00
Alex Beregszaszi
a82acba49a
Compare start/end timestamp
2017-02-10 13:26:11 +00:00
Alex Beregszaszi
4cf44f1b41
Do not use modifyTimestamp where not needed
2017-02-10 13:24:56 +00:00
Alex Beregszaszi
0b61f13c7f
Add more tests for function type conversion
2017-02-01 12:23:47 +00:00
Alex Beregszaszi
eb530aa217
Add tests for invalid instruction
2017-01-27 21:24:58 +00:00
chriseth
8e5f1c0d50
Test double inclusion of bytecode.
2017-01-24 17:41:31 +01:00
chriseth
dea59bfbdc
Test for initializing recursive structs.
2017-01-24 12:06:40 +01:00
chriseth
b52a60402d
Merge pull request #1245 from ethereum/1215
...
Allow multiple events of the same name
2017-01-24 11:52:21 +01:00
Yoichi Hirai
8dc306d62b
test: add a test case about inheriting multiple events of the same name
2017-01-23 15:25:13 +01:00
Yoichi Hirai
567139486f
test: somehow log counting system has changed
2017-01-23 15:25:13 +01:00
Yoichi Hirai
4c09e81c3e
test: check the results of function calls in the test for multiple events of the same name
2017-01-23 15:25:13 +01:00
Yoichi Hirai
133d1c05e1
test: fixing inconsistent usage of end-to-end test framework
2017-01-23 15:25:13 +01:00
Yoichi Hirai
0e85e35a7f
test: Add an end-to-end test about multiple events of the same name
...
See #1215
2017-01-23 15:25:13 +01:00
chriseth
df4ef74199
Add tests for internal constructor.
2017-01-20 19:22:39 +01:00
chriseth
d3a391c136
Provide fallback for linking.
2017-01-18 17:41:36 +01:00
Rhett Aultman
1f30982ab5
Use fully-qualified names for linking, too
...
Using libraries leaves behind a library link reference in the binary
which the linker must later resolve. These link references were still
being generated by name and not by fully-qualified name. This would
lead to a link-time collision between two libraries having the same
name but in different source units.
This change changes linker symbols over to fully-qualified names,
which resolves that issue. This does potentially introduce a new
problem, which is that linker symbols appear to be limited to 36
characters and are truncated. Storing paths extends the average
symbol size, and it would be great if truncation was from the tail
rather than the head.
2017-01-16 12:32:57 -05:00
Yoichi Hirai
42b6726173
analysis: allow some shadowings explicitly
2017-01-11 18:28:11 +01:00
Yoichi Hirai
96ca706353
test: add a test case for #1286
2017-01-02 17:58:33 +01:00
chriseth
08a11e309f
Fix tests.
2016-12-13 17:02:28 +01:00
Yoichi Hirai
932e7887bd
test: add tests that tries different types on <<=
2016-12-13 16:35:42 +01:00
chriseth
2fac1d23a7
Tests for bytes.
2016-12-12 11:12:12 +01:00
chriseth
7bc2ecf30a
Correct test expectations.
2016-12-12 11:12:12 +01:00
chriseth
2738045030
Cleaner shift handling and type conversion for binary operations.
2016-12-12 11:12:12 +01:00
chriseth
2df60bec92
Type after shift should be type of left operand.
2016-12-12 11:12:12 +01:00
Alex Beregszaszi
b8b4f5e9f9
Support bitshifting in variables
2016-12-12 11:12:10 +01:00
chriseth
84443eb560
Merge pull request #1351 from ethereum/truncate_bit
...
Truncate a boolean from calldata into one bit
2016-12-08 16:15:35 +01:00
Alex Beregszaszi
c88f34c781
Remove unneeded optimised test from EndToEndTest
2016-12-01 16:04:00 +01:00
chriseth
1e35526eb6
Fix tests.
2016-12-01 16:03:59 +01:00
chriseth
9db14ce673
Merge pull request #1458 from federicobond/r-literals
...
Use more R string literals in tests
2016-12-01 15:03:27 +01:00
Federico Bond
6ce41b566d
Use more R string literals in tests
2016-12-01 00:50:15 -03:00
Alex Beregszaszi
610027cd26
Test that contracts separated by comments are compiled
2016-11-30 23:54:02 +00:00
Yoichi Hirai
b16cdbb57e
test: add a test that witnesses #1318
2016-11-30 17:40:34 +01:00
Alex Beregszaszi
25c5dd48de
Rename testSolidityAgainstCpp* to testContractAgainstCpp*
2016-11-29 21:54:28 +00:00
Alex Beregszaszi
d83dd59178
Move ExecutionFramework to the dev::test namespace
2016-11-29 21:54:27 +00:00
Alex Beregszaszi
a226db7338
Split out Solidity-specific part of ExecutionFramework
2016-11-29 21:54:27 +00: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
VoR0220
3f9f725737
Fix licensing headers
...
Signed-off-by: VoR0220 <rj@erisindustries.com>
2016-11-23 12:22:33 +01:00
Alex Beregszaszi
a35ca910c7
Rename test contract names to capitalised
2016-11-17 17:23:35 +00:00
Alex Beregszaszi
7af360882e
Add missing payable constructors
2016-11-17 17:23:35 +00:00
chriseth
ec31d08775
Change encoding to address-funid and add "function" as ABI type.
2016-11-16 14:37:19 +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
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
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
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
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
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
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
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
681b130dc8
Test case for overflow in storage.
2016-10-31 16:40:19 +01:00
Yoichi Hirai
58477c233d
test: add more tests about state variable access under base contract names
2016-10-24 19:31:51 +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
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
Alex Beregszaszi
59603f7b8e
Add tests for constant shifts
2016-10-20 00:03:09 +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
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
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
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
6a55405160
Fix problem with release version string.
2016-09-08 17:56:28 +02:00
chriseth
9ca7472089
Provide gas stipend manually for send(0).
2016-09-06 12:37:01 +02:00
chriseth
ff11aa1927
Change placeholder style.
2016-09-05 21:32:27 +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
chriseth
02984b8de1
Require ";" after "_"
2016-09-05 14:54:50 +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
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
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
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
chriseth
b2507e9f10
Merge pull request #839 from chriseth/checkcode
...
BREAKING: Make function calls throw if target does not have code.
2016-08-17 16:44:15 +02:00
chriseth
d6579a0a5f
Merge pull request #888 from chriseth/throwOnDivZero
...
Throw on division by zero.
2016-08-17 16:43:13 +02:00
chriseth
774bb8ab3b
Make function calls throw if target does not have code.
...
Low-level calls still just execute and will actually report "success".
This allows `x.call.value(y)()` for x being a non-contract account.
2016-08-17 11:30:40 +02:00
chriseth
9c83109549
BREAKING: return only exits current function/modifier
2016-08-17 11:29:31 +02:00
chriseth
e7683f4722
Merge pull request #836 from chriseth/unusedunderscore
...
BREAKING: Require modifiers to contain "_".
2016-08-17 11:28:02 +02:00
chriseth
e7084d9e16
Throw on division by zero.
2016-08-17 11:27:15 +02:00
chriseth
d5505e21eb
Merge pull request #838 from chriseth/ecrecover
...
Make ecrecover return zero for malformed input.
2016-08-17 11:05:20 +02:00
chriseth
15b85e2ea8
Fix tests.
2016-08-16 19:04:11 +02:00
chriseth
d731225d02
Actually better to return zero on error.
2016-08-16 14:53:01 +02:00
chriseth
034d436933
Make ecrecover throw for malformed input.
2016-08-16 14:53:01 +02:00
chriseth
2a560b798b
Throw if contract creation fails.
2016-08-16 14:49:44 +02:00
Bob Summerwill
4ee2114127
Make the Solidity repository standalone.
...
This commit is the culmination of several months of work to decouple Solidity from the webthree-umbrella so that it can be developed in parallel with cpp-ethereum (the Ethereum C++ runtime) and so that even for the Solidity unit-tests there is no hard-dependency onto the C++ runtime.
The Tests-over-IPC refactoring was a major step in the same process which was already committed.
This commit contains the following changes:
- A subset of the CMake functionality in webthree-helpers was extracted and tailored for Solidity into ./cmake. Further cleanup is certainly possible.
- A subset of the libdevcore functionality in libweb3core was extracted and tailored for Solidity into ./libdevcore. Further cleanup is certainly possible
- The gas price constants in EVMSchedule were orphaned into libevmasm.
- Some other refactorings and cleanups were made to sever unnecessary EVM dependencies in the Solidity unit-tests.
- TravisCI and Appveyor support was added, covering builds and running of the unit-tests (Linux and macOS only for now)
- A bug-fix was made to get the Tests-over-IPC running on macOS.
- There are still reliability issues in the unit-tests, which need immediate attention. The Travis build has been flipped to run the unit-tests 5 times, to try to flush these out.
- The Emscripten automation which was previously in webthree-umbrella was merged into the TravisCI automation here.
- The development ZIP deployment step has been commented out, but we will want to read that ONLY for release branch.
Further iteration on these changes will definitely be needed, but I feel these have got to sufficient maturity than holding them back further isn't winning us anything. It is go time :-)
2016-08-01 01:45:11 -07:00
chriseth
58cc6cbb37
Bugfix: Allocate empty array.
2016-07-28 17:24:18 +02:00
chriseth
e5db096da9
Fix some more tests.
2016-06-28 23:18:55 +02:00
Dimitry
763faf7b0e
replace BalanceAt
...
add addressHasCode
remove m_state and sealengine
2016-06-28 23:18:55 +02:00
chriseth
ce2258b71e
Balance and storage.
2016-06-28 23:18:54 +02:00
chriseth
966709b7d7
logs
2016-06-28 23:18:54 +02:00
chriseth
d6e39054e0
Refactor testing via IPC.
2016-06-28 23:18:54 +02:00
chriseth
1c3a64026b
Add a test for a struct accessor.
2016-06-04 21:51:48 +02:00
chriseth
754a992500
Inaccessible dynamic types
2016-06-02 12:52:25 +02:00
chriseth
a09583a2a4
Tests for invalid cleanup and missing bool conversion code.
2016-05-20 16:52:38 +02:00
chriseth
775b757d0e
Merge pull request #545 from chriseth/accessFunLabels
...
Allow access to functions in inline assembly.
2016-05-17 23:59:13 +02:00
chriseth
4b445b898e
Merge pull request #546 from chriseth/fixiszero
...
Correctly use not/bnot/iszero.
2016-05-14 00:58:55 +02:00
chriseth
67ca3bb4b9
Allow access to functions in inline assembly.
2016-05-12 12:30:48 +02:00
chriseth
d4206b7cd0
Remove unused tests and add asserts for not implemented parts in code generation.
...
quick fix on christian's rational
change so that ubuntu will stop yelling
be more specific with rational declaration for Windows sake
rational in namespace correction for windows
2016-05-10 16:03:33 -05:00
VoR0220
82039b732e
added bytes conversion tests, resolved that, converted to binary scaling, refactored the find algo to prevent large numbers and take into account integer bytes
...
think we're good on solidity type name resolution now
removed couts
updates to documentation and more removed couts along with literal value implementation
forgot semicolons
2016-05-09 11:41:03 -05:00
RJ Catalano
9a075458ad
initial work for fixed types...potentially needing a constant literal type for this
...
notation
Rational implemented...trying to figure out exponential
fix for token bug, also quick fix for the wei and seconds
fixed problem with var...probably a conversion problem for fixed in size capabilities
adding fixed type tests
Removing bitshift and regrouping fixed type tests together
size capabilities functioning properly for fixed types
got exponents up and working with their inverse, changed a few of the tests....something is working that likely shouldn't be
slight changes to how to flip the rational negative around...still trying to figure it out
tests added
updated tests
odd differences in trying soltest from solc binary, let me know if you can replicate
test not working for odd reason
fixed test problem with fixed literals...still need a way to log this error
broken up the tests, added some, changed some things in types and began compiler work
moar tests and prepping for rebuilding much of the types.cpp file
further fixing
initial work for fixed types...potentially needing a constant literal type for this
2016-05-09 11:41:02 -05:00
chriseth
a927efb151
Correctly use not/bnot/iszero.
...
A long time ago, some opcodes were renamed. Now we should only have
not (bitwise negation) and iszero (logical negation).
2016-05-09 10:52:23 +02:00
chriseth
e6b6e27bd7
Some more tests.
2016-05-03 22:48:53 +02:00
chriseth
7ea3d950d7
Allow calling internal functions of libraries.
...
Internal functions of libraries can be called as if the library were a
base contract of the calling contract. As the calling convention for
internal functions is to not create a new call context, the code of
these functions will be pulled into the context of the caller,
duplicating their code. This might pull in code of further internal or
even private functions.
The use case for such functions is to allow libraries which can operate
on memory types such that these types can also be modified in place.
2016-05-03 22:41:18 +02:00
chriseth
c126ec84a3
Test for bug in static array constructor argument decoder.
2016-04-15 18:42:44 +02:00
chriseth
82175fbd2b
Test for bug when deleting dynamic array of structs.
2016-04-15 16:49:26 +02:00
chriseth
98b686c672
Test to check we correctly clean higher order bits for index access.
2016-03-31 01:25:45 +02:00
chriseth
f049430723
Code generation (missing external access and source locations).
2016-03-30 02:37:00 +02:00
chriseth
1bf87c6c2b
Set version to 0.3.0
2016-03-11 17:52:24 +01:00
chriseth
e5514becb8
BREAKING: Implement delegatecall and make default for library calls.
2016-03-11 17:49:32 +01:00
RJ Catalano
7b918a7bc7
changes to redefine the token list, the scanner, and the parser and how they pass around variable types of different sizes
...
not ready for change to FixedPoint just yet
made this more const correct and added a switch statement for easier reading
2016-02-18 11:22:52 -06:00
chriseth
29faf1b298
Index access for bytesXX.
2016-02-09 17:07:04 +01:00
Lu Guanqun
51caa04238
add more test cases for cond-expr
2016-01-22 17:14:01 +00:00
Lu Guanqun
d36537e737
cond-expr: use the mobile type instead of the original type
2016-01-22 17:14:01 +00:00
Lu Guanqun
c8b0533933
[cond-expr] change the end to end test
2016-01-22 17:14:01 +00:00
Lu Guanqun
ac3019298a
[cond-expr] add a test for different types
2016-01-22 17:14:01 +00:00
Lu Guanqun
1cd3288311
[cond-expr] add a test to assign memory to storage
2016-01-22 17:14:01 +00:00
Lu Guanqun
bf7daf0814
[cond-expr] don't allow conditional as left value for the first stage
2016-01-22 17:14:00 +00:00
Lu Guanqun
b003290638
[cond-expr] fixup according to code review
2016-01-22 17:14:00 +00:00
Lu Guanqun
db6ce6d8a1
comment out one un-supported test case
2016-01-22 17:14:00 +00:00
Lu Guanqun
08493589c1
fixup end to end test
2016-01-22 17:14:00 +00:00
Lu Guanqun
0a45fe04f3
[cond-expr] add end to end test
2016-01-22 17:14:00 +00:00
Lu Guanqun
e130bc7e7c
check whether break/continue is in the loop
2016-01-15 15:12:23 +08:00
RJ Catalano
c45593a444
clarification on dynamic arrays, switcheroo on typepointer, and a documentation test added
2016-01-11 23:41:20 -06:00
RJ Catalano
c7df6d0310
one last test for long strings
2016-01-11 00:48:02 -06:00
RJ
5a3b40f802
Update SolidityEndToEndTest.cpp
2016-01-10 21:36:47 -06:00
RJ
d751b9085c
Update SolidityEndToEndTest.cpp
2016-01-10 01:12:52 -06:00
Lu Guanqun
208429644d
add a test case for decayed tuple expression as left value
2016-01-04 16:11:43 +08:00
chriseth
54e3637d23
Add structs and enums to contract types.
2015-12-18 16:50:14 +01:00
chriseth
8342424815
Increment version to 0.2.0 (includes breaking changes).
2015-12-01 16:06:14 +01:00
chriseth
7f415da886
Code generation for calling bound methods.
2015-12-01 12:35:34 +01:00
chriseth
a8736b7b27
Merge pull request #256 from chriseth/selfdestruct
...
Introduce selfdestruct alias for suicide.
2015-11-30 16:06:18 +01:00
chriseth
6796afc2f8
Bugfix for constructor unpacking with fixed-size arrays.
2015-11-29 01:03:39 +01:00
chriseth
b97bb086de
Introduce selfdestruct alias for suicide.
2015-11-29 00:10:07 +01:00
chriseth
879844dd0a
Code generation for creating arrays.
2015-11-26 13:10:12 +01:00
chriseth
30b325fdc1
Allow "new expressions" also for general type names.
...
Breaking change: If you want to send value with a contract creation, you
have to use parentheses now:
`(new ContractName).value(2 ether)(arg1, arg2)`
2015-11-26 13:10:12 +01:00
chriseth
588e4232eb
Test for allocation bug.
2015-11-24 14:54:18 +01:00
chriseth
8dfc964e7d
Merge pull request #227 from chriseth/addmod
...
Addmod and mulmod.
2015-11-19 13:16:13 +01:00
Gav Wood
3be0ae6e2c
Merge pull request #204 from ethereum/hot_gav
...
The Big Refactor
2015-11-19 12:20:46 +01:00
chriseth
0cf8d022ae
Addmod and mulmod.
2015-11-18 17:12:39 +01:00
chriseth
f4de369bad
Merge pull request #218 from chriseth/fix_overwriteMemory
...
Fix memory overwrite problem for arrays.
2015-11-17 14:46:19 +01:00
chriseth
0c900f9b8a
Fix memory overwrite problem for arrays.
2015-11-16 18:32:21 +01:00
chriseth
a35f91816b
Fix dynamic indexed event arguments - applies sha3.
2015-11-16 17:09:09 +01:00
Gav Wood
a89fa99994
New vocab.
2015-11-06 13:26:20 +01:00
chriseth
a5c227778d
Bugfix: Returning literal strings in tuples.
2015-10-31 23:13:45 +01:00
chriseth
b4f561680a
Store docstrings in AST annotations.
2015-10-26 15:24:36 +01:00
chriseth
e3dffb611f
File reorganisation.
2015-10-21 00:46:01 +02:00
chriseth
ead0478f26
Fix errors when struct array type is used on its own.
2015-10-16 14:36:30 +02:00
chriseth
029b819489
Wildcards.
2015-10-15 17:38:42 +02:00
chriseth
039b2a764f
Destructuring assignments.
2015-10-15 17:38:42 +02:00
chriseth
7ebd536e79
Tuple expressions.
2015-10-15 17:38:42 +02:00
chriseth
7ba42f4707
Merge pull request #130 from LefterisJP/dynamic_array_push
...
Dynamic array push
2015-10-15 17:37:15 +02:00
Lefteris Karapetsas
a823de2d58
push() for byte arrays also properly implemented
2015-10-15 14:37:11 +02:00
Lefteris Karapetsas
9224c1f712
Working implementation of arraypush
...
ByteArrayPush() gets a test but is ignored for now, since there are
still some issues with its implementation
2015-10-15 13:54:59 +02:00
Lefteris Karapetsas
a521843f6b
Implement Dynamic array push and fix test
...
Still a work in progress. There is a disturbance in the stack at the
moment and that's why there are some cout statements left for debugging.
2015-10-15 10:52:30 +02:00
Lefteris Karapetsas
763b544822
Add a dynamic array push() test
2015-10-15 10:52:30 +02:00
LianaHus
c3491e4469
errors instead of exceptions
...
Conflicts:
libsolidity/CompilerStack.cpp
libsolidity/NameAndTypeResolver.cpp
libsolidity/NameAndTypeResolver.h
libsolidity/TypeChecker.cpp
test/libsolidity/SolidityNameAndTypeResolution.cpp
2015-10-14 20:37:41 +02:00
chriseth
c54a033bf0
Tests for multi variable declaration.
2015-10-09 16:26:27 +02:00
chriseth
24d04087d2
Resolve binary dependencies properly.
2015-10-07 17:35:07 +02:00
chriseth
68bf6e60c5
Merge pull request #122 from chriseth/anonymousEventsWithFourIndexedParams
...
Allow four indexed arguments for anynomous events.
2015-10-07 17:01:37 +02:00
chriseth
b6ddde9372
Allow four indexed arguments for anynomous events.
2015-10-07 16:40:54 +02:00
chriseth
0297a213fe
Reject ether sent to library.
2015-10-06 22:55:45 +02:00
chriseth
d35a4b849d
Merge pull request #117 from chriseth/internalTypesForLibrary
...
Internal types for library
2015-10-06 18:29:05 +02:00
chriseth
99351aebe0
Compiler version stamp.
2015-10-06 14:20:06 +02:00
chriseth
bf5b387954
Provide access to scoped structs.
2015-10-06 14:20:06 +02:00
chriseth
bc609c55c0
Compute canonical names of types for function signatures.
2015-10-06 14:20:06 +02:00
chriseth
ce25ddfa6a
Encode storage items correctly for library calls.
2015-10-06 14:20:06 +02:00
chriseth
d2332769d3
Test for internal types.
2015-10-06 14:19:30 +02:00
chriseth
0950aa99a0
Test long constructor arguments.
2015-10-05 11:09:33 +02:00
chriseth
da408640ca
Store small byte arrays and strings in storage in one slot with their
...
length.
2015-10-02 13:12:23 +02:00
chriseth
6161ec96ff
Bugfix in calldata unpacker.
...
The offset was not specified correctly if memory activity preceded the
unpacker.
2015-10-01 16:50:11 +02:00
LianaHus
c096c3c349
improved the test
2015-09-23 17:31:47 +02:00
LianaHus
9547c4563c
fixed-sized arrays as return type
...
Conflicts:
test/libsolidity/SolidityEndToEndTest.cpp
2015-09-23 17:31:37 +02:00
chriseth
efdea76d5e
Merge pull request #85 from chriseth/warnings
...
Support mulitple errors and warnings.
2015-09-23 14:42:54 +02:00
LianaHus
ed76798406
fixed the test
2015-09-22 14:03:09 +02:00
chriseth
34a81fd60e
Refactoring: Check types outside of AST and recover from some errors.
2015-09-21 20:03:05 +02:00
LianaHus
e50400082b
fixed using string as a type for struct member
2015-09-17 15:15:46 +02:00
LianaHus
e89b8d516b
test
...
Conflicts:
test/libsolidity/SolidityEndToEndTest.cpp
2015-09-17 15:15:36 +02:00
LianaHus
279a36b6f8
throw statement implementation
2015-09-16 13:25:32 +02:00
LianaHus
152bc642a6
style fix
2015-09-15 12:10:23 +02:00
LianaHus
dbb36a7a7b
fixed rebase
2015-09-15 11:44:04 +02:00
LianaHus
9d44e65932
moved the test
...
Conflicts:
test/libsolidity/SolidityEndToEndTest.cpp
test/libsolidity/SolidityNameAndTypeResolution.cpp
2015-09-15 11:41:40 +02:00
LianaHus
466f5a4b88
returned test for exceptions in constructor
2015-09-15 11:40:20 +02:00
LianaHus
bc91464131
- changed implementation
...
- style fixes
2015-09-15 11:40:19 +02:00
LianaHus
7dbff2489f
some fixes in tests
2015-09-15 11:40:19 +02:00
LianaHus
e21632555c
added compile time check for out of bounds access for ordinary arrays
...
todo: check for dynamicaly sized arrays
Conflicts:
test/libsolidity/SolidityEndToEndTest.cpp
2015-09-15 11:40:14 +02:00
LianaHus
626a57826c
test
2015-09-15 11:37:56 +02:00
chriseth
976c380b61
Possibility to call library functions.
2015-09-11 15:21:37 +02:00
chriseth
3fc2561223
Merge pull request #51 from ethereum/revert-25-sol_strings_as_mapping_keys
...
Revert "added check for string as mapping key for local var."
2015-09-09 16:30:54 +02:00
chriseth
9967ae4038
Stylistic corrections.
2015-09-09 16:15:35 +02:00
chriseth
985eb80695
Fix for constant strings.
2015-09-08 16:51:14 +02:00
chriseth
9fc775269b
Revert "added check for string as mapping key for local var."
2015-09-07 22:43:23 +02:00
LianaHus
4c7777128b
added check for string as mapping key for local var.
2015-08-24 14:24:10 +02:00
LianaHus
ffcf18406b
added test to check string as mapping key
2015-08-24 13:48:20 +02:00
LianaHus
1af8ff0121
add tests for state variables accessors. normal and constant
...
fixed the issue with accessors for constant state variables
2015-08-21 17:57:57 +02:00
chriseth
e985b285be
Move Solidity tests.
2015-08-19 21:54:09 +02:00