mirror of
https://github.com/cerc-io/watcher-ts
synced 2026-04-29 12:54:05 +00:00
* Remove support for pushing state to IPFS * Move job handlers for state creation to util * Rename state creation related methods and objects * Update mock indexer used in graph-node testing * Fetch and merge diffs in batches while creating a state checkpoint * Fix timing logs while for state checkpoint creation * Refactor method to get state query result to util * Accept contracts for state verification in compare CLI config * Make method to update state status map synchronous
37 lines
732 B
TypeScript
37 lines
732 B
TypeScript
//
|
|
// Copyright 2021 Vulcanize, Inc.
|
|
//
|
|
|
|
import { Entity, PrimaryGeneratedColumn, Column, Index, ManyToOne } from 'typeorm';
|
|
|
|
import { StateKind } from '@cerc-io/util';
|
|
|
|
import { BlockProgress } from './BlockProgress';
|
|
|
|
@Entity()
|
|
@Index(['cid'], { unique: true })
|
|
@Index(['block', 'contractAddress'])
|
|
@Index(['block', 'contractAddress', 'kind'], { unique: true })
|
|
export class State {
|
|
@PrimaryGeneratedColumn()
|
|
id!: number;
|
|
|
|
@ManyToOne(() => BlockProgress, { onDelete: 'CASCADE' })
|
|
block!: BlockProgress;
|
|
|
|
@Column('varchar', { length: 42 })
|
|
contractAddress!: string;
|
|
|
|
@Column('varchar')
|
|
cid!: string;
|
|
|
|
@Column({
|
|
type: 'enum',
|
|
enum: StateKind
|
|
})
|
|
kind!: StateKind;
|
|
|
|
@Column('bytea')
|
|
data!: Buffer;
|
|
}
|