Skip to content

Commit

Permalink
refactor: type change for util function
Browse files Browse the repository at this point in the history
  • Loading branch information
frazarshad committed Jun 14, 2024
1 parent fb833ea commit 1a4f12b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/mappings/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,12 @@ export const getEscrowAddress = (port: string, channel: string) => {
const version = 'ics20-1';
const stringtoSha = Buffer.from([...Buffer.from(version), 0, ...Buffer.from(`${port}/${channel}`)]);
const shaHash = sha256.sha256.array(stringtoSha.toString());
const address = getAddressFromUint8Array(shaHash.slice(0, 20));
const hashArray = new Uint8Array(shaHash.slice(0, 20));
const address = getAddressFromUint8Array(hashArray);
return address;
};

export const getAddressFromUint8Array = (uint8Array: Array<number>, chainPrefix: string = 'agoric') => {
export const getAddressFromUint8Array = (uint8Array: Uint8Array, chainPrefix: string = 'agoric') => {
const words = bech32.toWords(uint8Array);
const bech32String = bech32.encode(chainPrefix, words);

Expand Down

0 comments on commit 1a4f12b

Please sign in to comment.