Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • O offerCC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1
    • Issues 1
    • List
    • Boards
    • Service Desk
    • Milestones
  • Jira
    • Jira
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • smartcontracts
  • offerCC
  • Merge requests
  • !14

Merged
Created Dec 03, 2017 by Ghost User@ghost

Fix bugs of arguments validation + removing code duplication

  • Overview 0
  • Commits 1
  • Changes 2

There was a bug as a result of the copy past from previous functions while adding two new methods:

  1. GetHistoryUserIncomingRequests
  2. GetHistoryUserOutgoingRequests

Since those functions doesn't require anymore an additional status parameter, the check during invocation, which required two parameters become obsolete, e.g.:

if len(args) != 2 {
errMsg := fmt.Sprintf("parameters[GetUserOutgoingRequestsByStatus:]
                Invalid number of arguments, expected 2 while got %d", len(args))
            logger.Error(errMsg)
            return shim.Error(errMsg)
}

Moreover code to build resulting list of users offers was duplicated. This commit takes care to fix the bug of arguments validation and also cleans up duplications by extracting the logic into single place.

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: fixArgsBug