decentralized-identity / ethr-did-resolver

DID resolver for Ethereum Addresses with support for key management
Apache License 2.0
203 stars 71 forks source link

fix: hex values getting wrongly encoded to utf8 for setAttributeSigned #168

Closed lleifermann closed 1 year ago

lleifermann commented 1 year ago

While testing the implementation of signed methods from this resolver i noticed that function createSetAttributeHash always encodes the attributeValue to uft8.

If the controller now tries to add another key to a did, this key in hex format is also encoded to utf8. This effectively breaks the ability to add hex values via the setAttributeSigned method as the contract now calculates a different hash. Leading to a tx failure.

lleifermann commented 1 year ago

ping @mirceanis - I also noticed when this package is build it later references theEthereumDIDRegistry.json in its index.d.ts file to ./config which does not exist in the build folder. I think we should probably copy the file over during the github build action somehow. But not sure how to archive this properly with micro bundle. We noticed this when upgrading this package in veramo.

mirceanis commented 1 year ago

ping @mirceanis - I also noticed when this package is build it later references theEthereumDIDRegistry.json in its index.d.ts file to ./config which does not exist in the build folder. I think we should probably copy the file over during the github build action somehow. But not sure how to archive this properly with micro bundle. We noticed this when upgrading this package in veramo.

Right. There seems to be a problem in microbundle that is not including that JSON file in the build output. I think we should try to switch to plain tsc for building and outputting an ESM module, but let's track this in a separate issue/PR

uport-automation-bot commented 1 year ago

:tada: This PR is included in version 6.2.3 :tada:

The release is available on:

Your semantic-release bot :package::rocket: