ora-io / zkgraph

Template for zkGraph.

Home Page:https://docs.hyperoracle.io/zkgraph

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BigInt.fromBytesBigEndian function cannot handle all 0 bytes.

LiRiu opened this issue · comments

commented

The mapping.ts below can be compiled, but it crashes when executed.

//@ts-ignore
import { Bytes, Event, BigInt } from "../lib/common/type";

export function handleEvents(events: Event[]): Bytes {
  BigInt.fromBytesBigEndian(Bytes.fromI32(0));
  return Bytes.empty();
}

Execute the following command.

npm run compile-local &&
npm run exec-local -- 17918638

Logs

wasm://wasm/85abdc7e:1


RuntimeError: unreachable
    at <anonymous>:wasm-function[14]:0xee4
    at <anonymous>:wasm-function[21]:0x1abb
    at <anonymous>:wasm-function[22]:0x1ae7
    at asmain (file:///Users/xxx/Documents/zkgraph/api/common/bundle.js:50:21)
    at file:///Users/xxx/Documents/zkgraph/api/exec.js:81:13

Env

  • node version: v16.10.0
  • arch: i386
  • os: macOS Monterey 12.6
  • repo commit: 8aa5b3623875168c6450bb97fa8dc1c531c4a071