Closed Egge21M closed 1 year ago
would this help?
Yeah, it would at definitely save some code. However after retrieving serialized proofs from store, I would still have to create new Proof instances for every one of them, before passing them to for example payLnInvoice.
There is only a single method on Proof, which is a utility for base64 encoding. I don't think the value gained from having this utility on the class itself, does not weigh up the friction it provides when working with the data. If it could be outsourced, Proofs as class would no longer be necessary and could exist as regular typed objects.
Interesting, i never had that issue.
That being said, it would probably make sense to put this method elsewhere. not even sure where this is needed at all, maybe we can jsut remove it, since we've moved to other token format
Some of the methods on CashuWallet expect or return proofs as Class. While I understand that OOP leads to cleaner code, it makes working (and especially storing proofs more difficult as those instances are not serializable. So in order to store proofs I have to extract data out of the instance and if I want to work with previously stored ones, I have to create new instances from the data.