public PayToScriptHashSigParameters ExtractScriptSigParameters(Network network, Script scriptSig, Script scriptPubKey)
        {
            Op[] ops  = scriptSig.ToOps().ToArray();
            Op[] ops2 = scriptPubKey == null ? null : scriptPubKey.ToOps().ToArray();
            if (!CheckScriptSigCore(network, scriptSig, ops, scriptPubKey, ops2))
            {
                return(null);
            }

            var result = new PayToScriptHashSigParameters();

            result.RedeemScript = Script.FromBytesUnsafe(ops[ops.Length - 1].PushData);
            result.Pushes       = ops.Take(ops.Length - 1).Select(o => o.PushData).ToArray();
            return(result);
        }
 public Script GenerateScriptSig(PayToScriptHashSigParameters parameters)
 {
     return(GenerateScriptSig(parameters.Pushes, parameters.RedeemScript));
 }