Skip to content
Projects
Groups
Snippets
Help
Sign in / Register
Toggle navigation
Minds Backend - Engine
Project overview
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
296
Merge Requests
41
CI / CD
Security & Compliance
Packages
Wiki
Snippets
Members
Collapse sidebar
Close sidebar
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Backend - Engine
Commits
3454e3c8
Commit
3454e3c8
authored
28 minutes ago
by
Emiliano Balbuena
Browse files
Options
Download
(test): Spec tests for Manager
parent
995d247c
goal/withdrawals-approval
1 merge request
!393
WIP: (feat): Withdrawal status support
Pipeline
#95489454
failed with stages
in 2 minutes and 37 seconds
Changes
2
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
880 additions
and
217 deletions
+880
-217
Core/Rewards/Withdraw/Manager.php
View file @
3454e3c8
...
...
@@ -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.
Spec/Core/Rewards/Withdraw/ManagerSpec.php
View file @
3454e3c8
This diff is collapsed.
Click to expand it.
Please
register
or
sign in
to comment