Skip to content

Commit fdee74b

Browse files
committed
Add EIP1559 Gas fields
1 parent fd6c0e6 commit fdee74b

20 files changed

+385
-3
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { MigrationInterface, QueryRunner, getConnection } from 'typeorm';
2+
3+
export class AddGasMarketFieldsToBlocks1650574957000 implements MigrationInterface {
4+
public async up(queryRunner: QueryRunner): Promise<void> {
5+
const connection = getConnection();
6+
const { schema } = connection.options as any;
7+
await queryRunner.query(`
8+
ALTER TABLE ${schema}.blocks ADD base_fee_per_gas int8 NULL;
9+
ALTER TABLE ${schema}.blocks ADD gas_used int8 NULL;
10+
`);
11+
}
12+
13+
public async down(queryRunner: QueryRunner): Promise<void> {
14+
const connection = getConnection();
15+
const { schema } = connection.options as any;
16+
await queryRunner.query(`
17+
ALTER TABLE ${schema}.blocks DROP COLUMN base_fee_per_gas;
18+
ALTER TABLE ${schema}.blocks DROP COLUMN gas_used;
19+
`);
20+
}
21+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { MigrationInterface, QueryRunner, getConnection } from 'typeorm';
2+
3+
export class AddGasMarketFieldsToTransactions1650574957001 implements MigrationInterface {
4+
public async up(queryRunner: QueryRunner): Promise<void> {
5+
const connection = getConnection();
6+
const { schema } = connection.options as any;
7+
await queryRunner.query(`
8+
ALTER TABLE ${schema}.transactions ADD "type" int NULL;
9+
ALTER TABLE ${schema}.transactions ADD max_fee_per_gas int8 NULL;
10+
ALTER TABLE ${schema}.transactions ADD max_priority_fee_per_gas int8 NULL;
11+
`);
12+
}
13+
14+
public async down(queryRunner: QueryRunner): Promise<void> {
15+
const connection = getConnection();
16+
const { schema } = connection.options as any;
17+
await queryRunner.query(`
18+
ALTER TABLE ${schema}.transactions DROP COLUMN "type";
19+
ALTER TABLE ${schema}.transactions DROP COLUMN max_fee_per_gas;
20+
ALTER TABLE ${schema}.transactions DROP COLUMN max_priority_fee_per_gas;
21+
`);
22+
}
23+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { MigrationInterface, QueryRunner, getConnection } from 'typeorm';
2+
3+
export class AddGasMarketFieldsToBlocks1650574957000 implements MigrationInterface {
4+
public async up(queryRunner: QueryRunner): Promise<void> {
5+
const connection = getConnection();
6+
const { schema } = connection.options as any;
7+
await queryRunner.query(`
8+
ALTER TABLE ${schema}.blocks ADD base_fee_per_gas int8 NULL;
9+
ALTER TABLE ${schema}.blocks ADD gas_used int8 NULL;
10+
`);
11+
}
12+
13+
public async down(queryRunner: QueryRunner): Promise<void> {
14+
const connection = getConnection();
15+
const { schema } = connection.options as any;
16+
await queryRunner.query(`
17+
ALTER TABLE ${schema}.blocks DROP COLUMN base_fee_per_gas;
18+
ALTER TABLE ${schema}.blocks DROP COLUMN gas_used;
19+
`);
20+
}
21+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { MigrationInterface, QueryRunner, getConnection } from 'typeorm';
2+
3+
export class AddGasMarketFieldsToTransactions1650574957001 implements MigrationInterface {
4+
public async up(queryRunner: QueryRunner): Promise<void> {
5+
const connection = getConnection();
6+
const { schema } = connection.options as any;
7+
await queryRunner.query(`
8+
ALTER TABLE ${schema}.transactions ADD "type" int NULL;
9+
ALTER TABLE ${schema}.transactions ADD max_fee_per_gas int8 NULL;
10+
ALTER TABLE ${schema}.transactions ADD max_priority_fee_per_gas int8 NULL;
11+
`);
12+
}
13+
14+
public async down(queryRunner: QueryRunner): Promise<void> {
15+
const connection = getConnection();
16+
const { schema } = connection.options as any;
17+
await queryRunner.query(`
18+
ALTER TABLE ${schema}.transactions DROP COLUMN "type";
19+
ALTER TABLE ${schema}.transactions DROP COLUMN max_fee_per_gas;
20+
ALTER TABLE ${schema}.transactions DROP COLUMN max_priority_fee_per_gas;
21+
`);
22+
}
23+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { MigrationInterface, QueryRunner, getConnection } from 'typeorm';
2+
3+
export class AddGasMarketFieldsToBlocks1650574957000 implements MigrationInterface {
4+
public async up(queryRunner: QueryRunner): Promise<void> {
5+
const connection = getConnection();
6+
const { schema } = connection.options as any;
7+
await queryRunner.query(`
8+
ALTER TABLE ${schema}.blocks ADD base_fee_per_gas int8 NULL;
9+
ALTER TABLE ${schema}.blocks ADD gas_used int8 NULL;
10+
`);
11+
}
12+
13+
public async down(queryRunner: QueryRunner): Promise<void> {
14+
const connection = getConnection();
15+
const { schema } = connection.options as any;
16+
await queryRunner.query(`
17+
ALTER TABLE ${schema}.blocks DROP COLUMN base_fee_per_gas;
18+
ALTER TABLE ${schema}.blocks DROP COLUMN gas_used;
19+
`);
20+
}
21+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { MigrationInterface, QueryRunner, getConnection } from 'typeorm';
2+
3+
export class AddGasMarketFieldsToTransactions1650574957001 implements MigrationInterface {
4+
public async up(queryRunner: QueryRunner): Promise<void> {
5+
const connection = getConnection();
6+
const { schema } = connection.options as any;
7+
await queryRunner.query(`
8+
ALTER TABLE ${schema}.transactions ADD "type" int NULL;
9+
ALTER TABLE ${schema}.transactions ADD max_fee_per_gas int8 NULL;
10+
ALTER TABLE ${schema}.transactions ADD max_priority_fee_per_gas int8 NULL;
11+
`);
12+
}
13+
14+
public async down(queryRunner: QueryRunner): Promise<void> {
15+
const connection = getConnection();
16+
const { schema } = connection.options as any;
17+
await queryRunner.query(`
18+
ALTER TABLE ${schema}.transactions DROP COLUMN "type";
19+
ALTER TABLE ${schema}.transactions DROP COLUMN max_fee_per_gas;
20+
ALTER TABLE ${schema}.transactions DROP COLUMN max_priority_fee_per_gas;
21+
`);
22+
}
23+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { MigrationInterface, QueryRunner, getConnection } from 'typeorm';
2+
3+
export class AddGasMarketFieldsToBlocks1650574957000 implements MigrationInterface {
4+
public async up(queryRunner: QueryRunner): Promise<void> {
5+
const connection = getConnection();
6+
const { schema } = connection.options as any;
7+
await queryRunner.query(`
8+
ALTER TABLE ${schema}.blocks ADD base_fee_per_gas int8 NULL;
9+
ALTER TABLE ${schema}.blocks ADD gas_used int8 NULL;
10+
`);
11+
}
12+
13+
public async down(queryRunner: QueryRunner): Promise<void> {
14+
const connection = getConnection();
15+
const { schema } = connection.options as any;
16+
await queryRunner.query(`
17+
ALTER TABLE ${schema}.blocks DROP COLUMN base_fee_per_gas;
18+
ALTER TABLE ${schema}.blocks DROP COLUMN gas_used;
19+
`);
20+
}
21+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { MigrationInterface, QueryRunner, getConnection } from 'typeorm';
2+
3+
export class AddGasMarketFieldsToTransactions1650574957001 implements MigrationInterface {
4+
public async up(queryRunner: QueryRunner): Promise<void> {
5+
const connection = getConnection();
6+
const { schema } = connection.options as any;
7+
await queryRunner.query(`
8+
ALTER TABLE ${schema}.transactions ADD "type" int NULL;
9+
ALTER TABLE ${schema}.transactions ADD max_fee_per_gas int8 NULL;
10+
ALTER TABLE ${schema}.transactions ADD max_priority_fee_per_gas int8 NULL;
11+
`);
12+
}
13+
14+
public async down(queryRunner: QueryRunner): Promise<void> {
15+
const connection = getConnection();
16+
const { schema } = connection.options as any;
17+
await queryRunner.query(`
18+
ALTER TABLE ${schema}.transactions DROP COLUMN "type";
19+
ALTER TABLE ${schema}.transactions DROP COLUMN max_fee_per_gas;
20+
ALTER TABLE ${schema}.transactions DROP COLUMN max_priority_fee_per_gas;
21+
`);
22+
}
23+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { MigrationInterface, QueryRunner, getConnection } from 'typeorm';
2+
3+
export class AddGasMarketFieldsToBlocks1650574957000 implements MigrationInterface {
4+
public async up(queryRunner: QueryRunner): Promise<void> {
5+
const connection = getConnection();
6+
const { schema } = connection.options as any;
7+
await queryRunner.query(`
8+
ALTER TABLE ${schema}.blocks ADD base_fee_per_gas int8 NULL;
9+
ALTER TABLE ${schema}.blocks ADD gas_used int8 NULL;
10+
`);
11+
}
12+
13+
public async down(queryRunner: QueryRunner): Promise<void> {
14+
const connection = getConnection();
15+
const { schema } = connection.options as any;
16+
await queryRunner.query(`
17+
ALTER TABLE ${schema}.blocks DROP COLUMN base_fee_per_gas;
18+
ALTER TABLE ${schema}.blocks DROP COLUMN gas_used;
19+
`);
20+
}
21+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { MigrationInterface, QueryRunner, getConnection } from 'typeorm';
2+
3+
export class AddGasMarketFieldsToTransactions1650574957001 implements MigrationInterface {
4+
public async up(queryRunner: QueryRunner): Promise<void> {
5+
const connection = getConnection();
6+
const { schema } = connection.options as any;
7+
await queryRunner.query(`
8+
ALTER TABLE ${schema}.transactions ADD "type" int NULL;
9+
ALTER TABLE ${schema}.transactions ADD max_fee_per_gas int8 NULL;
10+
ALTER TABLE ${schema}.transactions ADD max_priority_fee_per_gas int8 NULL;
11+
`);
12+
}
13+
14+
public async down(queryRunner: QueryRunner): Promise<void> {
15+
const connection = getConnection();
16+
const { schema } = connection.options as any;
17+
await queryRunner.query(`
18+
ALTER TABLE ${schema}.transactions DROP COLUMN "type";
19+
ALTER TABLE ${schema}.transactions DROP COLUMN max_fee_per_gas;
20+
ALTER TABLE ${schema}.transactions DROP COLUMN max_priority_fee_per_gas;
21+
`);
22+
}
23+
}

0 commit comments

Comments
 (0)