@@ -4,8 +4,8 @@ import { AddressUtils } from '../utils/AddressUtils'
44
55/**
66 * function delegateCall(address _destination, uint256 _value, bytes _data) public
7- * @param web3
8- * @param _destination
7+ * @param web3 ethereum connection
8+ * @param _destination
99 * @param _value
1010 * @param _data
1111 */
@@ -22,8 +22,8 @@ export function delegateCall(web3, _destination, _value, _data) {
2222
2323/**
2424 * function generateAccessToken(address _signAddress) public onlyIdentityServiceProvider(msg.sender)
25- * @param web3
26- * @param signAddress
25+ * @param web3 ethereum connection
26+ * @param signAddress Proxy address of the entity that sends the prepare and create TX
2727 */
2828export function prepareAlastriaID ( web3 , signAddress ) {
2929 const transaction = Object . assign ( { } , config . basicTransaction )
@@ -39,7 +39,7 @@ export function prepareAlastriaID(web3, signAddress) {
3939
4040/**
4141 * THIS METHOD WILL BE DEPREATED
42- * @param web3
42+ * @param web3 ethereum connection
4343 * @param publicKey publicKey is a String
4444 */
4545export function createAlastriaIdentity ( web3 , publicKey ) {
@@ -58,16 +58,20 @@ export function createAlastriaIdentity(web3, publicKey) {
5858}
5959
6060/**
61-
62- * @param web3
63- * @param publicKeyHash
61+ * function createAlastriaIdentity(bytes32 publicKeyHash) public
62+ * @param web3 ethereum connection
63+ * @param publicKeyHash the hash of the publickey. should have 32 bytes
6464 */
6565export function createAlastriaIdentityHash ( web3 , publicKeyHash ) {
6666 const transaction = Object . assign ( { } , config . basicTransaction )
6767 transaction . gasLimit = 600000
68+ const publicKeyCallData = web3 . eth . abi . encodeFunctionCall (
69+ config . contractsAbi . AlastriaPublicKeyRegistry . addPublicKey ,
70+ [ publicKeyHash ]
71+ )
6872 transaction . data = web3 . eth . abi . encodeFunctionCall (
6973 config . contractsAbi . AlastriaIdentityManager . createAlastriaIdentity ,
70- [ publicKeyHash ]
74+ [ publicKeyCallData ]
7175 )
7276 transaction . to = config . alastriaIdentityManager
7377 return transaction
@@ -76,9 +80,9 @@ export function createAlastriaIdentityHash(web3, publicKeyHash) {
7680/**
7781 * AlastriaIdentityIssuer.sol
7882 * function addIdentityIssuer(address _identityIssuer, Eidas.EidasLevel _level) public alLeastLow(_level) notIdentityIssuer(_identityIssuer)
79- * @param web3
80- * @param didIssuer
81- * @param level
83+ * @param web3 ethereum connection
84+ * @param didIssuer alastria Id
85+ * @param level uint that indicates the eidas leves
8286 */
8387export function addIdentityIssuer ( web3 , didIssuer , level ) {
8488 const issuerAddr = AIdUtils . getProxyAddress ( didIssuer )
@@ -95,9 +99,9 @@ export function addIdentityIssuer(web3, didIssuer, level) {
9599
96100/**
97101 * function updateIdentityIssuerEidasLevel(address _identityIssuer, Eidas.EidasLevel _level) public alLeastLow(_level) onlyIdentityIssuer(_identityIssuer)
98- * @param web3
99- * @param didIssuer
100- * @param level
102+ * @param web3 ethereum connection
103+ * @param didIssuer alastria Id
104+ * @param level uint that indicates the eidas leves
101105 */
102106export function updateIdentityIssuerEidasLevel ( web3 , didIssuer , level ) {
103107 const issuerAddr = AIdUtils . getProxyAddress ( didIssuer )
@@ -114,8 +118,8 @@ export function updateIdentityIssuerEidasLevel(web3, didIssuer, level) {
114118
115119/**
116120 * function deleteIdentityIssuer(address _identityIssuer) public onlyIdentityIssuer(_identityIssuer)
117- * @param web3
118- * @param didIssuer
121+ * @param web3 ethereum connection
122+ * @param didIssuer alastria Id
119123 */
120124export function deleteIdentityIssuer ( web3 , didIssuer ) {
121125 const issuerAddr = AIdUtils . getProxyAddress ( didIssuer )
@@ -132,8 +136,8 @@ export function deleteIdentityIssuer(web3, didIssuer) {
132136
133137/**
134138 * function getEidasLevel(address _identityIssuer) public constant onlyIdentityIssuer(_identityIssuer) returns (Eidas.EidasLevel)
135- * @param web3
136- * @param didIssuer
139+ * @param web3 ethereum connection
140+ * @param didIssuer alastria Id
137141 */
138142export function getEidasLevel ( web3 , didIssuer ) {
139143 const issuerAddr = AIdUtils . getProxyAddress ( didIssuer )
@@ -150,8 +154,8 @@ export function getEidasLevel(web3, didIssuer) {
150154/**
151155 * AlastriaIdentityServiceProvider.sol
152156 * function addIdentityServiceProvider(address _identityServiceProvider) public notIdentityServiceProvider(_identityServiceProvider)
153- * @param web3
154- * @param didServiceProvider
157+ * @param web3 ethereum connection
158+ * @param didServiceProvider alastria Id
155159 */
156160export function addIdentityServiceProvider ( web3 , didServiceProvider ) {
157161 const providerAddr = AIdUtils . getProxyAddress ( didServiceProvider )
@@ -168,8 +172,8 @@ export function addIdentityServiceProvider(web3, didServiceProvider) {
168172
169173/**
170174 * function deleteIdentityServiceProvider(address _identityServiceProvider) public onlyIdentityServiceProvider(_identityServiceProvider)
171- * @param web3
172- * @param didServiceProvider
175+ * @param web3 ethereum connection
176+ * @param didServiceProvider alastria Id
173177 */
174178export function deleteIdentityServiceProvider ( web3 , didServiceProvider ) {
175179 const providerAddr = AIdUtils . getProxyAddress ( didServiceProvider )
@@ -186,8 +190,8 @@ export function deleteIdentityServiceProvider(web3, didServiceProvider) {
186190
187191/**
188192 * function isIdentityServiceProvider(address _identityServiceProvider) public constant returns (bool)
189- * @param web3
190- * @param didServiceProvider
193+ * @param web3 ethereum connection
194+ * @param didServiceProvider alastria Id
191195 */
192196export function isIdentityServiceProvider ( web3 , didServiceProvider ) {
193197 const providerAddr = AIdUtils . getProxyAddress ( didServiceProvider )
@@ -204,8 +208,8 @@ export function isIdentityServiceProvider(web3, didServiceProvider) {
204208
205209/**
206210 * function isIdentityIssuer(address _identityIssuer) public constant returns (bool)
207- * @param web3
208- * @param didIssuer
211+ * @param web3 ethereum connection
212+ * @param didIssuer alastria Id
209213 */
210214export function isIdentityIssuer ( web3 , didIssuer ) {
211215 const issuerAddr = AIdUtils . getProxyAddress ( didIssuer )
0 commit comments