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

Add listunspent() test for spendable/unspendable UTXO #7822

Merged
merged 2 commits into from Apr 19, 2016

Conversation

Projects
None yet
3 participants
@joaopaulofonseca
Contributor

joaopaulofonseca commented Apr 6, 2016

This PR adds a test on wallet.py covering the behavior of spendable/unspendable value for UTXO, when calling RPC listunspent.

This value should be different for address or private key import.

@MarcoFalke

This comment has been minimized.

Show comment
Hide comment
@MarcoFalke

MarcoFalke Apr 6, 2016

Member

Thanks, Concept ACK.

Member

MarcoFalke commented Apr 6, 2016

Thanks, Concept ACK.

@joaopaulofonseca joaopaulofonseca changed the title from [qa] Add test to RPC listunspent to Add test to RPC listunspent Apr 7, 2016

@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Apr 14, 2016

Member

I'm a bit divided whether I should propose to add this into the wallet test, which already uses listunspent. This currently adds some startup/teardown overhead (test takes ~9 seconds) just to test one call.
I don't feel strongly about that though.
What do you think @MarcoFalke?

Member

laanwj commented Apr 14, 2016

I'm a bit divided whether I should propose to add this into the wallet test, which already uses listunspent. This currently adds some startup/teardown overhead (test takes ~9 seconds) just to test one call.
I don't feel strongly about that though.
What do you think @MarcoFalke?

@MarcoFalke

This comment has been minimized.

Show comment
Hide comment
@MarcoFalke

MarcoFalke Apr 15, 2016

Member

startup/teardown overhead

I think such overhead is rather small. (Note that disablewallet.py runs in less than a second)

The overhead probably is caused by setting up the bidirectional connections and sync_all() calls.

I have not yet looked closely at the test (I try to avoid large diffs right now in the /qa subfolder as each patch may or may not silently conflict with the python3 refactoring work.)

@jpdffonseca Would you mind to take a look if this can be neatly squashed into the wallet.py test, as suggested by @laanwj ?

Member

MarcoFalke commented Apr 15, 2016

startup/teardown overhead

I think such overhead is rather small. (Note that disablewallet.py runs in less than a second)

The overhead probably is caused by setting up the bidirectional connections and sync_all() calls.

I have not yet looked closely at the test (I try to avoid large diffs right now in the /qa subfolder as each patch may or may not silently conflict with the python3 refactoring work.)

@jpdffonseca Would you mind to take a look if this can be neatly squashed into the wallet.py test, as suggested by @laanwj ?

@joaopaulofonseca

This comment has been minimized.

Show comment
Hide comment
@joaopaulofonseca

joaopaulofonseca Apr 15, 2016

Contributor

@MarcoFalke and @laanwj yes that makes sense. I will try to squash this verifications into wallet.py.

Contributor

joaopaulofonseca commented Apr 15, 2016

@MarcoFalke and @laanwj yes that makes sense. I will try to squash this verifications into wallet.py.

@joaopaulofonseca joaopaulofonseca changed the title from Add test to RPC listunspent to Add wallet test to check spendable/unspendable UTXO on RPC listunspent Apr 18, 2016

@joaopaulofonseca

This comment has been minimized.

Show comment
Hide comment
@joaopaulofonseca

joaopaulofonseca Apr 18, 2016

Contributor

@MarcoFalke, after checking that wallet.py already covers some of the tests for listuspent(), I discarded the separate test file and merged the tests regarding the import of bitcoin addresses and private keys into wallet.py. The test execution time should remain the same.

Contributor

joaopaulofonseca commented Apr 18, 2016

@MarcoFalke, after checking that wallet.py already covers some of the tests for listuspent(), I discarded the separate test file and merged the tests regarding the import of bitcoin addresses and private keys into wallet.py. The test execution time should remain the same.

@joaopaulofonseca joaopaulofonseca changed the title from Add wallet test to check spendable/unspendable UTXO on RPC listunspent to Add listunspent test for spendable/unspendable UTXO Apr 18, 2016

@joaopaulofonseca joaopaulofonseca changed the title from Add listunspent test for spendable/unspendable UTXO to Add listunspent() test for spendable/unspendable UTXO Apr 18, 2016

@MarcoFalke

This comment has been minimized.

Show comment
Hide comment
@MarcoFalke

MarcoFalke Apr 18, 2016

Member

Thanks. Looks better now.

utACK 3b2eedc

Member

MarcoFalke commented Apr 18, 2016

Thanks. Looks better now.

utACK 3b2eedc

@MarcoFalke

View changes

Show outdated Hide outdated qa/rpc-tests/wallet.py
@joaopaulofonseca

This comment has been minimized.

Show comment
Hide comment
@joaopaulofonseca

joaopaulofonseca Apr 19, 2016

Contributor

Moved assert_array_result() to test_framework/util.py.

I noticed that the previous method on receivedby.py had a bug when using the flag should_not_find.
If the flag is set to True, the validation wouldn't work correctly when the values passed as to_match are indeed found inside object_array, and no assertion is raised.

Contributor

joaopaulofonseca commented Apr 19, 2016

Moved assert_array_result() to test_framework/util.py.

I noticed that the previous method on receivedby.py had a bug when using the flag should_not_find.
If the flag is set to True, the validation wouldn't work correctly when the values passed as to_match are indeed found inside object_array, and no assertion is raised.

@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Apr 19, 2016

Member

utACK 5d217de

Member

laanwj commented Apr 19, 2016

utACK 5d217de

@laanwj laanwj merged commit 5d217de into bitcoin:master Apr 19, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

laanwj added a commit that referenced this pull request Apr 19, 2016

Merge #7822: Add listunspent() test for spendable/unspendable UTXO
5d217de Add test to check spendable and unspendable UTXO on RPC listunspent (Joao Fonseca)
fa942c7 Move method to check matches within arrays on util.py (Joao Fonseca)

@fixe fixe deleted the uphold:support/add-test-listunspent branch Apr 19, 2016

MarcoFalke added a commit to MarcoFalke/bitcoin that referenced this pull request Apr 19, 2016

zander added a commit to zander/bitcoinclassic that referenced this pull request Jun 16, 2016

nomnombtc added a commit to nomnombtc/bitcoin that referenced this pull request Nov 11, 2016

Add listunspent() test for spendable/unspendable UTXO
nomnombtc: kept the part where it touches bip125 check in
listtransactions.py commented out.

Github-Pull: #7822
Rebased-From: fa942c7 5d217de

nomnombtc added a commit to nomnombtc/bitcoin that referenced this pull request Nov 12, 2016

Add listunspent() test for spendable/unspendable UTXO
nomnombtc: kept the part where it touches bip125 check in
listtransactions.py commented out.

Github-Pull: #7822
Rebased-From: fa942c7 5d217de

nomnombtc added a commit to nomnombtc/bitcoin that referenced this pull request Nov 13, 2016

Add listunspent() test for spendable/unspendable UTXO
nomnombtc: kept the part where it touches bip125 check in
listtransactions.py commented out.

Github-Pull: #7822
Rebased-From: fa942c7 5d217de
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment