Skip to content

Commit

Permalink
test: add more test for call params
Browse files Browse the repository at this point in the history
  • Loading branch information
immortal-tofu committed Jun 17, 2024
1 parent 089ff07 commit c90f3c0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
bytesToHex,
clientKeyDecryptor,
fromHexString,
getCiphertextCallParams,
toHexString,
} from './utils';
import { createTfheKeypair } from './tfhe';
Expand Down Expand Up @@ -138,4 +139,12 @@ describe('decrypt', () => {
const v = await d.decryptAddress(toHexString(c));
expect(v).toBe('0x8ba1f109551bd432803012645ac136ddd64dba72');
});

it('returns ciphertext call params', async () => {
const params = getCiphertextCallParams(BigInt(23));
expect(params.data).toBe(
'0xff627e770000000000000000000000000000000000000000000000000000000000000017',
);
expect(params.to).toBe('0x000000000000000000000000000000000000005d');
});
});

0 comments on commit c90f3c0

Please sign in to comment.