Skip to content

test: clean message_count and last_message - #19599

Merged
maflcko merged 1 commit into
bitcoin:masterfrom
troygiorshev:2020-07-clean-message_count
Jul 30, 2020
Merged

maflcko merged 1 commit into
bitcoin:masterfrom
troygiorshev:2020-07-clean-message_count

Conversation

@troygiorshev

@troygiorshev troygiorshev commented Jul 27, 2020 •

Copy link
Copy Markdown
Contributor

From #19580

This PR changes comments to clarify the intended usage of message_count and last_message. Additionally it changes the only usage of message_count to use last_message instead, bringing the code into alignment with the intended usage.

Note: Now message_count is completely unused. However, it is ready to be used (i.e. the supporting code works) and likely will be used in some test in the future.

This commit clarifies the intended usage of message_count and
last_message.  Additionally it changes the only usage of message_count
to using last_message instead, bringing the code further along the
intended usage.
@troygiorshev troygiorshev changed the title Clean message_count and last_message test: clean message_count and last_message Jul 27, 2020
@fanquake fanquake added the Tests label Jul 27, 2020

@jnewbery jnewbery left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment changes seem good, but I don't think the code change is necessary.

def wait_for_verack(self, timeout=60):
def test_function():
return self.message_count["verack"]
return "verack" in self.last_message

@jnewbery jnewbery Jul 27, 2020 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why this change? I think waiting for self.message_count["verack"] to be non-zero matches exactly what we want the function to do.

EDIT: All the other wait_for* functions are using last_message so this change seems fine to me.

@jnewbery

Copy link
Copy Markdown
Contributor

utACK 2c6a02e

@maflcko
maflcko merged commit 149eca4 into bitcoin:master Jul 30, 2020
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Sep 6, 2021
Summary:
This commit clarifies the intended usage of message_count and
last_message.  Additionally it changes the only usage of message_count
to using last_message instead, bringing the code further along the
intended usage.

This is a backport of [[bitcoin/bitcoin#19599 | core#19599]]

Test Plan: `ninja check-functional`

Reviewers: #bitcoin_abc, majcosta

Reviewed By: #bitcoin_abc, majcosta

Differential Revision: https://reviews.bitcoinabc.org/D10047
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Sep 19, 2021
2c6a02e Clean message_count and last_message (Troy Giorshev)

Pull request description:

  From bitcoin#19580

  This PR changes comments to clarify the intended usage of `message_count` and `last_message`.  Additionally it changes the only usage of `message_count` to use `last_message` instead, bringing the code into alignment with the intended usage.

  Note: Now `message_count` is completely unused.  However, it is ready to be used (i.e. the supporting code works) and likely will be used in some test in the future.

ACKs for top commit:
  jnewbery:
    utACK 2c6a02e

Tree-SHA512: 07c7684c9586de4f845e10d7aac36c1aab9fb56b409949c1c70d5ca705bc3971ca7d5943245a0472def4efd7b4e1c5dad2f713db5ead8fca08404daf4891e98b
@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.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants