[monero-project/monero] wallet-rpc: watch-only support added (#3780)

After a bit of experimentation, now I tend to agree with @moneromooo-monero’s opinion, i.e. to keep the original function names so that it’s easy to track the history of code changes. I think the function naming can still be made consistent if we regard `save_tx` to always save an unsigned transaction and `load_tx` to always load a signed transaction. Then, the new helper functions can be consistently named by adding suffix to the function name:

— original: `save_tx` -> helper: `save_tx_to_str `
— original: `sign_tx ` -> helper: `sign_tx_to_str `
— (Another helper function `sign_tx` is introduced as a function overload)
— original: `load_unsigned_tx` -> helper: `load_unsigned_tx_from_str `
— original: `load_tx` -> helper: `load_tx_from_str`

Here’s an example patch based on your code: https://github.com/stoffu/monero/commit/0399a12bc3963f7201b6271476ffa1f382292e8e

Also, I think the number of changed lines in wallet2.cpp can vary quite a bit depending on the ordering of the functions. In the above patch, I chose an ordering that I think minimizes the change.

Запись редактировалась последний раз: May 31, 2018, 3:33 pm