Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Backend - Engine
Project
Project
Details
Activity
Releases
Dependency List
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
198
Issues
198
List
Boards
Labels
Service Desk
Milestones
Merge Requests
27
Merge Requests
27
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Backend - Engine
Compare Revisions
b333da6c3414eeee3eec7ac9ce6f678ec12e4db0...ec26f9a681309ab42d0d823a7e5c813dbf2deadd
Source
ec26f9a681309ab42d0d823a7e5c813dbf2deadd
Select Git revision
...
Target
b333da6c3414eeee3eec7ac9ce6f678ec12e4db0
Select Git revision
Compare
Commits (2)
updated to meet pricing changes
· 04ab57cb
Ben Hayward
authored
1 hour ago
04ab57cb
updated spec test
· ec26f9a6
Ben Hayward
authored
1 hour ago
ec26f9a6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
34 deletions
+6
-34
Plus.php
Core/Wire/Delegates/Plus.php
+5
-1
PlusSpec.php
Spec/Core/Wire/Delegates/PlusSpec.php
+1
-33
No files found.
Core/Wire/Delegates/Plus.php
View file @
ec26f9a6
...
...
@@ -47,7 +47,11 @@ class Plus
}
// 20 tokens, 180 tokens, 500 tokens.
if
(
$wire
->
getAmount
()
!=
"20000000000000000000"
&&
$wire
->
getAmount
()
!=
"180000000000000000000"
&&
$wire
->
getAmount
()
!=
"500000000000000000000"
)
{
if
((
$wire
->
getAmount
()
!=
"20000000000000000000"
&&
$receiver_address
===
'offchain'
)
// 20 offchain
&&
(
$wire
->
getAmount
()
!=
"200000000000000000000"
&&
$receiver_address
===
'offchain'
)
// 200 offchain
&&
(
$wire
->
getAmount
()
!=
"5000000000000000000000"
&&
$receiver_address
===
'offchain'
)
// 5000 offchain
&&
(
$wire
->
getAmount
()
!=
"40000000000000000000"
&&
$receiver_address
!==
'offchain'
)
// 40 onchain
&&
(
$wire
->
getAmount
()
!=
"400000000000000000000"
&&
$receiver_address
!==
'offchain'
))
{
// 400 onchain
return
$wire
;
//incorrect wire amount sent
}
...
...
This diff is collapsed.
Click to expand it.
Spec/Core/Wire/Delegates/PlusSpec.php
View file @
ec26f9a6
...
...
@@ -65,38 +65,6 @@ class PlusSpec extends ObjectBehavior
$this
->
onWire
(
$wire
,
'offchain'
);
}
function
it_should_not_make_a_user_plus_if_offchain_wire_is_wrong_guid_sent
(
Config
$config
)
{
$this
->
beConstructedWith
(
$config
);
$config
->
get
(
'blockchain'
)
->
willReturn
([
'contracts'
=>
[
'wire'
=>
[
'plus_guid'
=>
123
,
'plus_address'
=>
'0xaddr'
,
]
]
]);
$receiver
=
new
User
;
$receiver
->
guid
=
123
;
$sender
=
new
User
;
$sender
->
guid
=
456
;
$wire
=
new
Wire
();
$wire
->
setReceiver
(
$receiver
)
->
setAmount
(
"10000000000000000000"
)
->
setSender
(
$sender
);
$wire
=
$this
->
onWire
(
$wire
,
'offchain'
);
$wire
->
getSender
()
->
isPlus
()
->
shouldBe
(
false
);
}
function
it_should_make_a_user_plus_if_onchain_wire_sent
(
Config
$config
,
User
$receiver
,
...
...
@@ -213,4 +181,4 @@ class PlusSpec extends ObjectBehavior
->
shouldEqualApproximately
(
strtotime
(
'+13 months'
,
time
()),
1.0e-9
);
}
}
\ No newline at end of file
}
This diff is collapsed.
Click to expand it.