WIP: [Sprint/GiddyGiraffe](feat): Add in delegate for checking for onchain badge
Closes #493
This change, when an onchain boost is accepted, should set the users newfound onchain_booster variable to the (current Unix timestamp + 1 week).
This is to be digested by the front-end to determine whether or not to show the onchain booster badge on a users profile.
Ideally this would be tested on a seperate domain before public release.
added 1 commit
- b47d4b3d - Moved to delegate, and only triggering on one tx
added 2 commits
added 2 commits
changed title from WIP: Add in event for checking for onchain badge to WIP: Add in delegate for checking for onchain badge
added 2 commits
- Resolved by Ben Hayward
- Resolved by Ben Hayward
- Last updated by Mark Harding
1044 1047 return "urn:user:{$this->getGuid()}"; 1045 1048 } 1046 1049 1050 public function isOnchainBooster() 1051 { 1052 return (int) $this->onchain_booster; - Owner
is would imply a boolean
- Developer
True that
- Owner
keep the boolean
- Developer
Can you explain? I thought it was supposed to be returning the time of the last onchain boost.
@markeharding I should note, the above code has now been changed over in changes.
- Owner
We still want isOnchainBooster to return a boolean if they are in the timeframe.
- Last updated by Mark Harding
15 16 class OnchainBadgeSpec extends ObjectBehavior 17 { 18 19 function it_is_initializable() 20 { 21 $this->shouldHaveType(OnchainBadge::class); 22 } 23 24 function it_should_update_a_users_plus_badge_expiry(Boost $boost, User $user) 25 { 26 $boost->getOwner() 27 ->shouldBeCalled() 28 ->willReturn($user); 29 30 $user->setOnchainBooster(Argument::any()) - Owner
should we not check the time is set correctly?
changed this line in version 12 of the diff
- Developer
I test this in the User entities spec tests here:
- Owner
Needs to be tested at the unit level too.
- Resolved by Ben Hayward
- Resolved by Ben Hayward
- Resolved by Ben Hayward
changed title from WIP: Add in delegate for checking for onchain badge to WIP: {+Sprint/GiddyGiraffe: +}Add in delegate for checking for onchain badge
changed the description
- Resolved by Ben Hayward
21 { 22 $this->user = $user; 23 } 24 25 function it_is_initializable() 26 { 27 $this->shouldHaveType(OnchainBadgeDelegate::class); 28 } 29 30 function it_should_update_a_users_plus_badge_expiry(Boost $boost, User $user) 31 { 32 $boost->getOwner() 33 ->shouldBeCalled() 34 ->willReturn($user); 35 36 $user->setOnchainBooster(Argument::any()) - Owner
Should check the correct time (7 days) is being set