Skip to content

Commit

Permalink
upgrade to bitcoin-php ^0.0.35
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Kerin committed Nov 4, 2018
1 parent b7c8d86 commit a712c7f
Show file tree
Hide file tree
Showing 35 changed files with 200 additions and 682 deletions.
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"ext-dom": "*",
"ext-curl": "*",

"bitwasp/bitcoin": "v0.0.34.1",
"bitwasp/bitcoin": "^v0.0.35.0",
"btccom/bitwasp-bitcoin-bch-addon": "v0.0.2",
"btccom/justencrypt": "v0.2.0",
"btccom/cashaddress": "v0.0.3",
"mdanter/ecc": "v0.4.*",
Expand All @@ -46,7 +47,8 @@
"dompdf/dompdf" : "0.6.*",
"endroid/qrcode": "1.5.*",
"blocktrail/cryptojs-aes-php": "0.1.*",
"spomky-labs/php-aes-gcm": "v1.2.0"
"spomky-labs/php-aes-gcm": "v1.2.0",
"symfony/http-foundation": "^2.7|^3.0|^4.0"
},
"require-dev": {
"phpunit/phpunit": "5.*",
Expand Down
10 changes: 4 additions & 6 deletions examples/wallet_cpfp.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<?php

use BitWasp\Bitcoin\Address\AddressFactory;
use BitWasp\Bitcoin\Script\ScriptFactory;
use Blocktrail\SDK\BlocktrailSDK;
use Blocktrail\SDK\Connection\Exceptions\ObjectNotFound;
use Blocktrail\SDK\TransactionBuilder;
use Blocktrail\SDK\Wallet;
use Blocktrail\SDK\WalletInterface;

require_once __DIR__ . "/../vendor/autoload.php";

Expand Down Expand Up @@ -53,9 +50,10 @@

// send info
$myAddress = $wallet->getNewAddress();
$addrReader = $wallet->getAddressReader();

// setup txbuilder
$txBuilder = new TransactionBuilder();
$txBuilder = new TransactionBuilder($addrReader);

// set change address to our address
$txBuilder->setChangeAddress($myAddress);
Expand Down Expand Up @@ -90,8 +88,8 @@
// add UTXOs to txbuilder
foreach ($utxos as $utxo) {
$scriptPubKey = ScriptFactory::fromHex($utxo['scriptpubkey_hex']);
$address = AddressFactory::fromString($utxo['address']);
$path = $wallet->getPathForAddress($address->getAddress());
$address = $addrReader->fromString($utxo['address']);
$path = $wallet->getPathForAddress($address->getAddress())['path'];
$scripts = $wallet->getWalletScriptByPath($path);
$redeemScript = $scripts->getRedeemScript();
$witnessScript = null;
Expand Down
46 changes: 0 additions & 46 deletions src/Address/AddressReaderBase.php

This file was deleted.

15 changes: 0 additions & 15 deletions src/Address/Base32AddressInterface.php

This file was deleted.

81 changes: 0 additions & 81 deletions src/Address/BitcoinAddressReader.php

This file was deleted.

123 changes: 0 additions & 123 deletions src/Address/BitcoinCashAddressReader.php

This file was deleted.

Loading

0 comments on commit a712c7f

Please sign in to comment.