-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decred: Add mock libwallet. #4
Conversation
bea211b
to
d50404b
Compare
d50404b
to
75daa34
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something else I noticed:
cw_decred/README.md
says cw_bitcoin
. That's from the previous PR.
required this.fee, | ||
required this.rawHex}); | ||
|
||
final SPVWallet spv; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
final SPVWallet wallet
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you feel strongly about this? If I change this everywhere wallet conflicts with wallet in wallet.dart. I could do spv -> libwallet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, not strongly.
: assert(false), // Not feasable with current decred implementation. TODO: Surely this is not the correct way to do this. | ||
super(name: name, password: password, walletInfo: walletInfo); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this for watch-only wallets, where the wif is the xpub? Don't know though. Especially since assert
only works in dev mode, not in prod, I agree there would need to be a better way to disable this feature if decred doesn't support it. Can probably just throw an exception inside the constructor.
cw_decred/lib/wallet_service.dart
Outdated
Future<DecredWallet> restoreFromKeys( | ||
DecredRestoreWalletFromWIFCredentials credentials) async => | ||
throw UnimplementedError(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It appears this may be enough, based on my previous comment. The assert there may not be necessary. Is it even possible to not have that DecredRestoreWalletFromWIFCredentials
class at all and just use WalletCredentials
directly instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The compiler was complaining without putting something there in the constructor I think. Also maybe can use for watching only if we have that? Leaving for now with the throws.
lib/decred/cw_decred.dart
Outdated
@override | ||
WalletCredentials createDecredRestoreWalletFromSeedCredentials({ | ||
required String name, | ||
required String mnemonic, | ||
required String password}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file doesn't look formatted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah formatting kind of all over the place. We just want two space indention? I attempted to correct this file and everywhere that's not copied code should be ok.
lib/store/settings_store.dart
Outdated
// TODO: What is this for. | ||
if (walletType == WalletType.decred) { | ||
return Node(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My preliminary research seems to suggest that it allows a user choose a custom address to connect to. The user's preferred node would be saved to the nodes
map and we shouldn't need to do this if check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohhh.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed the todo do Implement connecting to a user's preferred node.
Going to make changes here first https://github.com/JoeGruffins/cake_wallet/tree/mocklibwalletonlinux and apply back to this branch because I think it is faster in the end building and testing on linux. |
75daa34
to
f3cc7a3
Compare
I got most of the suggestions https://github.com/JoeGruffins/cake_wallet/compare/75daa34c366a07df206655b5a5c5ae75f4893e68..f3cc7a316d50e3bb9cd978cc89996f0260c51be8 There are probably a lot of unused imports here and there still. |
Use a mock libwallet for now.
f3cc7a3
to
a34b6a2
Compare
These were pushed. Forgot to merge here first so just closing. |
Remove electrum wallet bits.
closes #2