diff --git a/src/txFactory/credentialRegistryTransactionFactory.ts b/src/txFactory/credentialRegistryTransactionFactory.ts index ef88f58..93df498 100644 --- a/src/txFactory/credentialRegistryTransactionFactory.ts +++ b/src/txFactory/credentialRegistryTransactionFactory.ts @@ -7,6 +7,7 @@ import { AIdUtils } from '../utils/AIdUtils' * Dev: get delegated invoke addSubjectCredential transaction object * @param web3 ethereum connection * @param subjectCredentialHash should have 32 bytes, credential identification + * @param URI url for store the credentials for backup */ export function addSubjectCredential(web3, subjectCredentialHash, URI) { const transaction = Object.assign({}, config.basicTransaction) @@ -103,9 +104,9 @@ export function getSubjectCredentialStatus( /** * THIS METHOD WILL BE DEPREATED, USE INSTEAD updateIssuerCredential * function updateCredentialStatus(web3, issuerCredentialHash, status) - * @param web3 - * @param issuerCredentialHash - * @param status + * @param web3 ethereum connection + * @param issuerCredentialHash should have 32 bytes + * @param status uint that indicates the status of the credential */ export function updateCredentialStatus(web3, issuerCredentialHash, status) { const transaction = Object.assign({}, config.basicTransaction) @@ -121,9 +122,9 @@ export function updateCredentialStatus(web3, issuerCredentialHash, status) { /** * function updateIssuerCredentialStatus(web3, issuerCredentialHash, status) - * @param web3 - * @param issuerCredentialHash - * @param status + * @param web3 ethereum connection + * @param issuerCredentialHash should have 32 bytes + * @param status uint that indicates the status of the credential */ export function updateIssuerCredential(web3, issuerCredentialHash, status) { const transaction = Object.assign({}, config.basicTransaction) @@ -141,8 +142,8 @@ export function updateIssuerCredential(web3, issuerCredentialHash, status) { * Dev: get the invoke updateCredentialStatus transaction object * function getIssuerCredentialStatus(address issuer, bytes32 issuerCredentialHash) view public validAddress(issuer) returns (bool exists, Status status) * @param web3 ethereum connection - * @param didIssuer - * @param issuerCredentialHash + * @param didIssuer alastria Id + * @param issuerCredentialHash should have 32 bytes */ export function getIssuerCredentialStatus( web3, @@ -164,8 +165,8 @@ export function getIssuerCredentialStatus( * THIS METHOD WILL BE DEPREATED * Dev: Defining three status functions avoid linking the subject to the issuer or the corresponding hashes * @param web3 ethereum connection - * @param subjectStatus - * @param issuerStatus + * @param subjectStatus uint that indicates the status of the credential for subject + * @param issuerStatus uint that indicates the status of the credential for issuer */ export function getCredentialStatus(web3, subjectStatus, issuerStatus) { const transaction = Object.assign({}, config.basicTransaction) diff --git a/src/txFactory/presentationRegistryTransactionFactory.ts b/src/txFactory/presentationRegistryTransactionFactory.ts index 3f9b5e3..8f48bb0 100644 --- a/src/txFactory/presentationRegistryTransactionFactory.ts +++ b/src/txFactory/presentationRegistryTransactionFactory.ts @@ -5,9 +5,9 @@ import { AIdUtils } from '../utils/AIdUtils' * THIS METHOD WILL BE DEPREATED, USE INSTEAD updateSubjectPresentation * Subject functions * function addSubjectPresentation(web3, subjectPresentationHash, URI) - * @param web3 - * @param subjectPresentationHash - * @param URI + * @param web3 ethereum connection + * @param subjectPresentationHash should have 32 bytes + * @param URI url for store the presentations for backup */ export function addSubjectPresentation(web3, subjectPresentationHash, URI) { const transaction = Object.assign({}, config.basicTransaction) @@ -24,8 +24,8 @@ export function addSubjectPresentation(web3, subjectPresentationHash, URI) { /** * Subject functions * function updateSubjectPresentation(bytes32 subjectPresentationHash, Status status) public validStatus(status) - * @param web3 - * @param subjectPresentationHash + * @param web3 ethereum connection + * @param subjectPresentationHash should have 32 bytes */ export function updateSubjectPresentation( web3, @@ -47,9 +47,9 @@ export function updateSubjectPresentation( * If the Presentation does not exists the return is a void Presentation * If we want a log, should we add an event? * function getSubjectPresentationStatus(address subject, bytes32 subjectPresentationHash) view public validAddress(subject) returns(bool exists, Status status) - * @param web3 - * @param didSubject - * @param subsubjectPresentationHashject + * @param web3 ethereum connection + * @param didSubject alastria Id + * @param subsubjectPresentationHashject should have 32 bytes */ export function getSubjectPresentationStatus( web3, @@ -71,9 +71,9 @@ export function getSubjectPresentationStatus( /** * Receiver functions * function updateReceiverPresentation(bytes32 receiverPresentationHash, Status status) public validStatus(status) - * @param web3 - * @param receiverPresentationHash - * @param status + * @param web3 ethereum connection + * @param receiverPresentationHash should have 32 bytes + * @param status uint that indicates the status of the presentation */ export function updateReceiverPresentation( web3, @@ -95,9 +95,9 @@ export function updateReceiverPresentation( * If the Presentation does not exists the return is a void Presentation * If we want a log, should we add an event? * function getReceiverPresentationStatus(address receiver, bytes32 receiverPresentationHash) view public validAddress(receiver) returns(bool exists, Status status) { - * @param web3 - * @param didReceiver - * @param receiverPresentationHash + * @param web3 ethereum connection + * @param didReceiver alastria Id + * @param receiverPresentationHash should have 32 bytes */ export function getReceiverPresentationStatus( web3, @@ -121,9 +121,9 @@ export function getReceiverPresentationStatus( * Utility function * Defining three status functions avoids linking the Subject to the Receiver or the corresponding hashes * function getPresentationStatus(Status subjectStatus, Status receiverStatus) pure public validStatus(subjectStatus) validStatus(receiverStatus) returns(Status){ - * @param web3 - * @param subjectStatus - * @param receiverStatus + * @param web3 ethereum connection + * @param subjectStatus uint that indicates the status of the presentation for subject + * @param receiverStatus uint that indicates the status of the presentation for receiver */ export function getPresentationStatus(web3, subjectStatus, receiverStatus) { const transaction = Object.assign({}, config.basicTransaction) diff --git a/src/txFactory/publicKeyRegistryTransactionFactory.ts b/src/txFactory/publicKeyRegistryTransactionFactory.ts index 3f4f552..4c93f0f 100644 --- a/src/txFactory/publicKeyRegistryTransactionFactory.ts +++ b/src/txFactory/publicKeyRegistryTransactionFactory.ts @@ -3,10 +3,10 @@ import { AIdUtils } from '../utils/AIdUtils' import { AddressUtils } from '../utils/AddressUtils' /** - * THIS METHOD WILL BE DEPREATED - * function addKey(string memory publicKey, address subject) public - * @param web3 - * @param publicKey + * THIS METHOD WILL BE DEPREATED, USE INSTEAD addPublicKey + * function addKey(string memory publicKey) public + * @param web3 ethereum connection + * @param publicKey the public key. */ export function addKey(web3, publicKey) { const transaction = Object.assign({}, config.basicTransaction) @@ -21,8 +21,9 @@ export function addKey(web3, publicKey) { } /** - * @param web3 - * @param publicKeyHash + * function addPublicKey(bytes32 publicKeyHash) public + * @param web3 ethereum connection + * @param publicKeyHash the hash of the publickey. should have 32 bytes */ export function addPublicKey(web3, publicKeyHash) { const transaction = Object.assign({}, config.basicTransaction) @@ -37,9 +38,10 @@ export function addPublicKey(web3, publicKeyHash) { } /** - * THIS METHOD WILL BE DEPREATED - * @param web3 - * @param publicKey + * THIS METHOD WILL BE DEPREATED, USE INSTEAD revokePublicKeyHash + * function revokePublicKey(string memory publicKey) public + * @param web3 ethereum connection + * @param publicKey the public key. */ export function revokePublicKey(web3, publicKey) { const transaction = Object.assign({}, config.basicTransaction) @@ -54,8 +56,9 @@ export function revokePublicKey(web3, publicKey) { } /** - * @param web3 - * @param publicKeyHash + * function revokePublicKey(bytes32 publicKeyHash) public + * @param web3 ethereum connection + * @param publicKeyHash the hash of the publickey. should have 32 bytes */ export function revokePublicKeyHash(web3, publicKeyHash) { const transaction = Object.assign({}, config.basicTransaction) @@ -70,9 +73,10 @@ export function revokePublicKeyHash(web3, publicKeyHash) { } /** - * THIS METHOD WILL BE DEPREATED - * @param web3 - * @param publicKey + * THIS METHOD WILL BE DEPREATED, USE INSTEAD deletePublicKeyHash + * function deletePublicKey(string memory publicKey) public + * @param web3 ethereum connection + * @param publicKey the public key. */ export function deletePublicKey(web3, publicKey) { const transaction = Object.assign({}, config.basicTransaction) @@ -87,8 +91,9 @@ export function deletePublicKey(web3, publicKey) { } /** - * @param web3 - * @param publicKeyHash + * function deletePublicKey(bytes32 publicKeyHash) public + * @param web3 ethereum connection + * @param publicKeyHash the hash of the publickey. should have 32 bytes */ export function deletePublicKeyHash(web3, publicKeyHash) { const transaction = Object.assign({}, config.basicTransaction) @@ -103,9 +108,10 @@ export function deletePublicKeyHash(web3, publicKeyHash) { } /** - * THIS METHOD WILL BE DEPREATED - * @param web3 - * @param did + * THIS METHOD WILL BE DEPREATED, USE INSTEAD getPublicKeyStatusHash + * function getCurrentPublicKey(address subject) view public + * @param web3 ethereum connection + * @param did alastri Id */ export function getCurrentPublicKey(web3, did) { const subjectAddr = AIdUtils.getProxyAddress(did) @@ -120,10 +126,11 @@ export function getCurrentPublicKey(web3, did) { } /** - * THIS METHOD WILL BE DEPREATED - * @param web3 - * @param did - * @param publicKey + * TODO: ELIMINAR??? + * THIS METHOD WILL BE DEPREATED, USE INSTEAD getPublicKeyStatusHash + * function getPublicKeyStatus(address subject, bytes32 publicKeyHash) view public + * @param did ethereum connection + * @param publicKey the public key. */ export function getPublicKeyStatus(web3, did, publicKey) { const subjectAddr = AIdUtils.getProxyAddress(did) @@ -138,9 +145,10 @@ export function getPublicKeyStatus(web3, did, publicKey) { } /** - * @param web3 - * @param did - * @param publicKeyHash + * function getPublicKeyStatus(address subject, bytes32 publicKeyHash) view public + * @param web3 ethereum connection + * @param did alastri Id + * @param publicKeyHash the hash of the publickey. should have 32 bytes */ export function getPublicKeyStatusHash(web3, did, publicKeyHash) { const subjectAddr = AIdUtils.getProxyAddress(did)