mirror of
https://github.com/cerc-io/watcher-ts
synced 2026-09-08 08:54:05 +00:00
Mark entities as removed on store remove host API call (#484)
This commit is contained in:
@@ -282,19 +282,33 @@ export class Entity {
|
||||
// Add subgraph entity specific columns.
|
||||
entityObject = this._addSubgraphColumns(subgraphTypeDefs, entityObject, def);
|
||||
|
||||
// Add is_pruned column.
|
||||
entityObject.columns.push({
|
||||
name: 'isPruned',
|
||||
pgType: 'boolean',
|
||||
tsType: 'boolean',
|
||||
columnType: 'Column',
|
||||
columnOptions: [
|
||||
{
|
||||
option: 'default',
|
||||
value: false
|
||||
}
|
||||
]
|
||||
});
|
||||
// Add is_pruned, is_removed columns.
|
||||
entityObject.columns.push(
|
||||
{
|
||||
name: 'isPruned',
|
||||
pgType: 'boolean',
|
||||
tsType: 'boolean',
|
||||
columnType: 'Column',
|
||||
columnOptions: [
|
||||
{
|
||||
option: 'default',
|
||||
value: false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'isRemoved',
|
||||
pgType: 'boolean',
|
||||
tsType: 'boolean',
|
||||
columnType: 'Column',
|
||||
columnOptions: [
|
||||
{
|
||||
option: 'default',
|
||||
value: false
|
||||
}
|
||||
]
|
||||
}
|
||||
);
|
||||
|
||||
// Add decimalTransformer column option if required.
|
||||
this._addDecimalTransformerOption(entityObject);
|
||||
|
||||
@@ -142,8 +142,6 @@ export class Indexer implements IndexerInterface {
|
||||
this._storageLayoutMap = new Map();
|
||||
this._contractMap = new Map();
|
||||
this.eventSignaturesMap = new Map();
|
||||
let contractInterface: ethers.utils.Interface;
|
||||
let eventSignatures: string[];
|
||||
{{#each contracts as | contract |}}
|
||||
|
||||
const { abi: {{contract.contractName}}ABI{{#if contract.contractStorageLayout}}, storageLayout: {{contract.contractName}}StorageLayout{{/if}} } = {{contract.contractName}}Artifacts;
|
||||
@@ -153,15 +151,13 @@ export class Indexer implements IndexerInterface {
|
||||
assert({{contract.contractName}}ABI);
|
||||
this._abiMap.set(KIND_{{capitalize contract.contractName}}, {{contract.contractName}}ABI);
|
||||
|
||||
// eslint-disable-next-line prefer-const
|
||||
contractInterface = new ethers.utils.Interface({{contract.contractName}}ABI);
|
||||
this._contractMap.set(KIND_{{capitalize contract.contractName}}, contractInterface);
|
||||
const {{contract.contractName}}ContractInterface = new ethers.utils.Interface({{contract.contractName}}ABI);
|
||||
this._contractMap.set(KIND_{{capitalize contract.contractName}}, {{contract.contractName}}ContractInterface);
|
||||
|
||||
// eslint-disable-next-line prefer-const
|
||||
eventSignatures = Object.values(contractInterface.events).map(value => {
|
||||
return contractInterface.getEventTopic(value);
|
||||
const {{contract.contractName}}EventSignatures = Object.values({{contract.contractName}}ContractInterface.events).map(value => {
|
||||
return {{contract.contractName}}ContractInterface.getEventTopic(value);
|
||||
});
|
||||
this.eventSignaturesMap.set(KIND_{{capitalize contract.contractName}}, eventSignatures);
|
||||
this.eventSignaturesMap.set(KIND_{{capitalize contract.contractName}}, {{contract.contractName}}EventSignatures);
|
||||
{{#if contract.contractStorageLayout}}
|
||||
|
||||
assert({{contract.contractName}}StorageLayout);
|
||||
|
||||
Reference in New Issue
Block a user