2021-11-01 09:43:22 +00:00
|
|
|
//
|
|
|
|
// Copyright 2021 Vulcanize, Inc.
|
|
|
|
//
|
|
|
|
|
|
|
|
import { EventData } from '../../src/utils';
|
2021-11-10 07:42:37 +00:00
|
|
|
import { Database } from '../../src/database';
|
2021-11-29 12:21:16 +00:00
|
|
|
import { Indexer } from './indexer';
|
2021-11-01 09:43:22 +00:00
|
|
|
|
|
|
|
export const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
|
|
|
|
export const ZERO_HASH = '0x0000000000000000000000000000000000000000000000000000000000000000';
|
|
|
|
|
|
|
|
export const getDummyEventData = (): EventData => {
|
|
|
|
const block = {
|
2021-11-10 07:42:37 +00:00
|
|
|
blockHash: ZERO_HASH,
|
|
|
|
blockNumber: '0',
|
|
|
|
timestamp: '0',
|
|
|
|
parentHash: ZERO_HASH,
|
|
|
|
stateRoot: ZERO_HASH,
|
|
|
|
td: ZERO_HASH,
|
|
|
|
txRoot: ZERO_HASH,
|
2021-11-25 10:49:45 +00:00
|
|
|
receiptRoot: ZERO_HASH,
|
|
|
|
uncleHash: ZERO_HASH,
|
|
|
|
difficulty: '0',
|
|
|
|
gasLimit: '0',
|
|
|
|
gasUsed: '0'
|
2021-11-01 09:43:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const tx = {
|
|
|
|
hash: ZERO_HASH,
|
|
|
|
index: 0,
|
|
|
|
from: ZERO_ADDRESS,
|
|
|
|
to: ZERO_ADDRESS
|
|
|
|
};
|
|
|
|
|
|
|
|
return {
|
|
|
|
block,
|
|
|
|
tx,
|
2021-11-25 10:49:45 +00:00
|
|
|
inputs: [],
|
|
|
|
event: {},
|
2021-11-01 09:43:22 +00:00
|
|
|
eventIndex: 0
|
|
|
|
};
|
|
|
|
};
|
2021-11-10 07:42:37 +00:00
|
|
|
|
2021-11-29 12:21:16 +00:00
|
|
|
export const getDummyGraphData = (): any => {
|
|
|
|
return {
|
|
|
|
dataSource: {
|
|
|
|
address: ZERO_ADDRESS
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-11-10 07:42:37 +00:00
|
|
|
export const getTestDatabase = (): Database => {
|
|
|
|
return new Database({ type: 'postgres' }, '');
|
|
|
|
};
|
2021-11-29 12:21:16 +00:00
|
|
|
|
|
|
|
export const getTestIndexer = (): Indexer => {
|
|
|
|
return new Indexer();
|
|
|
|
};
|