Skip to content

The excessively long bytes cannot be toHexString. #39

@LiRiu

Description

@LiRiu

When the Bytes are too large, the toHexString function cannot execute.

Env

  • zkgraph-lib: v1.0.1
  • zkgraph-cli: v1.0.0

Reproduce

  1. npm init zkgraph@latest
  2. Follow the guide to initialize a project of type "event"
  3. modify src/mapping.ts as follow:
//@ts-ignore
import { Bytes, Block } from "@hyperoracle/zkgraph-lib";

export function handleBlocks(blocks: Block[]): Bytes {
  const event = blocks[0].events[0];
  event.data.toHexString();
  return Bytes.empty();
}
  1. modify src/zkgraph.yaml as follow:
specVersion: 0.0.2
apiVersion: 0.0.2
name: eg_event
description: "This demo zkGraph shows 3 ways to access / filter out source events."
repository: https://github.com/hyperoracle/zkgraph
dataSources:
  - kind: ethereum
    network: sepolia
    event:
      - address: '0xfa002dc692d045afde265d5eac09d012c1af50e8'
        events: 
          - "ethscriptions_protocol_CreateEthscription(address,string)"

mapping:
  language: wasm/assemblyscript
  file: ./mapping.ts
  handler: handleBlocks

dataDestinations:
  - kind: ethereum
    network: sepolia
    address: "0x0000000000000000000000000000000000000001"
  1. npm run compile && npm run exec -- 4940316
    Next, there will be the following error message from execue.
image

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions