arbitraryMSSigInput :: Gen (SigInput, [PrvKey])
arbitraryMSSigInput = do
    (m,n) <- arbitraryMSParam
    ks    <- vectorOf n arbitraryPrvKey
    let out = PayMulSig (map derivePubKey ks) m
    op <- arbitraryOutPoint
    sh <- arbitraryValidSigHash
    perm <- choose (0,n-1)
    let ksPerm = take m $ permutations ks !! perm
    return (SigInput out op sh Nothing, ksPerm)

-- | Arbitrary SigInput with  ScriptOutput of type PaySH and a RedeemScript
arbitraryMSSigInput :: Gen (SigInput, [PrvKey])
arbitraryMSSigInput = do
    (m,n) <- arbitraryMSParam
    ks    <- vectorOf n arbitraryPrvKey
    let out = PayMulSig (map derivePubKey ks) m
    op <- arbitraryOutPoint
    sh <- arbitraryValidSigHash
    perm <- choose (0,n-1)
    let ksPerm = take m $ permutations ks !! perm
    return (SigInput out op sh Nothing, ksPerm)

-- | Arbitrary SigInput with  ScriptOutput of type PaySH and a RedeemScript
arbitraryMSSigInput = do
    (m,n) <- arbitraryMSParam
    ks    <- vectorOf n arbitraryPrvKey
    let out = PayMulSig (map derivePubKey ks) m
    op <- arbitraryOutPoint
    sh <- arbitraryValidSigHash
    perm <- choose (0,n-1)
    let ksPerm = take m $ permutations ks !! perm
    return (SigInput out op sh Nothing, ksPerm)

-- | Arbitrary SigInput with  ScriptOutput of type PaySH and a RedeemScript