Skip to content

Commit

Permalink
Merge pull request #378 from 0xPolygonID/fix/display_type_mapper
Browse files Browse the repository at this point in the history
Fixed claim display type mapper.
  • Loading branch information
plusema86 authored Feb 1, 2024
2 parents 5e6e70a + 9e41fda commit 01e62f6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
7 changes: 3 additions & 4 deletions lib/credential/data/mappers/claim_mapper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ class ClaimMapper extends Mapper<ClaimDTO, ClaimEntity> {
schema: from.schema,
type: from.type,
info: _claimInfoMapper.mapFrom(from.info),
displayType: from.displayType == null
? _displayTypeMapper.mapFrom(displayType)
: null,
displayType:
displayType != null ? _displayTypeMapper.mapFrom(displayType) : null,
credentialRawValue: from.credentialRawValue,
);
}
Expand All @@ -49,7 +48,7 @@ class ClaimMapper extends Mapper<ClaimDTO, ClaimEntity> {
schema: to.schema,
info: _claimInfoMapper.mapTo(to.info),
displayType:
to.displayType == null ? null : _displayTypeMapper.mapTo(displayType),
displayType != null ? _displayTypeMapper.mapTo(displayType) : null,
credentialRawValue: to.credentialRawValue,
);
}
Expand Down
7 changes: 0 additions & 7 deletions lib/credential/data/mappers/display_type_mapper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,3 @@ class DisplayTypeMapper extends Mapper<Map<String, dynamic>?, DisplayType?> {
return json;
}
}

class DisplayTypeMapperParam {
final String type;
final Map<String, dynamic> json;

DisplayTypeMapperParam(this.type, this.json);
}
3 changes: 1 addition & 2 deletions test/credential/data/mappers/claim_mapper_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ void main() {
expect(verify(infoMapper.mapFrom(captureAny)).captured.first,
fetchClaimDTO.credential);
expect(verify(stateMapper.mapFrom(captureAny)).captured.first, '');
expect(
verify(displayTypeMapper.mapFrom(captureAny)).captured.first, null);
verifyNever(displayTypeMapper.mapFrom(captureAny));
});
});

Expand Down

0 comments on commit 01e62f6

Please sign in to comment.