Skip to content

Next

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
Minds Backend - Engine
Minds Backend - Engine
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
    • Locked Files
  • Issues 146
    • Issues 146
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 36
    • Merge Requests 36
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Registry
    • Registry
  • Packages
    • Packages
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Minds
  • Minds Backend - EngineMinds Backend - Engine
  • Merge Requests
  • !191

Open
Opened 4 days ago by Ben Hayward@benhayward.ben
  • Report abuse
Report abuse

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.

Edited 30 minutes ago by Ben Hayward

Check out, review, and merge locally

Step 1. Fetch and check out the branch for this merge request

git fetch https://gitlab.com/benhayward.ben/engine.git onchain-badge-backend-additions
git checkout -b benhayward.ben/engine-onchain-badge-backend-additions FETCH_HEAD

Step 2. Review the changes locally

Step 3. Merge the branch and fix any conflicts that come up

git fetch origin
git checkout origin/master
git merge --no-ff benhayward.ben/engine-onchain-badge-backend-additions

Step 4. Push the result of the merge to GitLab

git push origin master

Note that pushing to GitLab requires write access to this repository.

Tip: You can also checkout merge requests locally by following these guidelines.

Request to merge benhayward.ben:onchain-badge-backend-additions into master
The source branch is 8 commits behind the target branch
Open in Web IDE
  • Email patches
  • Plain diff
