Skip to content

Commit

Permalink
add comment explaining IDL.encode type/value mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
lastmjs committed Nov 1, 2024
1 parent b28586e commit 110cb61
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib/stable/execute_with_candid_serde.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ export function idlEncode(
args: any[]
): Uint8Array {
try {
// TODO IDL.encode has ArrayBuffer as the return type, but it actually returns a Uint8Array
// TODO we may need to remove the new Uint8Array in the future if they address the situation
// TODO we are not sure if they will make the final type and return value an ArrayBuffer
// TODO or a Uint8Array: https://github.com/demergent-labs/azle/issues/2061
return new Uint8Array(IDL.encode(argTypes, args));
} catch (error) {
throw new Error(`Failed to encode Candid arguments: ${error}`);
Expand Down

0 comments on commit 110cb61

Please sign in to comment.