Bitcoin Forum
May 21, 2024, 09:27:02 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Help wanted: QA test spendfrom.py (coin control utility)  (Read 1770 times)
Gavin Andresen (OP)
Legendary
*
qt
Offline Offline

Activity: 1652
Merit: 2216


Chief Scientist


View Profile WWW
January 08, 2013, 09:22:38 PM
 #1

If you're interested in coin control, and you're comfortable with python and the command-line, then I could use your help.

I've written a little utility called 'spendfrom.py' that uses the raw transactions JSON-RPC api to send coins received on particular addresses that I'd like to ship in the contrib/ directory.

But since it touches the wallet it needs thorough testing.

I've written a test plan; who is willing to run through the test plan with their -testnet wallet and then try to break it?

Test plan:
  https://github.com/gavinandresen/QA/blob/master/SpendFrom.md

Code:
  https://github.com/gavinandresen/bitcoin-git/tree/spendfrom/contrib/spendfrom

How often do you get the chance to work on a potentially world-changing project?
pc
Sr. Member
****
Offline Offline

Activity: 253
Merit: 250


View Profile
January 08, 2013, 09:47:21 PM
 #2

I'd love to test, though I'm not very familiar with python. I'm on Mac OS X 10.6.8, and I regularly use the rawtransaction commands to do coin control manually and hope I don't screw it up too much, so I'm excited to see this. Is all I need the spendfrom.py file? I tried executing it, and got "No module named jsonrpc", so I assume I need to install it from somewhere?
Gavin Andresen (OP)
Legendary
*
qt
Offline Offline

Activity: 1652
Merit: 2216


Chief Scientist


View Profile WWW
January 08, 2013, 09:57:33 PM
 #3

If you've got easy_install (does OSX 10.6 comes with easy_install ?), then try:

    easy_install jsonrpc

Or grab jgarzik's version from github:
   https://github.com/jgarzik/python-bitcoinrpc

How often do you get the chance to work on a potentially world-changing project?
pc
Sr. Member
****
Offline Offline

Activity: 253
Merit: 250


View Profile
January 08, 2013, 11:27:35 PM
 #4

It does seem to have easy_install, but I got a "cannot import name ServiceProxy" when I tried that. I deleted that, and put jgarzik's "jsonrpc" folder in the directory with spendfrom.py, and it seems to work now.

I've run through the test plan, and it seems to work great. The only issues are 1) Balances in my P2SH Addresses don't show up, even though the key to spend them is in the wallet and Bitcoin-QT sends transactions from it just fine and they show up in listunspent (though I certainly understand if it isn't in the first version), and 2) The display of amounts seems to round to 4 decimal places, even when the actual amount is something to the full 8 places.

Thanks!
Gavin Andresen (OP)
Legendary
*
qt
Offline Offline

Activity: 1652
Merit: 2216


Chief Scientist


View Profile WWW
January 10, 2013, 06:16:20 PM
 #5

The only issues are 1) Balances in my P2SH Addresses don't show up, even though the key to spend them is in the wallet and Bitcoin-QT sends transactions from it just fine and they show up in listunspent (though I certainly understand if it isn't in the first version), and 2) The display of amounts seems to round to 4 decimal places, even when the actual amount is something to the full 8 places.

Thanks for helping test!  Latest version fixes the p2sh issue.

I had it 4-decimal-places because I personally don't care about less than 0.0001 BTC right now. It is 8 now, just because I know you won't be the last person to ask "why does it round."

Quote
It does seem to have easy_install, but I got a "cannot import name ServiceProxy" when I tried that.

If there are python command-line-tool packaging experts, suggestions on how to package this better are welcome.  I thought all versions of jsonrpc had a ServiceProxy class, but I guess I'm wrong.

How often do you get the chance to work on a potentially world-changing project?
Peter Todd
Legendary
*
expert
Offline Offline

Activity: 1120
Merit: 1150


View Profile
January 10, 2013, 06:32:24 PM
 #6

Thanks for helping test!  Latest version fixes the p2sh issue.

I think you haven't pushed it to github yet; https://github.com/gavinandresen/bitcoin-git/tree/spendfrom/contrib/spendfrom shows HEAD as 2e9224d9f2 from 6 days ago.

Gavin Andresen (OP)
Legendary
*
qt
Offline Offline

Activity: 1652
Merit: 2216


Chief Scientist


View Profile WWW
January 10, 2013, 06:51:30 PM
 #7

Dunno why github says 'authored 6 days ago', commit 2e922 was pushed yesterday and definitely has the changes (see lines 107-108 of spendfrom.py).

How often do you get the chance to work on a potentially world-changing project?
Peter Todd
Legendary
*
expert
Offline Offline

Activity: 1120
Merit: 1150


View Profile
January 10, 2013, 07:33:27 PM
 #8

Dunno why github says 'authored 6 days ago', commit 2e922 was pushed yesterday and definitely has the changes (see lines 107-108 of spendfrom.py).


Oh I know why, you've been using rebase. git commit --amend and git rebase don't update the commit timestamp and github must be going by commit timestamp to determine when the code was last changed. The --reset-author flag would reset the timestamp, but of course people don't care much about commit timestamps in general anyway.

K1773R
Legendary
*
Offline Offline

Activity: 1792
Merit: 1008


/dev/null


View Profile
January 10, 2013, 07:56:50 PM
 #9

If you're interested in coin control, and you're comfortable with python and the command-line, then I could use your help.

I've written a little utility called 'spendfrom.py' that uses the raw transactions JSON-RPC api to send coins received on particular addresses that I'd like to ship in the contrib/ directory.

But since it touches the wallet it needs thorough testing.

I've written a test plan; who is willing to run through the test plan with their -testnet wallet and then try to break it?

Test plan:
  https://github.com/gavinandresen/QA/blob/master/SpendFrom.md

Code:
  https://github.com/gavinandresen/bitcoin-git/tree/spendfrom/contrib/spendfrom

thanks for planning to support coin-control, this was a long missing feature since the old patches from coderrr Smiley

[GPG Public Key]
BTC/DVC/TRC/FRC: 1K1773RbXRZVRQSSXe9N6N2MUFERvrdu6y ANC/XPM AK1773RTmRKtvbKBCrUu95UQg5iegrqyeA NMC: NK1773Rzv8b4ugmCgX789PbjewA9fL9Dy1 LTC: LKi773RBuPepQH8E6Zb1ponoCvgbU7hHmd EMC: EK1773RxUes1HX1YAGMZ1xVYBBRUCqfDoF BQC: bK1773R1APJz4yTgRkmdKQhjhiMyQpJgfN
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!