Template literal in event name throws error
0xOlias opened this issue · comments
typedarray commented
From telegram:
Why can't a StringTemplate be used to compose the event name?
const contractName = "TPManager";
const eventName = "CreateVaultAndToken";
const ponderEvent = `${contractName}:${eventName}`;
console.log(`- Config event: "${ponderEvent}"`);
ponder.on(ponderEvent, async (params) => {
console.log(`params: ${params}`);
});
error message:
22:17:28 INFO build Using SQLite database at .ponder/sqlite (default)
- Config event: "TPManager:CreateVaultAndToken"
22:17:29 ERROR build Cannot read properties of undefined (reading 'access')
22:17:29 FATAL app Failed intial build
I can't dynamically create the event name? How could it be done? Could you help me?
This is a bug in our static analysis logic. Instead of throwing, we should fall back to "this function reads and writes to every table" and log a warning that static analysis failed for this indexing function.