Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BC break: remove BloomFilter related classes to separate package #871

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ All contributions are welcome. Please see [[this page](https://github.com/Bit-Wa

# Other projects

- [bitcoin-php-bloom-filter](https://github.com/Bit-Wasp/bitcoin-php-bloom-filter) - Package providing bloom filter support.
- [buffertools-php](https://github.com/Bit-Wasp/buffertools-php) - Toolkit for working with binary data in PHP
- [ext-secp256k1](https://github.com/Bit-Wasp/secp256k1-php) - PHP bindings to libsecp256k1
- [ext-bitcoinconsensus](https://github.com/Bit-Wasp/bitcoinconsensus-php) - PHP bindings to libbitcoinconsensus
Expand Down
20 changes: 0 additions & 20 deletions src/Block/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace BitWasp\Bitcoin\Block;

use BitWasp\Bitcoin\Bloom\BloomFilter;
use BitWasp\Bitcoin\Math\Math;
use BitWasp\Bitcoin\Serializable;
use BitWasp\Bitcoin\Serializer\Block\BlockHeaderSerializer;
Expand Down Expand Up @@ -94,25 +93,6 @@ public function getTransaction(int $i): TransactionInterface
return $this->transactions[$i];
}

/**
* @param BloomFilter $filter
* @return FilteredBlock
*/
public function filter(BloomFilter $filter): FilteredBlock
{
$vMatch = [];
$vHashes = [];
foreach ($this->getTransactions() as $tx) {
$vMatch[] = $filter->isRelevantAndUpdate($tx);
$vHashes[] = $tx->getTxHash();
}

return new FilteredBlock(
$this->getHeader(),
PartialMerkleTree::create(count($this->getTransactions()), $vHashes, $vMatch)
);
}

/**
* {@inheritdoc}
* @see \BitWasp\Buffertools\SerializableInterface::getBuffer()
Expand Down
7 changes: 0 additions & 7 deletions src/Block/BlockInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace BitWasp\Bitcoin\Block;

use BitWasp\Bitcoin\Bloom\BloomFilter;
use BitWasp\Bitcoin\SerializableInterface;
use BitWasp\Bitcoin\Transaction\TransactionInterface;
use BitWasp\Buffertools\BufferInterface;
Expand Down Expand Up @@ -39,10 +38,4 @@ public function getTransactions(): array;
* @return TransactionInterface
*/
public function getTransaction(int $i): TransactionInterface;

/**
* @param BloomFilter $filter
* @return FilteredBlock
*/
public function filter(BloomFilter $filter): FilteredBlock;
}
58 changes: 0 additions & 58 deletions src/Block/FilteredBlock.php

This file was deleted.

262 changes: 0 additions & 262 deletions src/Block/PartialMerkleTree.php

This file was deleted.

Loading