Skip to content

Commit

Permalink
refactor: change valueContent to VerifiableURI
Browse files Browse the repository at this point in the history
  • Loading branch information
CJ42 committed Dec 13, 2023
1 parent 604ec9b commit 26c9988
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/src/decodeData.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const decodedDataManyKeys = myERC725.decodeData([
]
*/
console.log('/*--------------------------------------------/*');
console.log('/* decodeData - one key (VerifiableURL) /*');
console.log('/* decodeData - one key (VerifiableURI) /*');
console.log('/*--------------------------------------------/*');
console.log(decodedDataOneKey);
console.log('/*--------------------------------------------/*');
Expand Down
4 changes: 2 additions & 2 deletions src/lib/decodeData.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('decodeData', () => {
key: '0x',
keyType: 'MappingWithGrouping',
valueType: 'bytes',
valueContent: 'VerifiableURL',
valueContent: 'VerifiableURI',
},
{
name: 'MyDynamicKey:<address>',
Expand All @@ -61,7 +61,7 @@ describe('decodeData', () => {
key: '0x',
keyType: 'Mapping',
valueType: 'bytes',
valueContent: 'VerifiableURL',
valueContent: 'VerifiableURI',
},
];

Expand Down
2 changes: 1 addition & 1 deletion src/lib/encoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ export const valueContentEncodingMap = (
}
// https://github.com/lukso-network/LIPs/blob/master/LSPs/LSP-2-ERC725YJSONSchema.md#jsonurl
case 'JSONURL':
case 'VerifiableURL': {
case 'VerifiableURI': {
return {
type: 'custom',
encode: (dataToEncode: URLDataToEncode) => {
Expand Down
4 changes: 2 additions & 2 deletions src/lib/getDataFromExternalSources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ export const getDataFromExternalSources = (
}

if (
!['jsonurl', 'asseturl', 'verifiableurl'].includes(
!['jsonurl', 'asseturl', 'verifiableuri'].includes(
schemaElement.valueContent.toLowerCase(),
)
) {
return dataEntry;
}

// At this stage, value should be of type jsonurl, verifiableurl or asseturl
// At this stage, value should be of type jsonurl, verifiableuri or asseturl
if (typeof dataEntry.value === 'string') {
console.error(
`Value of key: ${dataEntry.name} (${dataEntry.value}) is string but valueContent is: ${schemaElement.valueContent}. Expected type should be object with url key.`,
Expand Down

0 comments on commit 26c9988

Please sign in to comment.