Skip to content

Commit 8a0f395

Browse files
committed
better namespace
1 parent d89ecf9 commit 8a0f395

31 files changed

+65
-65
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@
2525
},
2626
"autoload": {
2727
"psr-4": {
28-
"AndKom\\PhpBitcoinBlockchain\\": "src/"
28+
"AndKom\\Bitcoin\\Blockchain\\": "src/"
2929
}
3030
},
3131
"autoload-dev": {
3232
"psr-4": {
33-
"AndKom\\PhpBitcoinBlockchain\\Tests\\": "tests/"
33+
"AndKom\\Bitcoin\\Blockchain\\Tests\\": "tests/"
3434
}
3535
}
3636
}

examples/read_blockchain.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
$dataDir = getenv('HOME') . '/Library/Application Support/Bitcoin';
66

7-
$reader = new \AndKom\PhpBitcoinBlockchain\BlockchainReader($dataDir);
7+
$reader = new \AndKom\Bitcoin\Blockchain\BlockchainReader($dataDir);
88

99
foreach ($reader->readBlocks(0, 100) as $height => $block) {
10-
echo $height . " => " . \AndKom\PhpBitcoinBlockchain\Utils::hashToHex($block->header->getHash()) . "\n";
10+
echo $height . " => " . \AndKom\Bitcoin\Blockchain\Utils::hashToHex($block->header->getHash()) . "\n";
1111
}

examples/read_blocks.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@
66
$blocksDir = "$dataDir/blocks";
77
$blockFile = "$blocksDir/blk00001.dat";
88

9-
$reader = new \AndKom\PhpBitcoinBlockchain\BlockFileReader();
9+
$reader = new \AndKom\Bitcoin\Blockchain\BlockFileReader();
1010

1111
foreach ($reader->read($blockFile) as $block) {
1212
foreach ($block->transactions as $tx) {
13-
echo "\nTX: " . \AndKom\PhpBitcoinBlockchain\Utils::hashToHex($tx->getHash()) . "\n";
13+
echo "\nTX: " . \AndKom\Bitcoin\Blockchain\Utils::hashToHex($tx->getHash()) . "\n";
1414

1515
foreach ($tx->inputs as $in) {
1616
if ($in->isCoinbase()) {
1717
echo "IN: Coinbase\n";
1818
} else {
19-
echo "IN: " . \AndKom\PhpBitcoinBlockchain\Utils::hashToHex($in->prevTxHash) . ':' . $in->prevTxOutIndex . "\n";
19+
echo "IN: " . \AndKom\Bitcoin\Blockchain\Utils::hashToHex($in->prevTxHash) . ':' . $in->prevTxOutIndex . "\n";
2020
}
2121
}
2222

examples/read_chainstate.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
$dataDir = getenv('HOME') . '/Library/Application Support/Bitcoin';
66
$chainstateDir = "$dataDir/chainstate";
77

8-
$reader = new \AndKom\PhpBitcoinBlockchain\ChainstateReader($chainstateDir);
8+
$reader = new \AndKom\Bitcoin\Blockchain\ChainstateReader($chainstateDir);
99

1010
foreach ($reader->read() as $unspentOutput) {
11-
echo "TX: " . \AndKom\PhpBitcoinBlockchain\Utils::hashToHex($unspentOutput->hash) . "\n";
11+
echo "TX: " . \AndKom\Bitcoin\Blockchain\Utils::hashToHex($unspentOutput->hash) . "\n";
1212
echo "Index: " . $unspentOutput->index . "\n";
1313
echo "Height: " . $unspentOutput->height . "\n";
1414
echo "Coinbase: " . $unspentOutput->coinbase . "\n";

examples/read_index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
$blocksDir = "$dataDir/blocks";
77
$indexDir = "$blocksDir/index";
88

9-
$reader = new \AndKom\PhpBitcoinBlockchain\IndexReader($indexDir);
9+
$reader = new \AndKom\Bitcoin\Blockchain\IndexReader($indexDir);
1010

1111
echo "Reading block index...\n";
1212

src/AddressSerializer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
declare(strict_types=1);
44

5-
namespace AndKom\PhpBitcoinBlockchain;
5+
namespace AndKom\Bitcoin\Blockchain;
66

7-
use AndKom\PhpBitcoinBlockchain\Network\Bitcoin;
7+
use AndKom\Bitcoin\Blockchain\Network\Bitcoin;
88
use function BitWasp\Bech32\encodeSegwit;
99

1010
/**
1111
* Class AddressSerializer
12-
* @package AndKom\PhpBitcoinBlockchain
12+
* @package AndKom\Bitcoin\Blockchain
1313
*/
1414
class AddressSerializer
1515
{

src/Block.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
declare(strict_types=1);
44

5-
namespace AndKom\PhpBitcoinBlockchain;
5+
namespace AndKom\Bitcoin\Blockchain;
66

77
use AndKom\BCDataStream\Reader;
88
use AndKom\BCDataStream\Writer;
99

1010
/**
1111
* Class Block
12-
* @package AndKom\PhpBitcoinBlockchain
12+
* @package AndKom\Bitcoin\Blockchain
1313
*/
1414
class Block
1515
{

src/BlockFileReader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
declare(strict_types=1);
44

5-
namespace AndKom\PhpBitcoinBlockchain;
5+
namespace AndKom\Bitcoin\Blockchain;
66

77
use AndKom\BCDataStream\Reader;
88

99
/**
1010
* Class BlockFileReader
11-
* @package AndKom\PhpBitcoinBlockchain
11+
* @package AndKom\Bitcoin\Blockchain
1212
*/
1313
class BlockFileReader
1414
{

src/BlockInfo.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
declare(strict_types=1);
44

5-
namespace AndKom\PhpBitcoinBlockchain;
5+
namespace AndKom\Bitcoin\Blockchain;
66

77
use AndKom\BCDataStream\Reader;
88

99
/**
1010
* Class BlockInfo
11-
* @package AndKom\PhpBitcoinBlockchain
11+
* @package AndKom\Bitcoin\Blockchain
1212
*/
1313
class BlockInfo
1414
{

src/BlockchainReader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
declare(strict_types=1);
44

5-
namespace AndKom\PhpBitcoinBlockchain;
5+
namespace AndKom\Bitcoin\Blockchain;
66

77
/**
88
* Class BlockchainReader
9-
* @package AndKom\PhpBitcoinBlockchain
9+
* @package AndKom\Bitcoin\Blockchain
1010
*/
1111
class BlockchainReader
1212
{

0 commit comments

Comments
 (0)