Skip to content

Commit e43c9b4

Browse files
committed
Complete documentation of the functions
1 parent a8e6928 commit e43c9b4

3 files changed

+62
-53
lines changed

src/txFactory/credentialRegistryTransactionFactory.ts

+11-10
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { AIdUtils } from '../utils/AIdUtils'
77
* Dev: get delegated invoke addSubjectCredential transaction object
88
* @param web3 ethereum connection
99
* @param subjectCredentialHash should have 32 bytes, credential identification
10+
* @param URI url for store the credentials for backup
1011
*/
1112
export function addSubjectCredential(web3, subjectCredentialHash, URI) {
1213
const transaction = Object.assign({}, config.basicTransaction)
@@ -103,9 +104,9 @@ export function getSubjectCredentialStatus(
103104
/**
104105
* THIS METHOD WILL BE DEPREATED, USE INSTEAD updateIssuerCredential
105106
* function updateCredentialStatus(web3, issuerCredentialHash, status)
106-
* @param web3
107-
* @param issuerCredentialHash
108-
* @param status
107+
* @param web3 ethereum connection
108+
* @param issuerCredentialHash should have 32 bytes
109+
* @param status uint that indicates the status of the credential
109110
*/
110111
export function updateCredentialStatus(web3, issuerCredentialHash, status) {
111112
const transaction = Object.assign({}, config.basicTransaction)
@@ -121,9 +122,9 @@ export function updateCredentialStatus(web3, issuerCredentialHash, status) {
121122

122123
/**
123124
* function updateIssuerCredentialStatus(web3, issuerCredentialHash, status)
124-
* @param web3
125-
* @param issuerCredentialHash
126-
* @param status
125+
* @param web3 ethereum connection
126+
* @param issuerCredentialHash should have 32 bytes
127+
* @param status uint that indicates the status of the credential
127128
*/
128129
export function updateIssuerCredential(web3, issuerCredentialHash, status) {
129130
const transaction = Object.assign({}, config.basicTransaction)
@@ -141,8 +142,8 @@ export function updateIssuerCredential(web3, issuerCredentialHash, status) {
141142
* Dev: get the invoke updateCredentialStatus transaction object
142143
* function getIssuerCredentialStatus(address issuer, bytes32 issuerCredentialHash) view public validAddress(issuer) returns (bool exists, Status status)
143144
* @param web3 ethereum connection
144-
* @param didIssuer
145-
* @param issuerCredentialHash
145+
* @param didIssuer alastria Id
146+
* @param issuerCredentialHash should have 32 bytes
146147
*/
147148
export function getIssuerCredentialStatus(
148149
web3,
@@ -164,8 +165,8 @@ export function getIssuerCredentialStatus(
164165
* THIS METHOD WILL BE DEPREATED
165166
* Dev: Defining three status functions avoid linking the subject to the issuer or the corresponding hashes
166167
* @param web3 ethereum connection
167-
* @param subjectStatus
168-
* @param issuerStatus
168+
* @param subjectStatus uint that indicates the status of the credential for subject
169+
* @param issuerStatus uint that indicates the status of the credential for issuer
169170
*/
170171
export function getCredentialStatus(web3, subjectStatus, issuerStatus) {
171172
const transaction = Object.assign({}, config.basicTransaction)

src/txFactory/presentationRegistryTransactionFactory.ts

+17-17
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import { AIdUtils } from '../utils/AIdUtils'
55
* THIS METHOD WILL BE DEPREATED, USE INSTEAD updateSubjectPresentation
66
* Subject functions
77
* function addSubjectPresentation(web3, subjectPresentationHash, URI)
8-
* @param web3
9-
* @param subjectPresentationHash
10-
* @param URI
8+
* @param web3 ethereum connection
9+
* @param subjectPresentationHash should have 32 bytes
10+
* @param URI url for store the presentations for backup
1111
*/
1212
export function addSubjectPresentation(web3, subjectPresentationHash, URI) {
1313
const transaction = Object.assign({}, config.basicTransaction)
@@ -24,8 +24,8 @@ export function addSubjectPresentation(web3, subjectPresentationHash, URI) {
2424
/**
2525
* Subject functions
2626
* function updateSubjectPresentation(bytes32 subjectPresentationHash, Status status) public validStatus(status)
27-
* @param web3
28-
* @param subjectPresentationHash
27+
* @param web3 ethereum connection
28+
* @param subjectPresentationHash should have 32 bytes
2929
*/
3030
export function updateSubjectPresentation(
3131
web3,
@@ -47,9 +47,9 @@ export function updateSubjectPresentation(
4747
* If the Presentation does not exists the return is a void Presentation
4848
* If we want a log, should we add an event?
4949
* function getSubjectPresentationStatus(address subject, bytes32 subjectPresentationHash) view public validAddress(subject) returns(bool exists, Status status)
50-
* @param web3
51-
* @param didSubject
52-
* @param subsubjectPresentationHashject
50+
* @param web3 ethereum connection
51+
* @param didSubject alastria Id
52+
* @param subsubjectPresentationHashject should have 32 bytes
5353
*/
5454
export function getSubjectPresentationStatus(
5555
web3,
@@ -71,9 +71,9 @@ export function getSubjectPresentationStatus(
7171
/**
7272
* Receiver functions
7373
* function updateReceiverPresentation(bytes32 receiverPresentationHash, Status status) public validStatus(status)
74-
* @param web3
75-
* @param receiverPresentationHash
76-
* @param status
74+
* @param web3 ethereum connection
75+
* @param receiverPresentationHash should have 32 bytes
76+
* @param status uint that indicates the status of the presentation
7777
*/
7878
export function updateReceiverPresentation(
7979
web3,
@@ -95,9 +95,9 @@ export function updateReceiverPresentation(
9595
* If the Presentation does not exists the return is a void Presentation
9696
* If we want a log, should we add an event?
9797
* function getReceiverPresentationStatus(address receiver, bytes32 receiverPresentationHash) view public validAddress(receiver) returns(bool exists, Status status) {
98-
* @param web3
99-
* @param didReceiver
100-
* @param receiverPresentationHash
98+
* @param web3 ethereum connection
99+
* @param didReceiver alastria Id
100+
* @param receiverPresentationHash should have 32 bytes
101101
*/
102102
export function getReceiverPresentationStatus(
103103
web3,
@@ -121,9 +121,9 @@ export function getReceiverPresentationStatus(
121121
* Utility function
122122
* Defining three status functions avoids linking the Subject to the Receiver or the corresponding hashes
123123
* function getPresentationStatus(Status subjectStatus, Status receiverStatus) pure public validStatus(subjectStatus) validStatus(receiverStatus) returns(Status){
124-
* @param web3
125-
* @param subjectStatus
126-
* @param receiverStatus
124+
* @param web3 ethereum connection
125+
* @param subjectStatus uint that indicates the status of the presentation for subject
126+
* @param receiverStatus uint that indicates the status of the presentation for receiver
127127
*/
128128
export function getPresentationStatus(web3, subjectStatus, receiverStatus) {
129129
const transaction = Object.assign({}, config.basicTransaction)

src/txFactory/publicKeyRegistryTransactionFactory.ts

+34-26
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import { AIdUtils } from '../utils/AIdUtils'
33
import { AddressUtils } from '../utils/AddressUtils'
44

55
/**
6-
* THIS METHOD WILL BE DEPREATED
7-
* function addKey(string memory publicKey, address subject) public
8-
* @param web3
9-
* @param publicKey
6+
* THIS METHOD WILL BE DEPREATED, USE INSTEAD addPublicKey
7+
* function addKey(string memory publicKey) public
8+
* @param web3 ethereum connection
9+
* @param publicKey the public key.
1010
*/
1111
export function addKey(web3, publicKey) {
1212
const transaction = Object.assign({}, config.basicTransaction)
@@ -21,8 +21,9 @@ export function addKey(web3, publicKey) {
2121
}
2222

2323
/**
24-
* @param web3
25-
* @param publicKeyHash
24+
* function addPublicKey(bytes32 publicKeyHash) public
25+
* @param web3 ethereum connection
26+
* @param publicKeyHash the hash of the publickey. should have 32 bytes
2627
*/
2728
export function addPublicKey(web3, publicKeyHash) {
2829
const transaction = Object.assign({}, config.basicTransaction)
@@ -37,9 +38,10 @@ export function addPublicKey(web3, publicKeyHash) {
3738
}
3839

3940
/**
40-
* THIS METHOD WILL BE DEPREATED
41-
* @param web3
42-
* @param publicKey
41+
* THIS METHOD WILL BE DEPREATED, USE INSTEAD revokePublicKeyHash
42+
* function revokePublicKey(string memory publicKey) public
43+
* @param web3 ethereum connection
44+
* @param publicKey the public key.
4345
*/
4446
export function revokePublicKey(web3, publicKey) {
4547
const transaction = Object.assign({}, config.basicTransaction)
@@ -54,8 +56,9 @@ export function revokePublicKey(web3, publicKey) {
5456
}
5557

5658
/**
57-
* @param web3
58-
* @param publicKeyHash
59+
* function revokePublicKey(bytes32 publicKeyHash) public
60+
* @param web3 ethereum connection
61+
* @param publicKeyHash the hash of the publickey. should have 32 bytes
5962
*/
6063
export function revokePublicKeyHash(web3, publicKeyHash) {
6164
const transaction = Object.assign({}, config.basicTransaction)
@@ -70,9 +73,10 @@ export function revokePublicKeyHash(web3, publicKeyHash) {
7073
}
7174

7275
/**
73-
* THIS METHOD WILL BE DEPREATED
74-
* @param web3
75-
* @param publicKey
76+
* THIS METHOD WILL BE DEPREATED, USE INSTEAD deletePublicKeyHash
77+
* function deletePublicKey(string memory publicKey) public
78+
* @param web3 ethereum connection
79+
* @param publicKey the public key.
7680
*/
7781
export function deletePublicKey(web3, publicKey) {
7882
const transaction = Object.assign({}, config.basicTransaction)
@@ -87,8 +91,9 @@ export function deletePublicKey(web3, publicKey) {
8791
}
8892

8993
/**
90-
* @param web3
91-
* @param publicKeyHash
94+
* function deletePublicKey(bytes32 publicKeyHash) public
95+
* @param web3 ethereum connection
96+
* @param publicKeyHash the hash of the publickey. should have 32 bytes
9297
*/
9398
export function deletePublicKeyHash(web3, publicKeyHash) {
9499
const transaction = Object.assign({}, config.basicTransaction)
@@ -103,9 +108,10 @@ export function deletePublicKeyHash(web3, publicKeyHash) {
103108
}
104109

105110
/**
106-
* THIS METHOD WILL BE DEPREATED
107-
* @param web3
108-
* @param did
111+
* THIS METHOD WILL BE DEPREATED, USE INSTEAD getPublicKeyStatusHash
112+
* function getCurrentPublicKey(address subject) view public
113+
* @param web3 ethereum connection
114+
* @param did alastri Id
109115
*/
110116
export function getCurrentPublicKey(web3, did) {
111117
const subjectAddr = AIdUtils.getProxyAddress(did)
@@ -120,10 +126,11 @@ export function getCurrentPublicKey(web3, did) {
120126
}
121127

122128
/**
123-
* THIS METHOD WILL BE DEPREATED
124-
* @param web3
125-
* @param did
126-
* @param publicKey
129+
* TODO: ELIMINAR???
130+
* THIS METHOD WILL BE DEPREATED, USE INSTEAD getPublicKeyStatusHash
131+
* function getPublicKeyStatus(address subject, bytes32 publicKeyHash) view public
132+
* @param did ethereum connection
133+
* @param publicKey the public key.
127134
*/
128135
export function getPublicKeyStatus(web3, did, publicKey) {
129136
const subjectAddr = AIdUtils.getProxyAddress(did)
@@ -138,9 +145,10 @@ export function getPublicKeyStatus(web3, did, publicKey) {
138145
}
139146

140147
/**
141-
* @param web3
142-
* @param did
143-
* @param publicKeyHash
148+
* function getPublicKeyStatus(address subject, bytes32 publicKeyHash) view public
149+
* @param web3 ethereum connection
150+
* @param did alastri Id
151+
* @param publicKeyHash the hash of the publickey. should have 32 bytes
144152
*/
145153
export function getPublicKeyStatusHash(web3, did, publicKeyHash) {
146154
const subjectAddr = AIdUtils.getProxyAddress(did)

0 commit comments

Comments
 (0)