Skip to content

Implement listbanned method and test #225

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

GideonBature
Copy link
Contributor

The JSON-RPC method listbanned does return a type. We want to test this to catch any changes in behavior in future Core versions.

This PR adds a client function that errors if the return value is anything other than the type it returns, along with an integration test that calls this function.

Ref: #116

@tcharding
Copy link
Member

There are a few problems with this one. Primarily the integration test does not test anything because the vector in ListBanned is always empty so the Banned struct is never tested.

Can you fix that up and we'll go from there?

Also:

  • the client macro needs underscore in the name
  • the last patch should be part of the first

Thanks

@GideonBature
Copy link
Contributor Author

oh my... Let me fix them up.

@GideonBature GideonBature force-pushed the listbanned branch 6 times, most recently from a303ca2 to 66875fb Compare June 3, 2025 16:58
Copy link
Member

@tcharding tcharding left a comment

Choose a reason for hiding this comment

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

Looking much better man.

@GideonBature GideonBature force-pushed the listbanned branch 2 times, most recently from 12c00a4 to afba694 Compare June 5, 2025 09:02
@tcharding
Copy link
Member

I think something is still wrong here. If I comment out the fields in Banned and run the tests it still passes?

@GideonBature
Copy link
Contributor Author

GideonBature commented Jun 6, 2025

Woaw... Let check what is wrong.

@GideonBature
Copy link
Contributor Author

I think something is still wrong here. If I comment out the fields in Banned and run the tests it still passes?

Thank you for pointing this out. seems the test was only checking if there is at least an element inside of the ListBanned, which would be the Banned entry, but not verifying whether the Banned struct itself contains valid field data. I added an assertion for the address field since it is present across all versions. Still thinking of a more robust way to handle this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants