Golang implemented sidechain for Bytom
リビジョン | 63c4ea59425420d2f954043e82756795baf3c473 (tree) |
---|---|
日時 | 2019-06-12 22:00:47 |
作者 | HAOYUatHZ <haoyu@prot...> |
コミッター | HAOYUatHZ |
add orm
@@ -5,17 +5,21 @@ import ( | ||
5 | 5 | ) |
6 | 6 | |
7 | 7 | type CrossTransaction struct { |
8 | - ID uint64 `gorm:"primary_key"` | |
9 | - ChainID uint64 | |
10 | - BlockHeight uint64 | |
11 | - BlockHash string | |
12 | - TxIndex uint64 | |
13 | - MuxID string | |
14 | - TxHash string | |
15 | - RawTransaction string | |
16 | - Status uint8 | |
17 | - CreatedAt types.Timestamp | |
18 | - UpdatedAt types.Timestamp | |
8 | + ID uint64 `gorm:"primary_key"` | |
9 | + ChainID uint64 | |
10 | + SourceBlockHeight uint64 | |
11 | + SourceBlockHash string | |
12 | + SourceTxIndex uint64 | |
13 | + SourceMuxID string | |
14 | + SourceTxHash string | |
15 | + SourceRawTransaction string | |
16 | + DestBlockHeight uint64 | |
17 | + DestBlockHash string | |
18 | + DestTxIndex uint64 | |
19 | + DestTxHash string | |
20 | + Status uint8 | |
21 | + CreatedAt types.Timestamp | |
22 | + UpdatedAt types.Timestamp | |
19 | 23 | |
20 | 24 | Chain *Chain `gorm:"foreignkey:ChainID"` |
21 | 25 | } |
@@ -1,15 +0,0 @@ | ||
1 | -package orm | |
2 | - | |
3 | -import ( | |
4 | - "github.com/vapor/federation/types" | |
5 | -) | |
6 | - | |
7 | -type CrossTransactionInput struct { | |
8 | - ID uint64 `gorm:"primary_key"` | |
9 | - TxID uint64 | |
10 | - SourcePos uint64 | |
11 | - CreatedAt types.Timestamp | |
12 | - UpdatedAt types.Timestamp | |
13 | - | |
14 | - CrossTransaction *CrossTransaction `gorm:"foreignkey:TxID"` | |
15 | -} |
@@ -0,0 +1,19 @@ | ||
1 | +package orm | |
2 | + | |
3 | +import ( | |
4 | + "github.com/vapor/federation/types" | |
5 | +) | |
6 | + | |
7 | +type CrossTransactionReq struct { | |
8 | + ID uint64 `gorm:"primary_key"` | |
9 | + CrossTransactionID uint64 | |
10 | + SourcePos uint64 | |
11 | + AssetID uint64 | |
12 | + AssetAmount uint64 | |
13 | + Script string | |
14 | + CreatedAt types.Timestamp | |
15 | + UpdatedAt types.Timestamp | |
16 | + | |
17 | + CrossTransaction *CrossTransaction `gorm:"foreignkey:CrossTransactionID"` | |
18 | + Asset *Asset `gorm:"foreignkey:AssetID"` | |
19 | +} |