@@ -156,42 +156,12 @@ export function getPublicKeyStatusHash(web3, did, publicKeyHash) {
156
156
return transaction
157
157
}
158
158
159
- /**
160
- * THIS METHOD WILL BE DEPREATED
161
- * @param web3
162
- * @param did
163
- * @param publicKey
164
- */
165
- export function getPublicKeyStatusDecodedAsJSON (
166
- web3 ,
167
- did ,
168
- publicKey
169
- ) : Promise < PublicKeyStatus > {
170
- const publicKeyStatusTx = getPublicKeyStatus ( web3 , did , publicKey )
171
-
172
- return new Promise ( ( resolve ) => {
173
- web3 . eth . call ( publicKeyStatusTx ) . then ( ( data ) => {
174
- const publicKeyStatusDecoded = web3 . eth . abi . decodeParameters (
175
- [ 'bool' , 'uint8' , 'uint' , 'uint' ] ,
176
- data
177
- )
178
- const publicKeyStatusDecodedAsJSON = {
179
- exists : publicKeyStatusDecoded [ '0' ] ,
180
- status : publicKeyStatusDecoded [ '1' ] ,
181
- startDate : parseInt ( publicKeyStatusDecoded [ '2' ] ) ,
182
- endDate : parseInt ( publicKeyStatusDecoded [ '3' ] )
183
- }
184
- resolve ( publicKeyStatusDecodedAsJSON )
185
- } )
186
- } )
187
- }
188
-
189
159
/**
190
160
* @param web3
191
161
* @param did
192
162
* @param publicKeyHash
193
163
*/
194
- export function getPublicKeyStatusDecodedAsJSONHash (
164
+ export function getPublicKeyStatusDecodedAsJSON (
195
165
web3 ,
196
166
did ,
197
167
publicKeyHash
@@ -215,45 +185,13 @@ export function getPublicKeyStatusDecodedAsJSONHash(
215
185
} )
216
186
}
217
187
218
- /**
219
- * THIS METHOD WILL BE DEPREATED
220
- * @param web3
221
- * @param did
222
- * @param publicKey
223
- * @param date in milliseconds
224
- */
225
- export function isPublicKeyValidForDate ( web3 , did , publicKey , date ) {
226
- publicKey = AddressUtils . getAddressWithHexPrefix ( publicKey )
227
- return new Promise ( ( resolve , reject ) => {
228
- transactionFactory . publicKeyRegistry
229
- . getPublicKeyStatusDecodedAsJSON ( web3 , did , publicKey )
230
- . then ( ( publicKeyStatusAsJSON ) => {
231
- const existsPublicKey = publicKeyStatusAsJSON . exists
232
-
233
- if ( existsPublicKey ) {
234
- const isUserDateBetweenDates = _isUserDateBetweeenDates (
235
- date ,
236
- publicKeyStatusAsJSON . startDate ,
237
- publicKeyStatusAsJSON . endDate
238
- )
239
- resolve ( isUserDateBetweenDates )
240
- } else {
241
- reject ( new Error ( 'Public key does not exist' ) )
242
- }
243
- } )
244
- . catch ( ( ) => {
245
- reject ( new Error ( 'Unresolved error' ) )
246
- } )
247
- } )
248
- }
249
-
250
188
/**
251
189
* @param web3
252
190
* @param did
253
191
* @param publicKeyHash
254
192
* @param date in milliseconds
255
193
*/
256
- export function isPublicKeyValidForDateHash ( web3 , did , publicKeyHash , date ) {
194
+ export function isPublicKeyValidForDate ( web3 , did , publicKeyHash , date ) {
257
195
publicKeyHash = AddressUtils . getAddressWithHexPrefix ( publicKeyHash )
258
196
return new Promise ( ( resolve , reject ) => {
259
197
transactionFactory . publicKeyRegistry
0 commit comments