From a9a5df6ada029b788fe357e85bfa70e3b9d7ff1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20=27birdy=27=20Danjou?= Date: Thu, 20 Jun 2024 17:03:51 +0200 Subject: [PATCH] test: ignore fetch from test coverage --- src/ethCall.test.ts | 19 +++++++++++++++++++ src/ethCall.ts | 1 + 2 files changed, 20 insertions(+) create mode 100644 src/ethCall.test.ts diff --git a/src/ethCall.test.ts b/src/ethCall.test.ts new file mode 100644 index 0000000..7cbbf42 --- /dev/null +++ b/src/ethCall.test.ts @@ -0,0 +1,19 @@ +import { decodeAbiBytes } from './ethCall'; + +describe('decrypt', () => { + let clientKeySer: Uint8Array; + + it('converts a hex to bytes', async () => { + const value = '0xff'; + const bytes = decodeAbiBytes(value); + expect(bytes).toEqual(new Uint8Array([255])); + + const value2 = '0x00'; + const bytes2 = decodeAbiBytes(value2); + expect(bytes2).toEqual(new Uint8Array([])); + + const value3 = '0xf0f0'; + const bytes3 = decodeAbiBytes(value3); + expect(bytes3).toEqual(new Uint8Array([240, 240])); + }); +}); diff --git a/src/ethCall.ts b/src/ethCall.ts index e0e50d5..be72ab0 100644 --- a/src/ethCall.ts +++ b/src/ethCall.ts @@ -1,3 +1,4 @@ +/* istanbul ignore file */ import { toHexString } from './utils'; export function decodeAbiBytes(hex: string): Uint8Array {