bdk
bdk copied to clipboard
Merge `tx_data_traits.rs` into `chain_data.rs`.
Remove the tx_data_traits.rs
file and move all of it's contents into chain_data.rs
. Also move the Balance
struct into chain_data.rs
.
See https://discord.com/channels/753336465005608961/753367451319926827/1161983570538147932
Moved to alpha.4 since this is a functional change we should figure out before the beta release.
A few thoughts:
- move Balance into tx_graph.rs, as suggested already
- re-export
tx_graph::Balance
in chain/src/lib.rs - re-export
bdk_chain::Balance
inbdk::wallet
mod (as usual)
Undecided what to do with tx_data_traits
and chain_data
modules. Maybe rename tx_data_traits.rs to anchor.rs, to emphasize Anchor
's structural importance. Or just move everything into chain_data
and drop the other file.
@ValuedMammal I would like to work on this, Should I create two pr's one for moving out Balance
and one for droping the tx_data_traits.rs file or complete everything in single pr
@startup-dreamer A single pr for moving Balance, but I would like to get the opinion of the maintainers before formulating anything concrete.
@ValuedMammal I would like to work on this, Should I create two pr's one for moving out
Balance
and one for droping the tx_data_traits.rs file or complete everything in single pr
cc: @danielabrozzoni and @evanlinjin
This is my proposal (as mentioned in https://github.com/bitcoindevkit/bdk/pull/1272#issuecomment-1891319255):
I think we should have a file
chain/types.rs
that contains all smaller public traits and structs (replacingchain_data.rs
andtx_data_traits.rs
files).Balance
should be intypes.rs
.
Also I have removed the first good issue
tag and added the discussion
tab as the discussion is not final, and I don't want anyone else to give us a PR (we already have two: #1272 and #1175).
Update:
After reading @LLFourn's comment here (https://github.com/bitcoindevkit/bdk/pull/1272#issuecomment-1891383732):
It would be great to avoid a
types.rs
. This is totally unhelpful name because everything we declare is a type. It's fine to put things inlib.rs
if there's no where else it belongs.It would be fine to put
tx_data_traits.rs
intochain_data.rs
. I don't recall whytx_data_traits.rs
was created.
I agree with this - to merge tx_data_traits.rs
into chain_data.rs
. I think Balance
should also go in chain_data.rs
.
The conclusion is the following:
Remove the
tx_data_traits.rs
file and move all of it's contents intochain_data.rs
. Also move theBalance
struct intochain_data.rs
.
A small change but I think we should push to 2.0 milestone.