Skip to content

Commit 15eb1ec

Browse files
committed
Remove compose and decompose transaction
1 parent a43a99c commit 15eb1ec

18 files changed

+59
-657
lines changed
Lines changed: 10 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,17 @@
1-
import * as Sequelize from "sequelize";
2-
import { AssetTransferInput, AssetTransferOutput } from "./transferAsset";
1+
"use strict";
2+
const tableName = "ComposeAssets";
3+
module.exports = {
4+
up: (queryInterface, Sequelize) => {
5+
return queryInterface.dropTable(tableName, { force: true });
6+
},
37

4-
export interface DecomposeAssetAttribute {
5-
transactionHash: string;
6-
networkId: string;
7-
approvals: string[];
8-
input: AssetTransferInput;
9-
outputs: AssetTransferOutput[];
10-
}
11-
12-
export type DecomposeAssetInstance = Sequelize.Instance<
13-
DecomposeAssetAttribute
14-
>;
15-
16-
export default (
17-
sequelize: Sequelize.Sequelize,
18-
DataTypes: Sequelize.DataTypes
19-
) => {
20-
const Action = sequelize.define(
21-
"DecomposeAsset",
22-
{
8+
down: (queryInterface, DataTypes) => {
9+
return queryInterface.createTable(tableName, {
2310
transactionHash: {
2411
allowNull: false,
2512
primaryKey: true,
2613
type: DataTypes.STRING,
2714
onDelete: "CASCADE",
28-
validate: {
29-
is: ["^[a-f0-9]{40}$"]
30-
},
3115
references: {
3216
model: "Transactions",
3317
key: "hash"
@@ -59,11 +43,6 @@ export default (
5943
allowNull: false,
6044
type: DataTypes.DATE
6145
}
62-
},
63-
{}
64-
);
65-
Action.associate = () => {
66-
// associations can be defined here
67-
};
68-
return Action;
46+
});
47+
}
6948
};
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
"use strict";
2+
const tableName = "DecomposeAssets";
3+
module.exports = {
4+
up: (queryInterface, Sequelize) => {
5+
return queryInterface.dropTable(tableName, { force: true });
6+
},
7+
8+
down: (queryInterface, DataTypes) => {
9+
return queryInterface.createTable(tableName, {
10+
transactionHash: {
11+
allowNull: false,
12+
primaryKey: true,
13+
type: DataTypes.STRING,
14+
onDelete: "CASCADE",
15+
references: {
16+
model: "Transactions",
17+
key: "hash"
18+
}
19+
},
20+
21+
networkId: {
22+
allowNull: false,
23+
type: DataTypes.STRING
24+
},
25+
approvals: {
26+
allowNull: false,
27+
type: DataTypes.JSONB
28+
},
29+
input: {
30+
allowNull: false,
31+
type: DataTypes.JSONB
32+
},
33+
outputs: {
34+
allowNull: false,
35+
type: DataTypes.JSONB
36+
},
37+
38+
createdAt: {
39+
allowNull: false,
40+
type: DataTypes.DATE
41+
},
42+
updatedAt: {
43+
allowNull: false,
44+
type: DataTypes.DATE
45+
}
46+
});
47+
}
48+
};

src/models/composeAsset.ts

Lines changed: 0 additions & 126 deletions
This file was deleted.

src/models/index.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,8 @@ import {
1818
ChangeAssetSchemeAttribute,
1919
ChangeAssetSchemeInstance
2020
} from "./changeAssetScheme";
21-
import { ComposeAssetAttribute, ComposeAssetInstance } from "./composeAsset";
2221
import { CreateShardAttribute, CreateShardInstance } from "./createShard";
2322
import { CustomAttribute, CustomInstance } from "./custom";
24-
import {
25-
DecomposeAssetAttribute,
26-
DecomposeAssetInstance
27-
} from "./decomposeAsset";
2823
import {
2924
IncreaseAssetSupplyAttribute,
3025
IncreaseAssetSupplyInstance
@@ -92,11 +87,6 @@ interface DB {
9287
TransferAssetInstance,
9388
TransferAssetAttribute
9489
>;
95-
ComposeAsset: Sequelize.Model<ComposeAssetInstance, ComposeAssetAttribute>;
96-
DecomposeAsset: Sequelize.Model<
97-
DecomposeAssetInstance,
98-
DecomposeAssetAttribute
99-
>;
10090
ChangeAssetScheme: Sequelize.Model<
10191
ChangeAssetSchemeInstance,
10292
ChangeAssetSchemeAttribute

src/models/log.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ export enum LogType {
1919
CREATE_SHARD_COUNT = "CREATE_SHARD_COUNT",
2020
MINT_ASSET_COUNT = "MINT_ASSET_COUNT",
2121
TRANSFER_ASSET_COUNT = "TRANSFER_ASSET_COUNT",
22-
COMPOSE_ASSET_COUNT = "COMPOSE_ASSET_COUNT",
23-
DECOMPOSE_ASSET_COUNT = "DECOMPOSE_ASSET_COUNT",
2422
CHANGE_ASSET_SCHEME_COUNT = "CHANGE_ASSET_SCHEME_COUNT",
2523
INCREASE_ASSET_SUPPLY_COUNT = "INCREASE_ASSET_SUPPLY_COUNT",
2624
STORE_COUNT = "STORE_COUNT",

0 commit comments

Comments
 (0)