for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace BitWasp\Bitcoin\Transaction\Factory;
use BitWasp\Bitcoin\Script\ScriptInterface;
class SignData
{
/**
* @var ScriptInterface
*/
protected $redeemScript = null;
protected $witnessScript = null;
* @param ScriptInterface $redeemScript
* @return $this
public function p2sh(ScriptInterface $redeemScript)
$this->redeemScript = $redeemScript;
return $this;
}
* @param ScriptInterface $witnessScript
public function p2wsh(ScriptInterface $witnessScript)
$this->witnessScript = $witnessScript;
* @return ScriptInterface
public function getRedeemScript()
if (null === $this->redeemScript) {
throw new \RuntimeException('Redeem script requested but not set');
return $this->redeemScript;
public function getWitnessScript()
if (null === $this->witnessScript) {
throw new \RuntimeException('Witness script requested but not set');
return $this->witnessScript;