Pipeline #65537741 (#129) passed for 815a1529 on benhayward.ben:onchain-badge-backend-additions
      Requires 2 more approvals from Devs.
      Marcelo Rivera
      Marcelo Rivera
      Emiliano Balbuena
      Emiliano Balbuena
      Brian Hatchet
      Brian Hatchet
      Rami Albatal
      Rami Albatal
      Martin Santangelo
      Martin Santangelo
      This is a Work in Progress

      Allows commits from members who can merge to the target branch

      Closes #493

      Deletes source branch

      You can merge this merge request manually using the
      • Discussion 15
      • Commits 17
      • Pipelines 14
      • Changes 6
      6/9 discussions resolved
      • Loading...
      • Ben Hayward @benhayward.ben added 1 commit 2 days ago

        added 1 commit

        • b47d4b3d - Moved to delegate, and only triggering on one tx

        Compare with previous version

      • Ben Hayward @benhayward.ben added 1 commit 2 days ago

        added 1 commit

        • 7ff4b980 - Quickfix

        Compare with previous version

      • Ben Hayward @benhayward.ben added 2 commits 2 days ago

        added 2 commits

        • 22bb5263 - Removing unneeded code
        • 3cf676c5 - Removing unneeded imports

        Compare with previous version

      • Ben Hayward @benhayward.ben added 1 commit 2 days ago

        added 1 commit

        • b2e2cf95 - Refactoring, moving things around

        Compare with previous version

      • Ben Hayward @benhayward.ben added 1 commit 2 days ago

        added 1 commit

        • e5676609 - Small update to bookmark progress

        Compare with previous version

      • Ben Hayward @benhayward.ben added 1 commit 1 day ago

        added 1 commit

        • 2402b1fe - Refactored and fixed up failing tests

        Compare with previous version

      • Ben Hayward @benhayward.ben added 2 commits 19 hours ago

        added 2 commits

        • e519c40f - Added spec tests for OnchainBadge
        • b1d3afe4 - Cleaning up a little bit

        Compare with previous version

      • Ben Hayward @benhayward.ben changed title from WIP: Add in event for checking for onchain badge to WIP: Add in delegate for checking for onchain badge 19 hours ago

        changed title from WIP: Add in event for checking for onchain badge to WIP: Add in delegate for checking for onchain badge

      • Ben Hayward @benhayward.ben added 1 commit 19 hours ago

        added 1 commit

        • 76b5f006 - Update ReviewSpec.php

        Compare with previous version

      • Ben Hayward @benhayward.ben added 2 commits 19 hours ago

        added 2 commits

        • f2f22d87 - line spacing
        • e17b138c - Added test for onchain booster status

        Compare with previous version

      • Mark Harding
        Mark Harding @markeharding started a discussion on an old version of the diff 8 hours ago
        Resolved by Ben Hayward 3 hours ago
      • Mark Harding
        Mark Harding @markeharding started a discussion on an old version of the diff 8 hours ago
        Resolved by Ben Hayward 3 hours ago
      • Mark Harding
        Mark Harding @markeharding started a discussion on the diff 8 hours ago
        Last updated by Mark Harding 30 minutes ago
        Entities/User.php
        1044 1047 return "urn:user:{$this->getGuid()}";
        1045 1048 }
        1046 1049
        1050 public function isOnchainBooster()
        1051 {
        1052 return (int) $this->onchain_booster;
        • Mark Harding
          Mark Harding @markeharding · 8 hours ago
          Owner

          is would imply a boolean

        • Ben Hayward
          Ben Hayward @benhayward.ben · 3 hours ago
          Developer

          True that

        • Mark Harding
          Mark Harding @markeharding · 30 minutes ago
          Owner

          keep the boolean

        Please register or sign in to reply
      • Mark Harding
        Mark Harding @markeharding started a discussion on an old version of the diff 8 hours ago
        Last updated by Mark Harding 31 minutes ago
        Spec/Core/Boost/Delegates/OnchainBadgeSpec.php
        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())
        • Mark Harding
          Mark Harding @markeharding · 8 hours ago
          Owner

          should we not check the time is set correctly?

        • Ben Hayward @benhayward.ben changed this line in version 12 of the diff 1 hour ago

          changed this line in version 12 of the diff

        • Ben Hayward
          Ben Hayward @benhayward.ben · 34 minutes ago
          Developer

          I test this in the User entities spec tests here:

          !191 (diffs)

        • Mark Harding
          Mark Harding @markeharding · 31 minutes ago
          Owner

          Needs to be tested at the unit level too.

        Please register or sign in to reply
      • Mark Harding
        Mark Harding @markeharding started a discussion on an old version of the diff 8 hours ago
        Resolved by Ben Hayward 1 hour ago
      • Ben Hayward @benhayward.ben added 1 commit 1 hour ago

        added 1 commit

        • 8edc1d04 - Refactored and updated texts

        Compare with previous version

      • Ben Hayward @benhayward.ben added 1 commit 1 hour ago

        added 1 commit

        • 9ba4bd66 - Adding and tidying tests

        Compare with previous version

      • Ben Hayward @benhayward.ben added 1 commit 54 minutes ago

        added 1 commit

        • 2e1fc475 - renaming onchain booster get export

        Compare with previous version

      • Mark Harding
        Mark Harding @markeharding started a discussion on an old version of the diff 31 minutes ago
        Resolved by Ben Hayward 29 minutes ago
      • Mark Harding
        Mark Harding @markeharding started a discussion on an old version of the diff 31 minutes ago
        Resolved by Ben Hayward 29 minutes ago
      • Ben Hayward @benhayward.ben changed title from WIP: Add in delegate for checking for onchain badge to WIP: {+Sprint/GiddyGiraffe: +}Add in delegate for checking for onchain badge 30 minutes ago

        changed title from WIP: Add in delegate for checking for onchain badge to WIP: {+Sprint/GiddyGiraffe: +}Add in delegate for checking for onchain badge

      • Ben Hayward @benhayward.ben changed the description 30 minutes ago

        changed the description

      • Mark Harding
        Mark Harding @markeharding started a discussion on an old version of the diff 30 minutes ago
        Resolved by Ben Hayward 23 minutes ago
      • Ben Hayward @benhayward.ben added 1 commit 23 minutes ago

        added 1 commit

        • 815a1529 - Updated for feedback

        Compare with previous version

      • Mark Harding
        Mark Harding @markeharding started a discussion on the diff 12 minutes ago
        Spec/Core/Boost/Delegates/OnchainBadgeDelegateSpec.php
        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())
        • Mark Harding
          Mark Harding @markeharding · 12 minutes ago
          Owner

          Should check the correct time (7 days) is being set

        Please register or sign in to reply
      • You're only seeing other activity in the feed. To add a comment, switch to one of the following options.
      Please register or sign in to reply
      Assignee
      None
      Assign to
      None
      Milestone
      None
      Assign milestone
      None
      Time tracking
      No estimate or time spent
      0
      Labels
      None
      Assign labels
      • View project labels
      Lock merge request
      Unlocked
      7
      7 participants
      user avatar
      Marcelo Rivera
      user avatar
      Emiliano Balbuena
      user avatar
      Brian Hatchet
      user avatar
      Rami Albatal
      user avatar
      Martin Santangelo
      user avatar
      Mark Harding
      user avatar
      Ben Hayward
      Reference: minds/engine!191