Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning: Invoking events without "emit" prefix is deprecated #8

Closed
alext234 opened this Issue Mar 13, 2018 · 4 comments

Comments

Projects
None yet
4 participants
@alext234
Copy link

commented Mar 13, 2018

This is for new solc compiler (after updating with nix-channel).

solc version

 solc --version
solc, the solidity compiler commandline interface
Version: 0.4.21+commit.dfe3193c.Linux.g++

A bunch of warnings when building

~/ds-test$ make
dapp build
+ dapp clean
+ rm -rf out
+ solc --overwrite --abi --bin --bin-runtime = -o out/ src/test.sol
src/test.sol:44:9: Warning: Invoking events without "emit" prefix is deprecated.
        eventListener(target, true);
        ^-------------------------^
src/test.sol:51:9: Warning: Invoking events without "emit" prefix is deprecated.
        log_named_uint("gas", startGas - endGas);
        ^--------------------------------------^
src/test.sol:56:13: Warning: Invoking events without "emit" prefix is deprecated.
            log_bytes32("Assertion failed");
            ^-----------------------------^
src/test.sol:63:13: Warning: Invoking events without "emit" prefix is deprecated.
            log_bytes32("Error: Wrong `address' value");
            ^-----------------------------------------^
src/test.sol:64:13: Warning: Invoking events without "emit" prefix is deprecated.
            log_named_address("  Expected", b);
            ^--------------------------------^
src/test.sol:65:13: Warning: Invoking events without "emit" prefix is deprecated.
            log_named_address("    Actual", a);
....
@cristianoKaKa

This comment has been minimized.

Copy link

commented Apr 6, 2018

Here is my code:
function abort() public onlySeller inState(State.Created)
{
Aborted();
state = State.Inactive;
seller.transfer(this.balance);
}
It warns :
Invoking events without "emit" prefix is deprecated.
Aborted();
^-------^
,
would you please help with that?What's wrong with that?
thx

@alext234

This comment has been minimized.

Copy link
Author

commented Apr 6, 2018

@cristianoKaKa you need to add emit in front ,

emit Aborted();

Anyway, this is not related to ds-test it seems.

@ethernomad

This comment has been minimized.

Copy link

commented Apr 10, 2018

This is a problem with ds-test:

lib/ds-test/src/test.sol:44:9: Warning: Invoking events without "emit" prefix is deprecated.
        eventListener(target, true);
        ^-------------------------^
lib/ds-test/src/test.sol:51:9: Warning: Invoking events without "emit" prefix is deprecated.
        log_named_uint("gas", startGas - endGas);
        ^--------------------------------------^
lib/ds-test/src/test.sol:56:13: Warning: Invoking events without "emit" prefix is deprecated.
            log_bytes32("Assertion failed");
            ^-----------------------------^
lib/ds-test/src/test.sol:63:13: Warning: Invoking events without "emit" prefix is deprecated.
            log_bytes32("Error: Wrong `address' value");
            ^-----------------------------------------^
lib/ds-test/src/test.sol:64:13: Warning: Invoking events without "emit" prefix is deprecated.
            log_named_address("  Expected", b);
            ^--------------------------------^
lib/ds-test/src/test.sol:65:13: Warning: Invoking events without "emit" prefix is deprecated.
            log_named_address("    Actual", a);
            ^--------------------------------^
lib/ds-test/src/test.sol:76:13: Warning: Invoking events without "emit" prefix is deprecated.
            log_bytes32("Error: Wrong `bytes32' value");
            ^-----------------------------------------^
lib/ds-test/src/test.sol:77:13: Warning: Invoking events without "emit" prefix is deprecated.
            log_named_bytes32("  Expected", b);
            ^--------------------------------^
lib/ds-test/src/test.sol:78:13: Warning: Invoking events without "emit" prefix is deprecated.
            log_named_bytes32("    Actual", a);
            ^--------------------------------^
lib/ds-test/src/test.sol:85:13: Warning: Invoking events without "emit" prefix is deprecated.
            log_bytes32("Error: Wrong fixed-point decimal");
            ^---------------------------------------------^
lib/ds-test/src/test.sol:86:13: Warning: Invoking events without "emit" prefix is deprecated.
            log_named_decimal_int("  Expected", b, decimals);
            ^----------------------------------------------^
lib/ds-test/src/test.sol:87:13: Warning: Invoking events without "emit" prefix is deprecated.
            log_named_decimal_int("    Actual", a, decimals);
            ^----------------------------------------------^
lib/ds-test/src/test.sol:94:13: Warning: Invoking events without "emit" prefix is deprecated.
            log_bytes32("Error: Wrong fixed-point decimal");
            ^---------------------------------------------^
lib/ds-test/src/test.sol:95:13: Warning: Invoking events without "emit" prefix is deprecated.
            log_named_decimal_uint("  Expected", b, decimals);
            ^-----------------------------------------------^
lib/ds-test/src/test.sol:96:13: Warning: Invoking events without "emit" prefix is deprecated.
            log_named_decimal_uint("    Actual", a, decimals);
            ^-----------------------------------------------^
lib/ds-test/src/test.sol:103:13: Warning: Invoking events without "emit" prefix is deprecated.
            log_bytes32("Error: Wrong `int' value");
            ^-------------------------------------^
lib/ds-test/src/test.sol:104:13: Warning: Invoking events without "emit" prefix is deprecated.
            log_named_int("  Expected", b);
            ^----------------------------^
lib/ds-test/src/test.sol:105:13: Warning: Invoking events without "emit" prefix is deprecated.
            log_named_int("    Actual", a);
            ^----------------------------^
lib/ds-test/src/test.sol:112:13: Warning: Invoking events without "emit" prefix is deprecated.
            log_bytes32("Error: Wrong `uint' value");
            ^--------------------------------------^
lib/ds-test/src/test.sol:113:13: Warning: Invoking events without "emit" prefix is deprecated.
            log_named_uint("  Expected", b);
            ^-----------------------------^
lib/ds-test/src/test.sol:114:13: Warning: Invoking events without "emit" prefix is deprecated.
            log_named_uint("    Actual", a);
            ^-----------------------------^
lib/ds-test/src/test.sol:133:13: Warning: Invoking events without "emit" prefix is deprecated.
            log_bytes32("Error: Wrong `bytes' value");
            ^---------------------------------------^
lib/ds-test/src/test.sol:134:13: Warning: Invoking events without "emit" prefix is deprecated.
            log_named_bytes32("  Expected", "[cannot show `bytes' value]");
            ^------------------------------------------------------------^
lib/ds-test/src/test.sol:135:13: Warning: Invoking events without "emit" prefix is deprecated.
            log_named_bytes32("  Actual", "[cannot show `bytes' value]");
            ^----------------------------------------------------------^
lib/ds-test/src/test.sol:48:25: Warning: "msg.gas" has been deprecated in favor of "gasleft()"
        uint startGas = msg.gas;
                        ^-----^
lib/ds-test/src/test.sol:50:23: Warning: "msg.gas" has been deprecated in favor of "gasleft()"
        uint endGas = msg.gas;
                      ^-----^
@levity

This comment has been minimized.

Copy link

commented Apr 19, 2018

I created a PR to fix this: #9

@alext234 alext234 closed this Apr 20, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.