AustEcon / bitsv

BitSV: Bitcoin made easy. Documentation:
https://AustEcon.github.io/bitsv
MIT License
96 stars 28 forks source link

prepare_transaction needs the key object #73

Closed Mahsa-Bastankhah closed 3 years ago

Mahsa-Bastankhah commented 3 years ago

Hi. as I read in bitsv documentation I need to call the prepare transaction when I'm online to prepare a transaction and then I can sign this transaction offline. logically the prepare_tranaction function shouldn't need the key object to work. but when I run the tx_data = PrivateKey.prepare_transaction(address=sender.address, outputs=[(receiver.address, amountToSpend , 'bsv')]) I get this error : TypeError: prepare_transaction() missing 1 required positional argument: 'self'

I checked the wallet.py file of bitsv and recognized that prepare_transaction isn't a @classmethod while it should be!

AustEcon commented 3 years ago

Ah yes. Sounds about right. Thanks for the concise report.

Will patch this when I get a moment. 😉

Mahsa-Bastankhah commented 3 years ago

thanks. I'm waiting for the update.

AustEcon commented 3 years ago

Will this do okay? I had to change the function signature to to add the 'network' positional arg... so this will technically be a breaking change but I'm not aware of too many people using this functionality... image

AustEcon commented 3 years ago

Cut new release now. Will close this issue. LMK though of any issues and can reopen as needed.