-
I'm trying to override LDK's interface LDKSignerProvider : SignerProvider.SignerProviderInterface {
override fun get_shutdown_scriptpubkey(): ShutdownScript {
val address = Address(OnchainWallet.getNewAddress())
val payload: Payload = address.payload()
when (payload) {
is Payload.WitnessProgram -> {
return ShutdownScript.new_witness_program(
WitnessVersion(payload.version.name.toByte()),
payload.program.toUByteArray().toByteArray()
)
}
else -> {
return this._shutdown_scriptpubkey
}
}
}
Is it possible for |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
It returns |
Beta Was this translation helpful? Give feedback.
It returns
Result_ShutdownScriptInvalidShutdownScriptZ
because it can fail. I'm not familiar with Kotlin, but you'd need to check if the call failed or not to get aShutdownScript
out of it.