Skip to content

Conversation

hiagopdutra
Copy link
Contributor

This PR is converting test/lint/lint-assertions.sh to test/lint/lint-assertions.py. It's an item of #24783.

@DrahtBot DrahtBot added the Tests label Apr 14, 2022
Copy link
Contributor

@Eunoia1729 Eunoia1729 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

concept ACK

@KevinMusgrave
Copy link
Contributor

Tested ACK 1e0a9ad

Before:

Assertions should not have side effects:

src/addrman.cpp:            assert(--nIds != nNew); // this means nNew was wrong, oh ow
src/bench/ccoins_caching.cpp:        assert(success = 2);
src/bench/checkblock.cpp:        assert(rewound ++);
src/bench/verify_script.cpp:        assert(success += 1);
src/node/coin.cpp:    assert(node.mempool -= 1);
CHECK_NONFATAL(condition) should be used instead of assert for RPC code.

src/rpc/blockchain.cpp:77:    assert(blockindex);
src/rpc/rawtransaction.cpp:469:            assert(false);

After:

Assertions should not have side effects:
src/addrman.cpp:            assert(--nIds != nNew); // this means nNew was wrong, oh ow
src/bench/ccoins_caching.cpp:        assert(success = 2);
src/bench/checkblock.cpp:        assert(rewound ++);
src/bench/verify_script.cpp:        assert(success += 1);
src/node/coin.cpp:    assert(node.mempool -= 1);

CHECK_NONFATAL(condition) should be used instead of assert for RPC code.
src/rpc/blockchain.cpp:77:    assert(blockindex);
src/rpc/rawtransaction.cpp:469:            assert(false);

@KevinMusgrave
Copy link
Contributor

I guess you should squash your commits, see: https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#squashing-commits

@hiagopdutra hiagopdutra force-pushed the port-assertions-linter branch from 1e0a9ad to 172c233 Compare April 22, 2022 12:46
@laanwj
Copy link
Member

laanwj commented Apr 25, 2022

Tested ACK 172c233

@laanwj laanwj merged commit 1e7db37 into bitcoin:master Apr 25, 2022
@hiagopdutra hiagopdutra deleted the port-assertions-linter branch April 25, 2022 19:33
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Apr 26, 2022
…rtions.py

172c233 Porting lint-assertions.sh to lint-assertions.py (hiago)

Pull request description:

  This PR is converting `test/lint/lint-assertions.sh` to `test/lint/lint-assertions.py`. It's an item of bitcoin#24783.

ACKs for top commit:
  laanwj:
    Tested ACK 172c233

Tree-SHA512: 94d5b03acfeaf2303fad95d489d6c3aa7bd655889ddaa807cc97e0613b8eb8f5ef094feee2a98d974606890deb554e76490a5c523d64eb5bc55afa6a43221aae
@bitcoin bitcoin locked and limited conversation to collaborators Apr 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants