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

Added spent option to listfunds #4296

Merged
merged 3 commits into from
Dec 22, 2020

Conversation

hosiawak
Copy link
Contributor

@hosiawak hosiawak commented Dec 22, 2020

Added a spent option (a boolean) to listfunds which adds spent outputs to the outputs if set to true.

I didn't see any test_listfunds Python test so I thought I'd write one but then I couldn't figure out how to actually run these Python tests after reading HACKING.md :)

  • blackbox tests - These tests setup a mini-regtest environment and test
    lightningd as a whole. They can be run individually:

    PYTHONPATH=contrib/pylightning:contrib/pyln-client:contrib/pyln-testing:contrib/pyln-proto py.test -v tests/

What's py.test ?

I checked travis.yml to see how it does that and it sets up bitcoind and elements and it's Linux specific but I'm using a Mac. If anyone knows how to run tests/test_misc.py on a Mac and could share this info with me I'd appreciate it.

Fixes #4291

@ZmnSCPxj
Copy link
Collaborator

On some distros you can install a pytest package and that is invoked as pytest, so just use pytest. Depends on your Python setup though. You may need to install it separately.

Copy link
Collaborator

@ZmnSCPxj ZmnSCPxj left a comment

Choose a reason for hiding this comment

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

Code mostly okay. Would appreciate a test though.

@hosiawak
Copy link
Contributor Author

@ZmnSCPxj I'm not a C or Python coder for the most part so thanks for the hint, helps me navigate these unknown waters.

I managed to add the listfunds test and run it.

@cdecker
Copy link
Member

cdecker commented Dec 22, 2020

ACK 1e67a90

Changelog-Added: JSON-RPC: The `listfunds` method now includes spent outputs if the `spent` parameter is set to true.
@cdecker
Copy link
Member

cdecker commented Dec 22, 2020

ACK f31a27e

@cdecker cdecker merged commit e582c0a into ElementsProject:master Dec 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add spent funds to the listfunds method
3 participants