Skip to content

Conversation

theStack
Copy link
Contributor

This is a follow-up PR to #18533, which changed the naming of strCommand to msg_type in the network processing code. The same approach is done here for the function test framework, to get rid of the wrong "command" terminology for network mesage types. (Commands are usually used in the CLI or RPC context, so using the same name in the network message context would only be confusing.)

The commit was created through the following steps:

  1. search for all occurences of the string "command" within the folder test/functional
    git grep -i command test/functional > command_finds
  2. manually sort out all false-positives, i.e. occurences of "command" which describe commands in the correct sense (mostly CLI or RPC related, also some with Socks5)
  3. put the remaining occurences into a scripted-diff (a quite simple one, actually) that renames "command" to "msgtype" in the concerned files.

The name msgtype was intentionally chosen without the underscore _ as classes beginning with msg_ define concrete types of messages.

@DrahtBot
Copy link
Contributor

DrahtBot commented Apr 12, 2020

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

No conflicts as of last run.

@practicalswift
Copy link
Contributor

Concept ACK: consistent naming is better than inconsistent naming.

@maflcko
Copy link
Member

maflcko commented Apr 15, 2020

Concept ACK. Makes sense that tests use the same naming as Bitcoin Core. See NetMsgType here: https://doxygen.bitcoincore.org/namespace_net_msg_type.html

This is the functional test framework pendant for
7777e36, which renamed "strCommand" with
"msg_type" in the network processing code.

-BEGIN VERIFY SCRIPT-
 # Rename in test framework
 sed -i 's/command/msgtype/g' ./test/functional/test_framework/messages.py ./test/functional/test_framework/mininode.py
 # Rename in individual tests
 sed -i 's/command/msgtype/g' ./test/functional/p2p_invalid_messages.py ./test/functional/p2p_leak.py
-END VERIFY SCRIPT-
@theStack theStack force-pushed the 20200410-scripted-diff-test-rename-command-to-msgtype branch from 6f03d78 to 9df32e8 Compare April 15, 2020 13:43
@theStack
Copy link
Contributor Author

Rebased.

@maflcko
Copy link
Member

maflcko commented Apr 15, 2020

ACK 9df32e8 . Makes sense that tests use the same naming as Bitcoin Core. See NetMsgType here: https://doxygen.bitcoincore.org/namespace_net_msg_type.html

@maflcko maflcko merged commit d2882a0 into bitcoin:master Apr 19, 2020
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Apr 20, 2020
…e (naming)

9df32e8 scripted-diff: test: replace command with msgtype (Sebastian Falbesoner)

Pull request description:

  This is a follow-up PR to bitcoin#18533, which changed the naming of `strCommand` to `msg_type` in the network processing code. The same approach is done here for the function test framework, to get rid of the wrong "command" terminology for network mesage types. (Commands are usually used in the CLI or RPC context, so using the same name in the network message context would only be confusing.)

  The commit was created through the following steps:
  1. search for all occurences of the string "command" within the folder `test/functional`
  ```git grep -i command test/functional > command_finds```
  2. manually sort out all false-positives, i.e. occurences of "command" which describe commands in the correct sense (mostly CLI or RPC related, also some with Socks5)
  3. put the remaining occurences into a scripted-diff (a quite simple one, actually) that renames "command" to "msgtype" in the concerned files.

  The name `msgtype` was intentionally chosen without the underscore `_` as classes beginning with `msg_` define concrete types of messages.

ACKs for top commit:
  MarcoFalke:
    ACK 9df32e8 . Makes sense that tests use the same naming as Bitcoin Core. See `NetMsgType` here: https://doxygen.bitcoincore.org/namespace_net_msg_type.html

Tree-SHA512: cd0ee08a382910b7f10ce583acdaf4f8a39f9ba4a22434a914415727eedd98bac538de9bf6633574d5eb86f62558bc8dcb638a3289d99b04f8481f34e7a9a0c7
maflcko pushed a commit that referenced this pull request Jun 19, 2020
…alizedNetMsg

51e9393 refactor: s/command/msg_type/ in CNetMsgMaker and CSerializedNetMsg (Sebastian Falbesoner)

Pull request description:

  Follow-up PR for #18533 -- another small step towards getting rid of the confusing "command" terminology. Also see PR #18610 which tackled the functional tests.

ACKs for top commit:
  MarcoFalke:
    ACK 51e9393

Tree-SHA512: bb6f05a7be6823d5c4eab1d05b31fee944e700946827ad9425d59a3957fd879776c88c606319cbe9832d9451b275baedf913b71429ea3e01e4e82bf2d419e819
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jul 7, 2020
…d CSerializedNetMsg

51e9393 refactor: s/command/msg_type/ in CNetMsgMaker and CSerializedNetMsg (Sebastian Falbesoner)

Pull request description:

  Follow-up PR for bitcoin#18533 -- another small step towards getting rid of the confusing "command" terminology. Also see PR bitcoin#18610 which tackled the functional tests.

ACKs for top commit:
  MarcoFalke:
    ACK 51e9393

Tree-SHA512: bb6f05a7be6823d5c4eab1d05b31fee944e700946827ad9425d59a3957fd879776c88c606319cbe9832d9451b275baedf913b71429ea3e01e4e82bf2d419e819
jasonbcox pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Nov 19, 2020
Summary:
```
This is the functional test framework pendant for
7777e3624fabe4718675b2be8b088697b7ad4d0d, which renamed "strCommand"
with "msg_type" in the network processing code.

-BEGIN VERIFY SCRIPT-
 # Rename in test framework
 sed -i 's/command/msgtype/g'
./test/functional/test_framework/messages.py
./test/functional/test_framework/mininode.py
 # Rename in individual tests
 sed -i 's/command/msgtype/g' ./test/functional/p2p_invalid_messages.py
./test/functional/p2p_leak.py
-END VERIFY SCRIPT-
```

Backport of core [[bitcoin/bitcoin#18610 | PR18610]].

Test Plan:
  ninja check-functional

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D8461
@theStack theStack deleted the 20200410-scripted-diff-test-rename-command-to-msgtype branch December 1, 2020 09:55
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants