File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -241,11 +241,11 @@ export class PubSubDatastore extends BaseDatastore {
241241 /**
242242 * Validate record according to the received validation function
243243 *
244+ * @param {Uint8Array } key
244245 * @param {Uint8Array } value
245- * @param {Uint8Array } peerId
246246 */
247- async _validateRecord ( value , peerId ) { // eslint-disable-line require-await
248- return this . _validator ( value , peerId )
247+ async _validateRecord ( key , value ) { // eslint-disable-line require-await
248+ return this . _validator ( key , value )
249249 }
250250
251251 /**
@@ -269,7 +269,7 @@ export class PubSubDatastore extends BaseDatastore {
269269 */
270270 async _isBetter ( key , val ) {
271271 try {
272- await this . _validateRecord ( val , key )
272+ await this . _validateRecord ( key , val )
273273 } catch ( /** @type {any } */ err ) {
274274 // If not valid, it is not better than the one currently available
275275 const errMsg = 'record received through pubsub is not valid'
Original file line number Diff line number Diff line change @@ -143,7 +143,7 @@ describe('datastore-pubsub', function () {
143143
144144 it ( 'should validate if record content is the same' , async ( ) => {
145145 /** @type {Validator } */
146- const customValidator = async ( data ) => {
146+ const customValidator = async ( key , data ) => {
147147 const receivedRecord = Libp2pRecord . deserialize ( data )
148148
149149 expect ( uint8ArrayToString ( receivedRecord . value ) ) . to . equal ( value ) // validator should deserialize correctly
You can’t perform that action at this time.
0 commit comments