mirror of
https://github.com/cerc-io/watcher-ts
synced 2025-02-10 03:46:36 +00:00
* Implement storage mode in code generator. * Fix indexer template for eth_call. * Add support for both eth_call and storage modes. * Add eventsInRange, events file gen and default entites gen. * Use static property to column maps in database. * Process events query. * Avoid adding duplicate events in indexer. * Fix generated watcher query with bigint arguments. Co-authored-by: nabarun <nabarun@deepstacksoft.com> Co-authored-by: prathamesh <prathamesh.musale0@gmail.com>
22 lines
639 B
TypeScript
22 lines
639 B
TypeScript
//
|
|
// Copyright 2021 Vulcanize, Inc.
|
|
//
|
|
|
|
import fs from 'fs';
|
|
import path from 'path';
|
|
import Handlebars from 'handlebars';
|
|
import { Writable } from 'stream';
|
|
|
|
const TEMPLATE_FILE = './templates/events-template.handlebars';
|
|
|
|
/**
|
|
* Writes the events file generated from a template to a stream.
|
|
* @param outStream A writable output stream to write the events file to.
|
|
*/
|
|
export function exportEvents (outStream: Writable): void {
|
|
const templateString = fs.readFileSync(path.resolve(__dirname, TEMPLATE_FILE)).toString();
|
|
const template = Handlebars.compile(templateString);
|
|
const events = template({});
|
|
outStream.write(events);
|
|
}
|