public static Gen <uint160> Hash160() => from bytes in PrimitiveGenerator.RandomBytes(20) select new uint160(bytes);
public static Gen <HDFingerprint> HDFingerprint() => from bytes in PrimitiveGenerator.RandomBytes(4) select new HDFingerprint(bytes);
public static Gen <uint256> Hash256() => from bytes in PrimitiveGenerator.RandomBytes(32) select new uint256(bytes);
public static Gen <Dictionary <byte[], byte[]> > UnknownKVMap() => from itemNum in Gen.Choose(0, 15) from keys in Gen.ListOf(itemNum, PrimitiveGenerator.RandomBytes()) from values in Gen.ListOf(itemNum, PrimitiveGenerator.RandomBytes()) select Utils.DictionaryFromList <byte[], byte[]>(keys.ToList(), values.ToList());
private static Gen <Op> PushOnlyOpcode() => from bytes in PrimitiveGenerator.RandomBytes(4) select Op.GetPushOp(bytes);
public static Gen <uint160> Hash160() => PrimitiveGenerator.RandomBytes().Select(bs => Hashes.Hash160(bs));
public static Gen <uint256> Hash256() => PrimitiveGenerator.RandomBytes().Select(bs => Hashes.Hash256(bs));
public static Gen <KeyPath> KeyPath() => from raw in Gen.NonEmptyListOf(PrimitiveGenerator.RandomBytes(4)) let flattenBytes = raw.ToList().Aggregate((a, b) => a.Concat(b)) select NBitcoin.KeyPath.FromBytes(flattenBytes);