aboutsummaryrefslogtreecommitdiffstats
path: root/packages/pipeline/test/entities/block_test.ts
blob: 503f284f08344c83da91edd2c2309c11e70ac0e9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import 'mocha';
import 'reflect-metadata';

import { Block } from '../../src/entities';
import { createDbConnectionOnceAsync } from '../db_setup';
import { chaiSetup } from '../utils/chai_setup';

import { testSaveAndFindEntityAsync } from './util';

chaiSetup.configure();

// tslint:disable:custom-no-magic-numbers
describe('Block entity', () => {
    it('save/find', async () => {
        const connection = await createDbConnectionOnceAsync();
        const block = new Block();
        block.hash = '0x12345';
        block.number = 1234567;
        block.timestamp = 5432154321;
        const blocksRepository = connection.getRepository(Block);
        await testSaveAndFindEntityAsync(blocksRepository, block);
    });
});