Skip to content

Commit

Permalink
fix: ipns validate should return void (#118)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: ipns validate function returns a void promise instead of boolean promise
  • Loading branch information
vasco-santos authored Apr 21, 2021
1 parent 225935a commit 67d0ad4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,6 @@ const validator = {

// Record validation
await validate(pubKey, receivedEntry)
return true
},
/**
* @param {Uint8Array} dataA
Expand Down
3 changes: 1 addition & 2 deletions test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,7 @@ describe('ipns', function () {
const marshalledData = ipns.marshal(entry)
const key = uint8ArrayFromString(`/ipns/${ipfsId.id}`)

const valid = await ipns.validator.validate(marshalledData, key)
expect(valid).to.equal(true)
await ipns.validator.validate(marshalledData, key)
})

it('should use validator.validate to verify that a record is not valid', async () => {
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"outDir": "dist"
},
"include": [
"test",
"src"
],
"exclude": [
"src/pb/ipns.js"
"src/pb/ipns.js",
"test"
]
}

0 comments on commit 67d0ad4

Please sign in to comment.