Commit 3454e3c8 authored by Emiliano Balbuena's avatar Emiliano Balbuena

(test): Spec tests for Manager

1 merge request!393WIP: (feat): Withdrawal status support
Pipeline #95489454 failed with stages
in 2 minutes and 37 seconds
......@@ -22,13 +22,13 @@ class Manager
/** @var TransactionsManager */
protected $txManager;
/** @var OffchainTransactions $offChainTransactions */
/** @var OffchainTransactions */
protected $offChainTransactions;
/** @var Config $config */
/** @var Config */
protected $config;
/** @var Ethereum $eth */
/** @var Ethereum */
protected $eth;
/** @var Repository */
......@@ -230,6 +230,10 @@ class Manager
throw new Exception('Request is not pending');
}
if (BigNumber::_($request->getAmount())->lt(0)) {
throw new Exception('The withdraw amount must be positive');
}
if ((string) $request->getUserGuid() !== (string) $transaction->getUserGuid()) {
throw new Exception('The user who requested this operation does not match the transaction');
}
......@@ -246,10 +250,6 @@ class Manager
throw new Exception('The gas requested does not match the transaction');
}
if (BigNumber::_($request->getAmount())->lt(0)) {
throw new Exception('The withdraw amount must be positive');
}
$user = new User;
$user->guid = (string) $request->getUserGuid();
......
This diff is collapsed.
Please register or to comment