Marginally clean up acct/addr discovery code. #383

Merged
merged 3 commits into from Nov 11, 2016

Projects

None yet

2 participants

@jrick
Member
jrick commented Nov 11, 2016

Errors are no longer hidden by returning in-band values. Explicit
checks have also been added to test for hdkeychain.ErrInvalidChild
rather than assumming that any random error is an invalid BIP0032
child key derivation.

Some vars that didn't need to be were changed to const and moved to
the top of the file.

Use uint32 everywhere for indexes rather than mixing int and uint32
(I'm guessing this was largely thanks to Go's "type inferrence" rules
which default to int). Removes a lot of unnecessary type conversions
and makes the code a little less cluttered.

Since all of this code requires the consensus server RPC client, just
pass it in as a parameter and pass it around to all of the helper
functions instead of calling Wallet.requireChainClient from most of
them.

jrick added some commits Nov 11, 2016
@jrick jrick Marginally clean up acct/addr discovery code.
Errors are no longer hidden by returning in-band values.  Explicit
checks have also been added to test for hdkeychain.ErrInvalidChild
rather than assumming that any random error is an invalid BIP0032
child key derivation.

Some vars that didn't need to be were changed to const and moved to
the top of the file.

Use uint32 everywhere for indexes rather than mixing int and uint32
(I'm guessing this was largely thanks to Go's "type inferrence" rules
which default to int).  Removes a lot of unnecessary type conversions
and makes the code a little less cluttered.

Since all of this code requires the consensus server RPC client, just
pass it in as a parameter and pass it around to all of the helper
functions instead of calling Wallet.requireChainClient from most of
them.
8dfbf9a
@jrick jrick more 43f1bce
@alexlyp
Member
alexlyp commented Nov 11, 2016

all clean up looks good. and tACK on reseed on testnet

@alexlyp
Member
alexlyp commented Nov 11, 2016

tACK on latest changes

@jrick jrick merged commit 668f78c into decred:master Nov 11, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@jrick jrick deleted the jrick:addrsynccleanup branch Nov 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment