refactor(bdk): use idiomatic naming for all getter methods
I don't think this should be addressed in this PR, but I think we should use idiomatic naming for methods: https://rust-lang.github.io/api-guidelines/naming.html#getter-names-follow-rust-convention-c-getter
I.e. Wallet::get_address should be Wallet::address.
Originally posted by @evanlinjin in https://github.com/bitcoindevkit/bdk/issues/1028#issuecomment-1813522784
Rename Psbt::get_utxo_for -> utxo_at_index ?
or get_txout
My personal preference which is slightly different from the rust style guide: I'm fine with get_ if there is something like a corresponding insert_. So get_tx feels good because there's also insert_tx. It shouldn't be get_balance though.
A small change but I think we should push to 2.0 milestone.
I'd also be fine with making this a note in CONTRIBUTING.md along with some additional code conventions and guidelines, in hopes that it sort of implements itself over time.
Yes I like that idea, and between 1.0 and 2.0 we can slowly deprecate old naming and add the new ones. We just can't fully remove the old names until a 2.0 version bump.
We only need to change Wallet::get_balance() to Wallet::balance() so we should be able to get this in to the 1.0 milestone.
The Wallet::get_address fix was done in #1402.
Any other pub fn get_* are less commonly used and can wait until 2.0.