mirror of
https://github.com/fluencelabs/js-libp2p-interfaces
synced 2025-06-12 17:51:42 +00:00
feat: update pubsub getMsgId return type to Uint8Array (#65)
BREAKING CHANGE: new getMsgId return type is not backwards compatible with prior `string` return type.
This commit is contained in:
@ -15,15 +15,11 @@ describe('utils', () => {
|
||||
expect(first).to.not.eql(second)
|
||||
})
|
||||
|
||||
it('msgId', () => {
|
||||
expect(utils.msgId('hello', uint8ArrayFromString('world'))).to.be.eql('hello776f726c64')
|
||||
})
|
||||
|
||||
it('msgId should not generate same ID for two different Uint8Arrays', () => {
|
||||
const peerId = 'QmPNdSYk5Rfpo5euNqwtyizzmKXMNHdXeLjTQhcN4yfX22'
|
||||
const msgId0 = utils.msgId(peerId, uint8ArrayFromString('15603533e990dfde', 'base16'))
|
||||
const msgId1 = utils.msgId(peerId, uint8ArrayFromString('15603533e990dfe0', 'base16'))
|
||||
expect(msgId0).to.not.eql(msgId1)
|
||||
expect(msgId0).to.not.deep.equal(msgId1)
|
||||
})
|
||||
|
||||
it('anyMatch', () => {
|
||||
|
Reference in New Issue
Block a user