OSDN Git Service

9a70d9e66e45c430b674de1c211e8a3eb4d77bef
[bytom/vapor.git] / federation / database / orm / cross_transaction.go
1 package orm
2
3 import (
4         "database/sql"
5
6         "github.com/vapor/federation/types"
7 )
8
9 type CrossTransaction struct {
10         ID                   uint64          `gorm:"primary_key" json:"-"`
11         ChainID              uint64          `json:"-"`
12         SourceBlockHeight    uint64          `json:"source_block_height"`
13         SourceBlockHash      string          `json:"source_block_hash"`
14         SourceTxIndex        uint64          `json:"source_tx_index"`
15         SourceMuxID          string          `json:"-"`
16         SourceTxHash         string          `json:"source_tx_hash"`
17         SourceRawTransaction string          `json:"-"`
18         DestBlockHeight      sql.NullInt64   `sql:"default:null" json:"dest_block_height"`
19         DestBlockHash        sql.NullString  `sql:"default:null" json:"dest_block_hash"`
20         DestTxIndex          sql.NullInt64   `sql:"default:null" json:"dest_tx_index"`
21         DestTxHash           sql.NullString  `sql:"default:null" json:"dest_tx_hash"`
22         Status               uint8           `json:"status"`
23         CreatedAt            types.Timestamp `json:"-"`
24         UpdatedAt            types.Timestamp `json:"-"`
25
26         Chain *Chain                 `gorm:"foreignkey:ChainID" json:"-"`
27         Reqs  []*CrossTransactionReq `json:"crosschain_requests"`
28 }