Ejemplo n.º 1
0
 private static Gen <TxOut> OutputFromRedeem(Script sc) =>
 from money in MoneyGenerator.Money()
 from isP2WSH in PrimitiveGenerator.Bool()
 from isP2SH in PrimitiveGenerator.Bool()
     where isP2WSH || isP2SH
 let redeem = (isP2SH && isP2WSH) ? sc.WitHash.ScriptPubKey : sc
              let scriptPubKey = isP2SH ? redeem.Hash.ScriptPubKey : redeem.WitHash.ScriptPubKey
                                 select new TxOut(money, scriptPubKey);
Ejemplo n.º 2
0
 public static Gen <TxOut> WitnessOutput() =>
 from m in MoneyGenerator.Money()
 from spk in ScriptGenerator.WitnessScriptPubKey()
 select new TxOut(m, spk);
Ejemplo n.º 3
0
 private static Gen <TxOut> OutputFromKey(PubKey key) =>
 from money in MoneyGenerator.Money()
 from isP2WPKH in PrimitiveGenerator.Bool()
 from isP2SH in PrimitiveGenerator.Bool()
 let scriptPubKey = (isP2SH && isP2WPKH) ? key.WitHash.ScriptPubKey.Hash.ScriptPubKey : isP2WPKH ? key.WitHash.ScriptPubKey : key.Hash.ScriptPubKey
                    select new TxOut(money, scriptPubKey);