arbitrarySHSigInput :: Gen (SigInput, [PrvKey])
arbitrarySHSigInput = do
    (SigInput rdm op sh _, ks) <- oneof
        [ f <$> arbitraryPKSigInput
        , f <$> arbitraryPKHashSigInput
        , arbitraryMSSigInput
        ]
    let out = PayScriptHash $ getAddrHash $ p2shAddr rdm
    return (SigInput out op sh $ Just rdm, ks)
  where
    f (si, k) = (si, [k])

-- | Arbitrary Tx (empty TxIn), SigInputs and PrvKeys that can be passed to
-- signTx or detSignTx to fully sign the Tx.
arbitrarySHSigInput :: Gen (SigInput, [PrvKey])
arbitrarySHSigInput = do
    (SigInput rdm op sh _, ks) <- oneof
        [ f <$> arbitraryPKSigInput
        , f <$> arbitraryPKHashSigInput
        , arbitraryMSSigInput
        ]
    let out = PayScriptHash $ getAddrHash $ p2shAddr rdm
    return (SigInput out op sh $ Just rdm, ks)
  where
    f (si, k) = (si, [k])

-- | Arbitrary Tx (empty TxIn), SigInputs and PrvKeys that can be passed to
-- signTx or detSignTx to fully sign the Tx.
arbitrarySHSigInput = do
    (SigInput rdm op sh _, ks) <- oneof
        [ f <$> arbitraryPKSigInput
        , f <$> arbitraryPKHashSigInput
        , arbitraryMSSigInput
        ]
    let out = PayScriptHash $ getAddrHash $ p2shAddr rdm
    return (SigInput out op sh $ Just rdm, ks)
  where
    f (si, k) = (si, [k])

-- | Arbitrary Tx (empty TxIn), SigInputs and PrvKeys that can be passed to
-- signTx or detSignTx to fully sign the Tx.