Closed callebtc closed 1 month ago
@callebtc looking at the I don't think the receive
function not returning errors for tokens that failed to be redeemed is a result/ consequence of the receive
function being able to accept tokens from different mints and as such doesn't in itself hinder errors with failed tokens being returned. I'm not particularly sure if all errors would be useful but if we wanted to return errors here we could have them returned from the receiveTokenEntry
function being called in receive
.
Secondly regarding the counter
I think changing it's application might need fixes across multiple functions as it seems to be consistently used the same way across multiple functions in the CashuWallet class. So personally I think that might be a lot of work.
let me know your thoughts on this @callebtc @gandlafbtc
I think we should aim to simplify the datastructure of tokens to not allow multiple tokens inside a token.
Reasons:
@gandlafbtc as per the issue closed on #86 this issue can be closed out too, correct?
The api has been simplified and now either throws an error or returns the successfully swapped proofs. I think this can be closed @gandlafbtc
cashu-ts
tries to receive multiple tokens from multiple mints at once and returns tokens with errors inreceive
. I think this is not a great approach because the implementor does not receive the error.I am also not sure if the treatment of the
counter
for deterministic derivation still would work as intended. Thecounter
should depend on the keyset which implies that a function using it should only create outputs of a single keyset, otherwise that function would need multiple counters.I would suggest that the library should only receive tokens from a single mint with
receive
and multiple mints should be handled by an additional function. That meansreceive
can return the error to the implementor. We should also check other functions that do not return errors and make them return it.Any thoughts on this @gandlafbtc?
I'm c/p the relevant code here to make it easier to reason about: