You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Contains an object with `validate (marshalledData, key)` and `select (dataA, dataB)` functions.
119
115
120
-
The `validate` function aims to verify if an IPNS record is valid. First the record is unmarshalled, then the public key is obtained and finally the record is validated (signature and validity are verified).
116
+
The `validate`async function aims to verify if an IPNS record is valid. First the record is unmarshalled, then the public key is obtained and finally the record is validated (signature and validity are verified).
121
117
122
118
The `select` function is responsible for deciding which ipns record is the best (newer) between two records. Both records are unmarshalled and their sequence numbers are compared. If the first record provided is the newer, the operation result will be `0`, otherwise the operation result will be `1`.
123
119
@@ -161,7 +157,7 @@ Validate an IPNS record previously stored in a protocol buffer.
161
157
-`publicKey` (`PubKey`[RSA Instance](https://github.com/libp2p/js-libp2p-crypto/blob/master/src/keys/rsa-class.js)): key to be used for cryptographic operations.
162
158
-`ipnsEntry` (Object): ipns entry record (obtained using the create function).
163
159
164
-
Throws an error if the validation was not successful.
160
+
Returns a `Promise`, which may be rejected if the validation was not successful.
165
161
166
162
#### Datastore key
167
163
@@ -196,7 +192,7 @@ Returns the entry data structure after being serialized.
0 commit comments