Skip to content

Commit c85e1e9

Browse files
committed
Fix Uint8Array type compatibility for strict TS
Copy returnValue via `new Uint8Array()` to avoid Uint8Array<ArrayBufferLike> vs Uint8Array<ArrayBuffer> mismatch in TS 5.7+ strict mode.
1 parent b646959 commit c85e1e9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/bugc/test/evm/behavioral.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export async function executeProgram(
7171
await executor.deploy(createCode);
7272

7373
let callSuccess: boolean | undefined;
74-
let returnValue = new Uint8Array();
74+
let returnValue: Uint8Array = new Uint8Array();
7575

7676
// Call if calldata provided (even empty string means "call")
7777
if (calldata !== undefined) {
@@ -80,7 +80,7 @@ export async function executeProgram(
8080
value,
8181
});
8282
callSuccess = execResult.success;
83-
returnValue = execResult.returnValue;
83+
returnValue = new Uint8Array(execResult.returnValue);
8484
}
8585

8686
return {

0 commit comments

Comments
 (0)