Skip to content

Commit

Permalink
Merge branch 'master' into ryan/1216-buyer-not-seller
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanchristo authored Jun 29, 2022
2 parents 4120d28 + 32b48dd commit 52b7a63
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions x/ecocredit/server/core/query_project_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ func (k Keeper) Project(ctx context.Context, request *core.QueryProjectRequest)
ClassId: class.Id,
Jurisdiction: project.Jurisdiction,
Metadata: project.Metadata,
ReferenceId: project.ReferenceId,
}

return &core.QueryProjectResponse{Project: &info}, nil
Expand Down
2 changes: 2 additions & 0 deletions x/ecocredit/server/core/query_project_info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ func TestQuery_Project(t *testing.T) {
ClassKey: classKey,
Jurisdiction: "US-CA",
Metadata: "data",
ReferenceId: "R01",
}

// insert project
Expand All @@ -39,6 +40,7 @@ func TestQuery_Project(t *testing.T) {
assert.Equal(t, "C01", res.Project.ClassId)
assert.Equal(t, project.Jurisdiction, res.Project.Jurisdiction)
assert.Equal(t, project.Metadata, res.Project.Metadata)
assert.Equal(t, project.ReferenceId, res.Project.ReferenceId)

// query project by unknown project id
_, err = s.k.Project(s.ctx, &core.QueryProjectRequest{ProjectId: "F01"})
Expand Down
1 change: 1 addition & 0 deletions x/ecocredit/server/core/query_projects.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func (k Keeper) Projects(ctx context.Context, request *core.QueryProjectsRequest
ClassId: class.Id,
Jurisdiction: project.Jurisdiction,
Metadata: project.Metadata,
ReferenceId: project.ReferenceId,
}

projects = append(projects, &info)
Expand Down
1 change: 1 addition & 0 deletions x/ecocredit/server/core/query_projects_by_class.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func (k Keeper) ProjectsByClass(ctx context.Context, request *core.QueryProjects
ClassId: class.Id,
Jurisdiction: project.Jurisdiction,
Metadata: project.Metadata,
ReferenceId: project.ReferenceId,
}

projects = append(projects, &info)
Expand Down

0 comments on commit 52b7a63

Please sign in to comment.