fibercrypto / fibercryptowallet

Multi-coin cryptocurrency wallet
GNU General Public License v3.0
28 stars 15 forks source link

Confusing design of the wallets and addresses models. #367

Open stdevCrow opened 3 years ago

stdevCrow commented 3 years ago

I'm coding the C++ version of the model that shows wallets and its addresses in the main page, and I realize that:

But despite a wallet has a list of addresses, there's no connection between them but a walletId property in the QAddress type, and a QWallet does not have such property, so this whole design makes no sense to me.

Describe the solution you'd like

It's there any problem with this implementation?

stdevCrow commented 3 years ago

@stdevCrow @olemis pls take a look at this 👆 asap, I need a yes or no to continue.

olemis commented 3 years ago

@stdevCrow I guess model name should be Wallet (instead of Wallets ...)

stdevCrow commented 3 years ago

@olemis Agree, but are you okay with the propossed implementation?

olemis commented 3 years ago

@stdevCrow Original code works that way for a reason , it seems to me that it's due to the fact that golang wallet address objects are generated by wallet enumeration methods hence they might differ from one method call to the next

This would be of particular importance through the C API

stdevCrow commented 3 years ago

@olemis I'm not talking about changing underlying system. I meant that if the addresses contains a walletId, both can be grouped together in the Qt model. The backend will not know the difference. And the model of addresses will not know the existence of the model of wallets. The will work as always, but addresses with the same walletId will be grouped under the same wallet in the WalletModel.

olemis commented 3 years ago

@stdevCrow it seems to me (cmiiw) it's not a wallet ID but an address ID . See BIP-44 hierachical addressing standard . It's not a list of addresses , but an inifinite derivations tree