pattern-tech / gateway

Middleware that standardizes DEX API endpoints on different blockchain networks
Apache License 2.0
1 stars 1 forks source link

[BUG]: there is a wrong call on getCtx function #40

Closed hirotadashi closed 1 month ago

hirotadashi commented 2 months ago

when testing getCtx function my integration test failed. I tried it manually and this is the out put:

manual script

(async function x() {
  await RustModule.load(true);
  const node = new NodeService('http://213.239.193.208:9053/', 500000);
  // console.log(await node.getNetworkHeight())
  const blockHeaders = await node.chainSliceInfo(1296928);
  const pre_header = PreHeader.from_block_header(
    blockHeaders.get(blockHeaders.len() - 1),
  );
  console.log(pre_header);
})();

and this is the output:

TypeError: blockHeaders.len is not a function
    at /home/sati/Desktop/work/pattern/gateway1/gateway/src/chains/ergo/manual.ts:107:28
    at Generator.next (<anonymous>)
    at fulfilled (/home/sati/Desktop/work/pattern/gateway1/gateway/src/chains/ergo/manual.ts:5:58)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
hirotadashi commented 2 months ago

@satiparpar network problem