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::Balancein chain/src/lib.rs - re-export
bdk_chain::Balanceinbdk::walletmod (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
Balanceand 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.rsthat contains all smaller public traits and structs (replacingchain_data.rsandtx_data_traits.rsfiles).Balanceshould 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.rsif there's no where else it belongs.It would be fine to put
tx_data_traits.rsintochain_data.rs. I don't recall whytx_data_traits.rswas 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.rsfile and move all of it's contents intochain_data.rs. Also move theBalancestruct intochain_data.rs.
A small change but I think we should push to 2.0 milestone.