-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
The contract AlastriaIdentityManager defines two functions with the same name but different signatures:
function createAlastriaIdentity(bytes memory data) public
function createAlastriaIdentity(bytes32 hash) public
Why this is problematic:
Client libraries like ethers.js or web3.js fail to infer the correct ABI signature unless manually specified:
const hash = ethers.utils.keccak256(ethers.utils.toUtf8Bytes(subject));
const tx = await this.contract["createAlastriaIdentity(bytes32)"](hash);
This leads to a poor developer experience and if it is not done unexpected runtime errors like this:
"TypeError: ambiguous function description (i.e. matches "createAlastriaIdentity(bytes32)", "createAlastriaIdentity(bytes)")"
Overloaded function names reduce readability in public APIs.
Suggestion:
Rename the functions to distinct, semantically clear names, for example:
function createAlastriaIdentityWithHash(bytes32 hash) public
function createAlastriaIdentityWithData(bytes memory data) public
This will prevent ambiguity and improve usability for developers integrating with the Alastria ID stack.
Thanks for your work.
Metadata
Metadata
Assignees
Labels
No labels