The delegate keys of an ethr-did were not showing up in the resolved DID document.
This was caused by a broken conversion of a ByteArray into a String, resulting in a string with a bunch of null characters at the end.
When the event log was parsed to accumulate the publicKey entries, the respective strings would fail basic string comparison with the expected values, resulting in all delegate keys getting skipped.
Testing
I added a test to validate the bug in a controlled environment.
Running ./gradlew test will also run that test. This is already done by CI.
Also, the same data can be validated in the wild, on the rinkeby network:
prerequisites:
val resolver = EthrDIDResolver(
rpc = JsonRPC(Networks.rinkeby.rpcUrl),
registryAddress = Networks.rinkeby.ethrDidRegistry
)
val ddo = resolver.resolve("0xcf03dd0a894ef79cb5b601a43c4b25e3ae4c67ed")
println(ddo.toJson())
This PR also includes some additions to the EthrDID contract interface that allow the user to override some default transaction parameters (like nonce, value, gas, gasPrice) before signing.
This interface is not documented and probably not used externally yet.
This change does not impact functionality since the previous defaults still get used if the options are null.
This should be merged only after #7
What's here
The delegate keys of an
ethr-did
were not showing up in the resolved DID document.This was caused by a broken conversion of a
ByteArray
into aString
, resulting in a string with a bunch ofnull
characters at the end. When the event log was parsed to accumulate the publicKey entries, the respective strings would fail basic string comparison with the expected values, resulting in all delegate keys getting skipped.Testing
I added a test to validate the bug in a controlled environment. Running
./gradlew test
will also run that test. This is already done by CI.Also, the same data can be validated in the wild, on the rinkeby network:
prerequisites:
Expected output:
it should resolve to the following document:
Previous output (broken)
Note
This PR also includes some additions to the EthrDID contract interface that allow the user to override some default transaction parameters (like nonce, value, gas, gasPrice) before signing. This interface is not documented and probably not used externally yet. This change does not impact functionality since the previous defaults still get used if the options are
null
.