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 151
    • Issues 151
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 40
    • Merge Requests 40
  • 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

Merged
Opened 1 week ago by Ben Hayward@benhayward.ben
  • Report abuse
Report abuse

[Sprint/GiddyGiraffe](feat): Add in delegate for checking for onchain badge

Closes #493 (closed)

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 11 hours ago by Ben Hayward
Request to merge benhayward.ben:onchain-badge-backend-additions into master
  • Email patches
  • Plain diff
Pipeline #65671575 (#133) passed for f935f5d6 on benhayward.ben:onchain-badge-backend-additions
      Merge request approved. Approved by
      Mark Harding
      Mark Harding
      Marcelo Rivera
      Marcelo Rivera
      Brian Hatchet
      Brian Hatchet
      Martin Santangelo
      Martin Santangelo
      Emiliano Balbuena
      Emiliano Balbuena
      Rami Albatal
      Rami Albatal

      Merged by Mark Harding 9 minutes ago

      The changes were merged into master with e8162f59

      The source branch has been deleted

      Allows commits from members who can merge to the target branch

      Closed #493 (closed)

      Pipeline #66497626 (#759) passed for e8162f59 on master
            • Discussion 22
            • Commits 22
            • Pipelines 18
            • Changes 6
            8/9 discussions resolved
            • Loading...
            • Ben Hayward @benhayward.ben added 1 commit 1 week 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 1 week ago

              added 1 commit

              • 7ff4b980 - Quickfix

              Compare with previous version

            • Ben Hayward @benhayward.ben added 2 commits 1 week ago

              added 2 commits

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

              Compare with previous version

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

              added 1 commit

              • b2e2cf95 - Refactoring, moving things around

              Compare with previous version

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

              added 1 commit

              • e5676609 - Small update to bookmark progress

              Compare with previous version

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

              added 1 commit

              • 2402b1fe - Refactored and fixed up failing tests

              Compare with previous version

            • Ben Hayward @benhayward.ben added 2 commits 1 week 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 1 week 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 1 week ago

              added 1 commit

              • 76b5f006 - Update ReviewSpec.php

              Compare with previous version

            • Ben Hayward @benhayward.ben added 2 commits 1 week 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 1 week ago
              Resolved by Ben Hayward 6 days ago
            • Mark Harding
              Mark Harding @markeharding started a discussion on an old version of the diff 1 week ago
              Resolved by Ben Hayward 6 days ago
            • Mark Harding
              Mark Harding @markeharding started a discussion on the diff 1 week ago
              Resolved by Ben Hayward 6 days ago
            • Mark Harding
              Mark Harding @markeharding started a discussion on an old version of the diff 1 week ago
              Last updated by Ben Hayward 11 hours 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 · 1 week ago
                Owner

                should we not check the time is set correctly?

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

                changed this line in version 12 of the diff

              • Ben Hayward
                Ben Hayward @benhayward.ben · 6 days ago
                Developer

                I test this in the User entities spec tests here:

                !191 (diffs)

              • Mark Harding
                Mark Harding @markeharding · 6 days ago
                Owner

                Needs to be tested at the unit level too.

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

                Not certain how to go about that - will chat tomorrow if you need it; from what I can see the coverage is 100% and I'm not quite sure how to access the user object in such a way given PHPSpecs lack of assert.

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

              added 1 commit

              • 8edc1d04 - Refactored and updated texts

              Compare with previous version

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

              added 1 commit

              • 9ba4bd66 - Adding and tidying tests

              Compare with previous version

            • Ben Hayward @benhayward.ben added 1 commit 6 days 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 6 days ago
              Resolved by Ben Hayward 6 days ago
            • Mark Harding
              Mark Harding @markeharding started a discussion on an old version of the diff 6 days ago
              Resolved by Ben Hayward 6 days 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 6 days 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 6 days ago

              changed the description

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

              added 1 commit

              • 815a1529 - Updated for feedback

              Compare with previous version

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

              added 1 commit

              • 56f0a237 - Added back in isOnchainBooster

              Compare with previous version

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

              added 1 commit

              • 04e00f9e - Update OnchainBadgeDelegate.php

              Compare with previous version

            • Mark Harding
              Mark Harding @markeharding started a discussion on commit 56f0a237 6 days ago
              Last updated by Ben Hayward 6 days ago
              Entities/User.php
              1047 1047 return "urn:user:{$this->getGuid()}";
              1048 1048 }
              1049 1049
              1050 /**
              1051 * Returns whether the user has onchain_booster status.
              1052 * @return boolean true if the date set in onchain_booster is larger than the current time.
              1053 */
              1054 public function isOnchainBooster()
              1055 {
              1056 return (boolean) (time() < $this->onchain_booster);
              • Mark Harding
                Mark Harding @markeharding · 6 days ago
                Owner

                boolean is an alias. bool should ideally be used. aliases blow up when used a typehints so we should avoid.

              • Ben Hayward
                Ben Hayward @benhayward.ben · 6 days ago
                Developer

                Thanks, was unaware of that, have amended.

              Please register or sign in to reply
            • Ben Hayward @benhayward.ben added 2 commits 6 days ago

              added 2 commits

              • 06c1132b - got rid of boolean alias for bool
              • 87b37c5f - Merge branch 'onchain-badge-backend-additions' of...

              Compare with previous version

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

              added 1 commit

              • f935f5d6 - added time argument for 7 days in future

              Compare with previous version

            • Marcelo Rivera @eiennohi approved this merge request 5 days ago

              approved this merge request

            • Ben Hayward @benhayward.ben unmarked as a Work In Progress 11 hours ago

              unmarked as a Work In Progress

            • Mark Harding @markeharding approved this merge request 10 minutes ago

              approved this merge request

            • Mark Harding @markeharding merged 9 minutes ago

              merged

            • Mark Harding @markeharding mentioned in commit e8162f59 9 minutes ago

              mentioned in commit e8162f59

            • 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
            Brian Hatchet
            user avatar
            Martin Santangelo
            user avatar
            Emiliano Balbuena
            user avatar
            Rami Albatal
            user avatar
            Mark Harding
            user avatar
            Ben Hayward
            user avatar
            Marcelo Rivera
            Reference: minds/engine!191

            Revert this merge request

            This will create a new commit in order to revert the existing changes.

            Switch branch
            Cancel
            A new branch will be created in your fork and a new merge request will be started.

            Cherry-pick this merge request

            Switch branch
            Cancel
            A new branch will be created in your fork and a new merge request will be started.