Closed xpromache closed 1 year ago
If you agree, I can make a pull request for this. I already did it halfway through when refactoring the SendTransaction to fix #9
Since the Send/Recv transactions have been separated now, I agree there is no reason to keep metadata behind an option for the Send side.
Currently in daemon.rs, the SendTransaction is initialized without metadata and immediately after the metadata is set: https://github.com/ASU-cubesat/cfdp-rs/blob/main/cfdp-core/src/daemon.rs#L749
That means in practice we never have a SendTransaction without metadata (except a few places in the unit tests).
I propose to initialize directly the SendTransaction with the metadata so it will not be behind and Option anymore. That allows to simplify a lot of methods which now raise an error that the metadata is not set.