-
Notifications
You must be signed in to change notification settings - Fork 385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
invoice: Getter for fallbacks as Address'es #882
Comments
is there any good way right now to convert a |
Sadly only pretty manually, we should fix this! |
I'll make an match fallback {
Fallback::SegWitProgram { version, program } => {
let version = WitnessVersion::from_u5(version).unwrap();
let script = Script::new_witness_program(version, program.as_slice());
Address::from_script(&script, Network::Bitcoin)
}
Fallback::PubKeyHash(pkh) => {
let pkh = PubkeyHash::from_slice(&pkh).unwrap();
let script = Script::new_p2pkh(&pkh);
Address::from_script(&script, Network::Bitcoin)
}
Fallback::ScriptHash(sh) => {
let sh = ScriptHash::from_slice(&sh).unwrap();
let script = Script::new_p2sh(&sh);
Address::from_script(&script, Network::Bitcoin)
}
} |
Currently, the builder has a method that takes a We have a few options that I can imagine:
I'm sorta leaning towards the last option to avoid too much change in the interface, but I'm open to other options. |
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 |
Nah, we'll need that or something like that somewhere, regardless. Just need to figure out which interface. |
The
fallback()
method returns some custom address payload implementation. A regularfallback_addresses
or so that is just aVec<Address>
would be great.Or an
Into<Address>
forFallback
.The text was updated successfully, but these errors were encountered: