Skip to content

Commit

Permalink
this should fix the incorrectly wired derrivation component (#151)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorijn authored Feb 5, 2022
1 parent 685cd8b commit b08bd8d
Show file tree
Hide file tree
Showing 24 changed files with 542 additions and 678 deletions.
593 changes: 261 additions & 332 deletions composer.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/Client/BinanceClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class BinanceClient implements BinanceClientInterface
{
/** @var string */
public const USER_AGENT = 'Mozilla/4.0 (compatible; Binance PHP client; Jorijn/BitcoinDca; '.PHP_OS.'; PHP/'.PHP_VERSION.')';

/** @var string */
public const HASH_ALGO = 'sha256';

Expand Down
4 changes: 2 additions & 2 deletions src/EventListener/XPubAddressUsedListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace Jorijn\Bitcoin\Dca\EventListener;

use Jorijn\Bitcoin\Dca\Component\AddressFromMasterPublicKeyComponent;
use Jorijn\Bitcoin\Dca\Component\AddressFromMasterPublicKeyComponentInterface;
use Jorijn\Bitcoin\Dca\Event\WithdrawSuccessEvent;
use Jorijn\Bitcoin\Dca\Repository\TaggedIntegerRepositoryInterface;
use Psr\Log\LoggerInterface;
Expand All @@ -23,7 +23,7 @@ class XPubAddressUsedListener
{
public function __construct(
protected TaggedIntegerRepositoryInterface $taggedIntegerRepository,
protected AddressFromMasterPublicKeyComponent $addressFromMasterPublicKeyComponent,
protected AddressFromMasterPublicKeyComponentInterface $addressFromMasterPublicKeyComponent,
protected LoggerInterface $logger,
protected ?string $configuredXPub
) {
Expand Down
1 change: 1 addition & 0 deletions tests/Client/BinanceClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ final class BinanceClientTest extends TestCase
{
private string $apiKey;
private string $apiSecret;

/** @var HttpClientInterface|MockObject */
private $httpClient;
private BinanceClient $client;
Expand Down
1 change: 1 addition & 0 deletions tests/Client/BitvavoClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ final class BitvavoClientTest extends TestCase
private string $accessWindow;
private string $apiKey;
private string $apiSecret;

/** @var LoggerInterface|MockObject */
private $logger;
private BitvavoClient $client;
Expand Down
1 change: 1 addition & 0 deletions tests/Client/KrakenClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ final class KrakenClientTest extends TestCase
private const BASE_URI = 'https://unit.test/';

protected MockHttpClient $httpClient;

/** @var LoggerInterface|MockObject */
protected $logger;
protected KrakenClient $client;
Expand Down
1 change: 1 addition & 0 deletions tests/Command/BuyCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ final class BuyCommandTest extends TestCase

/** @var BuyService|MockObject */
private $buyService;

/** @var MockObject|SerializerInterface */
private $serializer;

Expand Down
1 change: 1 addition & 0 deletions tests/Command/VerifyXPubCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ final class VerifyXPubCommandTest extends TestCase
{
/** @var AddressFromMasterPublicKeyComponent|MockObject */
private $keyFactory;

/** @var MockObject|TaggedIntegerRepositoryInterface */
private $xpubRepository;
private string $configuredKey;
Expand Down
1 change: 1 addition & 0 deletions tests/EventListener/CheckForUpdatesListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ final class CheckForUpdatesListenerTest extends TestCase

/** @var InputInterface|MockObject */
private $input;

/** @var BufferedOutput */
private $bufferedOutput;

Expand Down
1 change: 1 addition & 0 deletions tests/EventListener/IncreaseTaggedBalanceListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ final class IncreaseTaggedBalanceListenerTest extends TestCase
{
/** @var MockObject|TaggedIntegerRepositoryInterface */
private $repository;

/** @var LoggerInterface|MockObject */
private $logger;
private IncreaseTaggedBalanceListener $listener;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ final class SendTelegramOnBuyListenerTest extends TestCase
{
/** @var HttpClientInterface|mixed|MockObject */
private $httpClient;

/** @var EventDispatcherInterface|mixed|MockObject */
private $eventDispatcher;
private TelegramTransport $transport;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ final class SendTelegramOnWithdrawListenerTest extends TestCase
{
/** @var HttpClientInterface|mixed|MockObject */
private $httpClient;

/** @var EventDispatcherInterface|mixed|MockObject */
private $eventDispatcher;
private TelegramTransport $transport;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ abstract class TesterOfAbstractSendEmailListener extends TestCase
{
/** @var MailerInterface|MockObject */
protected $notifier;

/** @var HtmlConverterInterface|MockObject */
protected $htmlConverter;
protected string $to;
Expand All @@ -40,6 +41,7 @@ abstract class TesterOfAbstractSendEmailListener extends TestCase
protected string $iconLocation;
protected NotificationEmailTemplateInformation $templateConfiguration;
protected string $quotesLocation;

/** @var AbstractSendEmailListener|MockObject */
protected $listener;
protected string $templateLocation;
Expand Down
1 change: 1 addition & 0 deletions tests/EventListener/ResetTaggedBalanceListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ final class ResetTaggedBalanceListenerTest extends TestCase
{
/** @var MockObject|TaggedIntegerRepositoryInterface */
private $repository;

/** @var LoggerInterface|MockObject */
private $logger;
private ResetTaggedBalanceListener $listener;
Expand Down
1 change: 1 addition & 0 deletions tests/EventListener/WriteOrderToCsvListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
final class WriteOrderToCsvListenerTest extends TestCase
{
private string $temporaryFile;

/** @var MockObject|SerializerInterface */
private $serializer;
private WriteOrderToCsvListener $listener;
Expand Down
8 changes: 5 additions & 3 deletions tests/EventListener/XPubAddressUsedListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
namespace Tests\Jorijn\Bitcoin\Dca\EventListener;

use Exception;
use Jorijn\Bitcoin\Dca\Component\AddressFromMasterPublicKeyComponent;
use Jorijn\Bitcoin\Dca\Component\AddressFromMasterPublicKeyComponentInterface;
use Jorijn\Bitcoin\Dca\Event\WithdrawSuccessEvent;
use Jorijn\Bitcoin\Dca\EventListener\XPubAddressUsedListener;
use Jorijn\Bitcoin\Dca\Model\CompletedWithdraw;
Expand All @@ -33,8 +33,10 @@ final class XPubAddressUsedListenerTest extends TestCase
{
/** @var MockObject|TaggedIntegerRepositoryInterface */
private $xpubRepository;
/** @var AddressFromMasterPublicKeyComponent|MockObject */

/** @var AddressFromMasterPublicKeyComponentInterface|MockObject */
private $keyFactory;

/** @var LoggerInterface|MockObject */
private $logger;
private XPubAddressUsedListener $listener;
Expand All @@ -47,7 +49,7 @@ protected function setUp(): void
parent::setUp();

$this->xpubRepository = $this->createMock(TaggedIntegerRepositoryInterface::class);
$this->keyFactory = $this->createMock(AddressFromMasterPublicKeyComponent::class);
$this->keyFactory = $this->createMock(AddressFromMasterPublicKeyComponentInterface::class);
$this->logger = $this->createMock(LoggerInterface::class);
$this->configuredXPub = 'xpub'.random_int(1000, 2000);
$this->listener = new XPubAddressUsedListener(
Expand Down
2 changes: 2 additions & 0 deletions tests/Provider/XpubWithdrawAddressProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ final class XpubWithdrawAddressProviderTest extends TestCase
{
/** @var MockObject|TaggedIntegerRepositoryInterface */
private $xpubRepository;

/** @var AddressFromMasterPublicKeyComponent|MockObject */
private $keyFactory;

/** @var MockObject|ValidationInterface */
private $validation;
private XpubWithdrawAddressProvider $provider;
Expand Down
1 change: 1 addition & 0 deletions tests/Service/Bitvavo/BitvavoWithdrawServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ final class BitvavoWithdrawServiceTest extends TestCase

/** @var BitvavoClientInterface|MockObject */
private $client;

/** @var LoggerInterface|MockObject */
private $logger;
private BitvavoWithdrawService $service;
Expand Down
1 change: 1 addition & 0 deletions tests/Service/Bl3p/Bl3pBuyServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ final class Bl3pBuyServiceTest extends TestCase
private const BTC = 'BTC';
private const MONEY_ORDER_RESULT = '/money/order/result';
private const MONEY_ORDER_ADD = '/money/order/add';

/** @var Bl3pClientInterface|MockObject */
private $client;
private string $baseCurrency;
Expand Down
1 change: 1 addition & 0 deletions tests/Service/Bl3p/Bl3pWithdrawServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ final class Bl3pWithdrawServiceTest extends TestCase

/** @var Bl3pClientInterface|MockObject */
private $client;

/** @var LoggerInterface|MockObject */
private $logger;
private Bl3pWithdrawService $service;
Expand Down
2 changes: 2 additions & 0 deletions tests/Service/BuyServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ final class BuyServiceTest extends TestCase
{
/** @var EventDispatcherInterface|MockObject */
private $dispatcher;

/** @var LoggerInterface|MockObject */
private $logger;
private string $configuredExchange;

/** @var BuyServiceInterface|MockObject */
private $supportedService;
private int $timeout;
Expand Down
1 change: 1 addition & 0 deletions tests/Service/Kraken/KrakenWithdrawServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ final class KrakenWithdrawServiceTest extends TestCase
{
/** @var KrakenClientInterface|MockObject */
private $client;

/** @var LoggerInterface|MockObject */
private $logger;
private string $withdrawKey;
Expand Down
4 changes: 4 additions & 0 deletions tests/Service/WithdrawServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,17 @@ final class WithdrawServiceTest extends TestCase

/** @var MockObject|WithdrawAddressProviderInterface */
private $addressProvider;

/** @var MockObject|WithdrawServiceInterface */
private $supportedService;

/** @var EventDispatcherInterface|MockObject */
private $dispatcher;

/** @var LoggerInterface|MockObject */
private $logger;
private string $configuredExchange;

/** @var MockObject|TaggedIntegerRepositoryInterface */
private $balanceRepository;

Expand Down
Loading

0 comments on commit b08bd8d

Please sign in to comment.