You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The fallback() method returns some custom address payload implementation. A regular fallback_addresses or so that is just a Vec<Address> would be great.
Currently, the builder has a method that takes a Fallback, which are then exposed via an accessor returning Vec<&Fallback>. So an Into<Address> would require a clone since self is taken by value.
We have a few options that I can imagine:
use the Into approach and live with users needing to clone
hide Fallback by having separate builder methods for each variant and have the accessor return Vec<Address> like BOLT 12 invoices do
have an inconsistent interface where the builder remains as it is and the accessor returns Vec<Address>
add an additional accessor that returns Vec<Address> similar to private_route / route_hints, which would essentially hide the clone from the user
I'm sorta leaning towards the last option to avoid too much change in the interface, but I'm open to other options.
Activity
futurepaul commentedon Feb 7, 2023
is there any good way right now to convert a
Fallbackinto anAddress? just ran into this and not sure the best strat.TheBlueMatt commentedon Feb 7, 2023
Sadly only pretty manually, we should fix this!
futurepaul commentedon Feb 7, 2023
I'll make an
Into<Address>based on this logic:jkczyz commentedon Feb 8, 2023
Currently, the builder has a method that takes a
Fallback, which are then exposed via an accessor returningVec<&Fallback>. So anInto<Address>would require aclonesinceselfis taken by value.We have a few options that I can imagine:
Intoapproach and live with users needing tocloneFallbackby having separate builder methods for each variant and have the accessor returnVec<Address>like BOLT 12 invoices doVec<Address>Vec<Address>similar toprivate_route/route_hints, which would essentially hide the clone from the userI'm sorta leaning towards the last option to avoid too much change in the interface, but I'm open to other options.
futurepaul commentedon Feb 8, 2023
sorry I saw this comment after writing this code so thought I'd throw it up here and if it's helpful can iterate, otherwise feel free to close
jkczyz commentedon Feb 8, 2023
Nah, we'll need that or something like that somewhere, regardless. Just need to figure out which interface.