This was reported to me by @bigspider, and i think it makes sense. Copy paste of the report follows.
async fn sign_tx(&self, tx: &mut Psbt) -> Result<(), Error>;
I think you shouldn't abstract the policy in the HWI trait; sign_psbt without specifying what policy you're signing with puts the burden of figuring it out to the library.
But the caller of sign_psbt always knows which policy you're signing with.
if you have multiple inputs with different policies, most likely it's going to be from different signers − so multiple calls to sign_psbt with different policies
sure, one might imagine signing with multiple policies at the same time (if they are all controlled by the same hardware wallet), but I wouldn't bother yet, can generalize in the future
This was reported to me by @bigspider, and i think it makes sense. Copy paste of the report follows.
I think you shouldn't abstract the
policyin the HWI trait; sign_psbt without specifying what policy you're signing with puts the burden of figuring it out to the library.But the caller of sign_psbt always knows which policy you're signing with.
if you have multiple inputs with different policies, most likely it's going to be from different signers − so multiple calls to sign_psbt with different policies
sure, one might imagine signing with multiple policies at the same time (if they are all controlled by the same hardware wallet), but I wouldn't bother yet, can generalize in the future