Skip to content

Commit 6ae2f34

Browse files
committed
Fix: getBs funcs are not async.
1 parent 31e6d79 commit 6ae2f34

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

tests/assertions.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,18 @@ export const proofBytes = {
3030
'P-384': 96
3131
};
3232

33-
export const shouldHaveByteLength = async (
33+
export const shouldHaveByteLength = (
3434
multibaseString,
3535
expectedByteLength
3636
) => {
37-
const bytes = await getBs58Bytes(multibaseString);
37+
const bytes = getBs58Bytes(multibaseString);
3838
bytes.length.should.eql(
3939
expectedByteLength,
4040
`Expected byteLength of ${expectedByteLength} received ${bytes.length}.`);
4141
};
4242

43-
export const shouldHaveHeaderBytes = async (multibaseString, headerBytes) => {
44-
const bytes = await getBs64UrlBytes(multibaseString);
43+
export const shouldHaveHeaderBytes = (multibaseString, headerBytes) => {
44+
const bytes = getBs64UrlBytes(multibaseString);
4545
const actualHeaderBytes = Array.from(bytes.slice(0, headerBytes.length));
4646
actualHeaderBytes.should.eql(
4747
Array.from(headerBytes),
@@ -54,7 +54,7 @@ export const shouldBeMulticodecEncoded = async s => {
5454
if(s.startsWith(multibaseMultikeyHeaderP256)) {
5555
// example of a P-256 publicKeyMultibase -
5656
// zDnaepHgv4AU1btQ8dp6EYbvgJ6M1ovzKnSpXJUPU2hshXLvp
57-
const bytes = await getBs58Bytes(s);
57+
const bytes = getBs58Bytes(s);
5858
bytes.length.should.equal(35);
5959
// bytes example => Uint8Array(35) [
6060
// 128, 36, 3, 98, 121, 153, 205, 199,
@@ -72,7 +72,7 @@ export const shouldBeMulticodecEncoded = async s => {
7272
}
7373

7474
if(s.startsWith(multibaseMultikeyHeaderP384)) {
75-
const bytes = await getBs58Bytes(s);
75+
const bytes = getBs58Bytes(s);
7676
bytes.length.should.equal(51);
7777
// get the two-byte prefix
7878
const prefix = Array.from(bytes.slice(0, 2));
@@ -211,7 +211,7 @@ export async function shouldBeBaseProofValue({proof, name}) {
211211
shouldBeBs64UrlNoPad(proof.proofValue),
212212
'Expected "proof.proofValue" to be bs64 url no pad encoded.'
213213
).to.be.true;
214-
await shouldHaveHeaderBytes(
214+
shouldHaveHeaderBytes(
215215
proof.proofValue,
216216
new Uint8Array([0xd9, 0x5d, 0x00])
217217
);

tests/helpers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ export const require = createRequire(import.meta.url);
1414

1515
// takes a multibase string starting with z lops the z off
1616
// and gets the bytes
17-
export const getBs58Bytes = async s => bs58.decode(s.slice(1));
18-
export const getBs64UrlBytes = async s => bs64.decode(s.slice(1));
17+
export const getBs58Bytes = s => bs58.decode(s.slice(1));
18+
export const getBs64UrlBytes = s => bs64.decode(s.slice(1));
1919

2020
// Javascript's default ISO timestamp contains milliseconds.
2121
// This lops off the MS part of the UTC RFC3339 TimeStamp and replaces

0 commit comments

Comments
 (0)