--- Day changed Mon Dec 10 2018 07:41 < achow101> provoostenator: instagibbs: review https://github.com/achow101/HWI/pull/69 ? 07:42 <@provoostenator> achow101 I would say if it runs on Travis, just merge it. 07:44 < achow101> provoostenator: well I wanted to make sure that other people could run the tests locally too 07:50 <@provoostenator> We can always fix that later. It's a strict improvement to at least have them run on Travis. 07:50 <@provoostenator> A few Travis failures tends to increase my motivation to install all these packages and try again :-) 08:55 <@instagibbs> 69, nice 08:57 <@instagibbs> some tests are better than no tests, can't commit to spending the time to test today sorry 08:57 <@instagibbs> only briefly on computer 09:44 <@provoostenator> I plan to make a proof-of-concept GUI on top of this, once it's rebased: https://github.com/bitcoin/bitcoin/pull/13100 09:45 <@provoostenator> Without rebase it's impossible to rebase _that_ on top of my RPC branch. 09:45 <@provoostenator> All your rebase are belong to us... 09:45 <@provoostenator> For wallet creation I have the following super simple flow in mind: 09:45 <@provoostenator> * check if -signer is set, if not present a file dialog where user can select drvier. 09:46 <@provoostenator> * call enumerate on signer, fetch the keys for the first available fingerprint 09:46 <@provoostenator> * show file dialog when user can enter name for new wallet 09:47 <@provoostenator> * create a read-only wallet, fill it with keys 09:47 <@provoostenator> Then for display address probably a button in the receive screen. Ditto file dialog if -signer isn't set. 09:49 <@provoostenator> Send is the most tricky I'd say. I somehow need to convert the unsigned transaction the GUI produces to PSBT, then call various PSBT code, which currently lives the RPC codebase so may need to move that a bit. 09:50 <@provoostenator> Once rw_config stuff is merged, it the GUI can save -signer so it only needs to be selected once. It can then also remember which wallets are open, so they stay open. 09:53 < gwillen> provoostenator: I have a PR to refactor the PSBT stuff out of the RPC codebase 09:53 <@provoostenator> Nice, which one? 09:53 < gwillen> that I guess I should submit pronto 09:54 < gwillen> I mean, I have a change that should become a PR :-) 09:54 <@provoostenator> Yes please, will add to my review list. 09:54 < gwillen> only thing is, I can't quite figure out how to handle some errors 09:54 < gwillen> where currently it is throwing an exception with a nice message for RPC 09:54 < gwillen> and obviously that's not acceptable in the GUI 09:54 < gwillen> (well, at least as far as I can tell the GUI does not use exceptions in that way) 09:55 <@provoostenator> I just subclassed std::runtime_error for and then have the RPC rethrow those 09:55 <@provoostenator> https://github.com/bitcoin/bitcoin/pull/14912/commits/9321df82064665d33130134e2cae21b3e7b40a26#diff-91392f41b61b541103a444e7e104ab6c 09:56 <@provoostenator> https://github.com/bitcoin/bitcoin/pull/14912/commits/c950f4ac4c87c742623020d9a4e4409ff3a730c7#diff-df7d84ff2f53fcb2a0dc15a3a51e55ceR4031 09:57 < gwillen> hm, okay -- what happens if one of those gets thrown into the GUI? presumably a crash? 09:57 <@sipa> presumably 09:57 -!- mode/##hwi [+o gwillen] by sipa 09:57 <@provoostenator> The GUI can do the same; catch the PSBT-specific subclass of std::runtime_error , take the what() message and present that as an error popup. 09:57 <@gwillen> okay, so I guess that won't be a problem in your case, since you're not sending arbitrary crap, but rather well-formed crap 09:57 <@gwillen> and since I'm letting people paste in arbitrary crap, I can catch it 09:58 <@gwillen> okay, that sounds reasonable, I will submit a PR today and ping you in here provoostenator 09:58 <@provoostenator> Yes, and only specific stuff, I don't try to catch _all_ std::errors 09:59 <@gwillen> ahh okay, so a new subclass, just like RPC uses, I will copy how RPC does it. 09:59 <@provoostenator> I did it slightly different, see link above. RPC errors are JSON objects, which is a bit weird for a GUI to handle. 10:02 <@provoostenator> They don't even inherit from std::exception: UniValue JSONRPCError(int code, const std::string& message) 10:03 <@gwillen> oh, interesting, I forgot you could throw random shit in C++ 10:03 <@provoostenator> Yeah, I think it makes sense for RPC, but not generically. 10:03 <@gwillen> right, yeah. 10:04 <@provoostenator> I think it's better to pick a new RPCErrorCode e.g. RPC_PSBT_ERROR and throw that when you catch a PSBTException, along with the message. 10:09 <@provoostenator> It seems the only thing PSBT RPC methods currently throw is RPC_DESERIALIZATION_ERROR, but I would image there's others. Maybe you need more than one subclass of std::runtime_error, or add an error code integer to the subclass. Then you would map the error code to the right RPC enum. 10:16 <@provoostenator> On a brighter note: I think we're very close to peak PR for this project :-) 10:17 <@provoostenator> And most changes are well contained, not too large and useful for other things too. 10:35 < achow101> damnit, trezor just changed their whole api... 10:59 <@sipa> [A[A 12:58 <@instagibbs> achow101, ... why 19:11 -!- ghost43 [~daer@gateway/tor-sasl/daer] has quit [Ping timeout: 256 seconds] 19:18 -!- ghost43 [~daer@gateway/tor-sasl/daer] has joined ##hwi