Skip to content

Commit

Permalink
standard warning and prettier test
Browse files Browse the repository at this point in the history
  • Loading branch information
chm-diederichs committed Jan 22, 2024
1 parent 7207f59 commit e836fa5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 47 deletions.
2 changes: 1 addition & 1 deletion lib/verifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ module.exports = class Verifier {

return {
proofs: proofs.map(proofToVersion1),
patch: patch
patch
}
}

Expand Down
62 changes: 16 additions & 46 deletions test/manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -1275,56 +1275,26 @@ test('create verifier - default quorum', async function (t) {
}]
}

const manifestv1 = {
version: 1,
signers: [{
signature: 'ed25519',
namespace,
publicKey: keyPair.publicKey
}]
}
// single v0
t.is(new Verifier(manifest).quorum, 1)

const manifestMultiple = {
version: 0,
signers: [
{
signature: 'ed25519',
namespace,
publicKey: keyPair.publicKey
},
{
signature: 'ed25519',
namespace,
publicKey: keyPair2.publicKey
}
]
}
// single v1
manifest.version = 1
t.is(new Verifier(manifest).quorum, 1)

const manifestMultiplev1 = {
version: 1,
signers: [
{
signature: 'ed25519',
namespace,
publicKey: keyPair.publicKey
},
{
signature: 'ed25519',
namespace,
publicKey: keyPair2.publicKey
}
]
}
manifest.signers.push({
signature: 'ed25519',
namespace,
publicKey: keyPair2.publicKey
})

const single = new Verifier(manifest)
const singlev1 = new Verifier(manifestv1)
const multiple = new Verifier(manifestMultiple)
const multiplev1 = new Verifier(manifestMultiplev1)
// multiple v0
manifest.version = 0
t.is(new Verifier(manifest).quorum, 2)

t.is(single.quorum, 1)
t.is(singlev1.quorum, 1)
t.is(multiple.quorum, 2)
t.is(multiplev1.quorum, 2)
// multiple v1
manifest.version = 1
t.is(new Verifier(manifest).quorum, 2)
})

test('manifest encoding', t => {
Expand Down

0 comments on commit e836fa5

Please sign in to comment.