get_address with an enum of AddressIndex no longer makes much sense because the Peek variant doesn't require Wallet to be mutable but the others do.
Instead I think the methods should roughly follow what's in KeychainTracker right now.
LastUnused should be removed and replaced with a method unused_addresses which returns and iterator. If you really want the last one then you can do wallet.unused_addresses().last(). I know this is not what LastUnused does but this is what most people thinks it does. I'm not sure what
get_address should instead just take an index and so should do what Peek currently does.
- getting a new address should be handled by a new method
reveal_next_address()
- And revealing up to a certain index can be
reveal_addresses_to
- The
mark_used and unmark_used feature in KeychainTxOutIndex should probably be available to users of Wallet.
- The methods should all take a
KeychainKind as their argument (rather than having separate methods for each).
get_addresswith an enum ofAddressIndexno longer makes much sense because thePeekvariant doesn't requireWalletto be mutable but the others do.Instead I think the methods should roughly follow what's in
KeychainTrackerright now.LastUnusedshould be removed and replaced with a methodunused_addresseswhich returns and iterator. If you really want the last one then you can dowallet.unused_addresses().last(). I know this is not whatLastUnuseddoes but this is what most people thinks it does. I'm not sure whatget_addressshould instead just take an index and so should do whatPeekcurrently does.reveal_next_address()reveal_addresses_tomark_usedandunmark_usedfeature inKeychainTxOutIndexshould probably be available to users ofWallet.KeychainKindas their argument (rather than having separate methods for each).