Skip to content

Commit

Permalink
Fix tests return the entire cloudevent
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinJoiner committed Dec 3, 2024
1 parent 7798b05 commit ffb42c2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 6 additions & 2 deletions internal/repositories/vc/vc.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,15 @@ func (r *Repository) GetLatestVINVC(ctx context.Context, vehicleTokenID uint32)
vehicleContractAddress = &credSubject.VehicleContractAddress
}
tokenIDInt := int(credSubject.VehicleTokenID)

rawVC, err := json.Marshal(dataObj)
if err != nil {
r.logger.Error().Err(err).Msg("failed to marshal Raw VIN VC")
return nil, errors.New("internal error")
}
return &model.Vinvc{
ValidFrom: createdAt,
ValidTo: expiresAt,
RawVc: string(dataObj.Data),
RawVc: string(rawVC),
Vin: vin,
RecordedBy: recordedBy,
RecordedAt: recordedAt,
Expand Down
1 change: 0 additions & 1 deletion internal/repositories/vc/vc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ func (m *MockRow) ScanStruct(any) error {
}

func TestGetLatestVC(t *testing.T) {

// Initialize variables
logger := zerolog.New(nil)
ctx := context.Background()
Expand Down

0 comments on commit ffb42c2

Please sign in to comment.