@@ -4,8 +4,8 @@ import { AddressUtils } from '../utils/AddressUtils'
4
4
5
5
/**
6
6
* function delegateCall(address _destination, uint256 _value, bytes _data) public
7
- * @param web3
8
- * @param _destination
7
+ * @param web3 ethereum connection
8
+ * @param _destination
9
9
* @param _value
10
10
* @param _data
11
11
*/
@@ -22,8 +22,8 @@ export function delegateCall(web3, _destination, _value, _data) {
22
22
23
23
/**
24
24
* 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
27
27
*/
28
28
export function prepareAlastriaID ( web3 , signAddress ) {
29
29
const transaction = Object . assign ( { } , config . basicTransaction )
@@ -39,7 +39,7 @@ export function prepareAlastriaID(web3, signAddress) {
39
39
40
40
/**
41
41
* THIS METHOD WILL BE DEPREATED
42
- * @param web3
42
+ * @param web3 ethereum connection
43
43
* @param publicKey publicKey is a String
44
44
*/
45
45
export function createAlastriaIdentity ( web3 , publicKey ) {
@@ -58,16 +58,20 @@ export function createAlastriaIdentity(web3, publicKey) {
58
58
}
59
59
60
60
/**
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
64
64
*/
65
65
export function createAlastriaIdentityHash ( web3 , publicKeyHash ) {
66
66
const transaction = Object . assign ( { } , config . basicTransaction )
67
67
transaction . gasLimit = 600000
68
+ const publicKeyCallData = web3 . eth . abi . encodeFunctionCall (
69
+ config . contractsAbi . AlastriaPublicKeyRegistry . addPublicKey ,
70
+ [ publicKeyHash ]
71
+ )
68
72
transaction . data = web3 . eth . abi . encodeFunctionCall (
69
73
config . contractsAbi . AlastriaIdentityManager . createAlastriaIdentity ,
70
- [ publicKeyHash ]
74
+ [ publicKeyCallData ]
71
75
)
72
76
transaction . to = config . alastriaIdentityManager
73
77
return transaction
@@ -76,9 +80,9 @@ export function createAlastriaIdentityHash(web3, publicKeyHash) {
76
80
/**
77
81
* AlastriaIdentityIssuer.sol
78
82
* 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
82
86
*/
83
87
export function addIdentityIssuer ( web3 , didIssuer , level ) {
84
88
const issuerAddr = AIdUtils . getProxyAddress ( didIssuer )
@@ -95,9 +99,9 @@ export function addIdentityIssuer(web3, didIssuer, level) {
95
99
96
100
/**
97
101
* 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
101
105
*/
102
106
export function updateIdentityIssuerEidasLevel ( web3 , didIssuer , level ) {
103
107
const issuerAddr = AIdUtils . getProxyAddress ( didIssuer )
@@ -114,8 +118,8 @@ export function updateIdentityIssuerEidasLevel(web3, didIssuer, level) {
114
118
115
119
/**
116
120
* function deleteIdentityIssuer(address _identityIssuer) public onlyIdentityIssuer(_identityIssuer)
117
- * @param web3
118
- * @param didIssuer
121
+ * @param web3 ethereum connection
122
+ * @param didIssuer alastria Id
119
123
*/
120
124
export function deleteIdentityIssuer ( web3 , didIssuer ) {
121
125
const issuerAddr = AIdUtils . getProxyAddress ( didIssuer )
@@ -132,8 +136,8 @@ export function deleteIdentityIssuer(web3, didIssuer) {
132
136
133
137
/**
134
138
* 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
137
141
*/
138
142
export function getEidasLevel ( web3 , didIssuer ) {
139
143
const issuerAddr = AIdUtils . getProxyAddress ( didIssuer )
@@ -150,8 +154,8 @@ export function getEidasLevel(web3, didIssuer) {
150
154
/**
151
155
* AlastriaIdentityServiceProvider.sol
152
156
* function addIdentityServiceProvider(address _identityServiceProvider) public notIdentityServiceProvider(_identityServiceProvider)
153
- * @param web3
154
- * @param didServiceProvider
157
+ * @param web3 ethereum connection
158
+ * @param didServiceProvider alastria Id
155
159
*/
156
160
export function addIdentityServiceProvider ( web3 , didServiceProvider ) {
157
161
const providerAddr = AIdUtils . getProxyAddress ( didServiceProvider )
@@ -168,8 +172,8 @@ export function addIdentityServiceProvider(web3, didServiceProvider) {
168
172
169
173
/**
170
174
* function deleteIdentityServiceProvider(address _identityServiceProvider) public onlyIdentityServiceProvider(_identityServiceProvider)
171
- * @param web3
172
- * @param didServiceProvider
175
+ * @param web3 ethereum connection
176
+ * @param didServiceProvider alastria Id
173
177
*/
174
178
export function deleteIdentityServiceProvider ( web3 , didServiceProvider ) {
175
179
const providerAddr = AIdUtils . getProxyAddress ( didServiceProvider )
@@ -186,8 +190,8 @@ export function deleteIdentityServiceProvider(web3, didServiceProvider) {
186
190
187
191
/**
188
192
* function isIdentityServiceProvider(address _identityServiceProvider) public constant returns (bool)
189
- * @param web3
190
- * @param didServiceProvider
193
+ * @param web3 ethereum connection
194
+ * @param didServiceProvider alastria Id
191
195
*/
192
196
export function isIdentityServiceProvider ( web3 , didServiceProvider ) {
193
197
const providerAddr = AIdUtils . getProxyAddress ( didServiceProvider )
@@ -204,8 +208,8 @@ export function isIdentityServiceProvider(web3, didServiceProvider) {
204
208
205
209
/**
206
210
* function isIdentityIssuer(address _identityIssuer) public constant returns (bool)
207
- * @param web3
208
- * @param didIssuer
211
+ * @param web3 ethereum connection
212
+ * @param didIssuer alastria Id
209
213
*/
210
214
export function isIdentityIssuer ( web3 , didIssuer ) {
211
215
const issuerAddr = AIdUtils . getProxyAddress ( didIssuer )
0 commit comments