Commit 90cb0007 authored by Hamdi Allam's avatar Hamdi Allam

export all fields. add json serializer gorm tag to byte arrays

parent f37e4e4c
......@@ -15,18 +15,18 @@ import (
*/
type BlockHeader struct {
Hash common.Hash
ParentHash common.Hash
Hash common.Hash `gorm:"serializer:json"`
ParentHash common.Hash `gorm:"serializer:json"`
Number pgtype.Numeric
Timestamp uint64
}
type L1BlockHeader struct {
*BlockHeader
BlockHeader
}
type L2BlockHeader struct {
*BlockHeader
BlockHeader
// Marked when the proposed output is finalized on L1.
// All bedrock blocks will have `LegacyStateBatchIndex == NULL`
......
......@@ -13,15 +13,15 @@ import (
*/
type Transaction struct {
fromAddress common.Address
toAddress common.Address
amount pgtype.Numeric
data []byte
FromAddress common.Address `gorm:"serializer:json"`
ToAddress common.Address `gorm:"serializer:json"`
Amount pgtype.Numeric
Data []byte
}
type TokenPair struct {
l1TokenAddress common.Address
l2TokenAddress common.Address
L1TokenAddress common.Address `gorm:"serializer:json"`
L2TokenAddress common.Address `gorm:"serializer:json"`
}
type Deposit struct {
......@@ -33,15 +33,15 @@ type Deposit struct {
}
type DepositWithTransactionHash struct {
Deposit *Deposit `gorm:"embedded"`
L1TransactionHash common.Hash
Deposit *Deposit `gorm:"embedded"`
L1TransactionHash common.Hash `gorm:"serializer:json"`
}
type Withdrawal struct {
GUID string
InitiatedL2EventGUID string
WithdrawalHash common.Hash
WithdrawalHash common.Hash `gorm:"serializer:json"`
ProvenL1EventGUID sql.NullString
FinalizedL1EventGUID sql.NullString
......@@ -51,10 +51,10 @@ type Withdrawal struct {
type WithdrawalWithTransactionHashes struct {
Withdrawal *Withdrawal `gorm:"embedded"`
L2TransactionHash common.Hash
L2TransactionHash common.Hash `gorm:"serializer:json"`
ProvenL1TransactionHash *common.Hash
FinalizedL1TransactionHash *common.Hash
ProvenL1TransactionHash *common.Hash `gorm:"serializer:json"`
FinalizedL1TransactionHash *common.Hash `gorm:"serializer:json"`
}
type BridgeView interface {
......
......@@ -11,19 +11,19 @@ import (
type ContractEvent struct {
GUID string
BlockHash common.Hash
TransactionHash common.Hash
BlockHash common.Hash `gorm:"serializer:json"`
TransactionHash common.Hash `gorm:"serializer:json"`
EventSignature []byte
EventSignature []byte `gorm:"serializer:json"`
LogIndex uint64
}
type L1ContractEvent struct {
*ContractEvent
ContractEvent `gorm:"embedded"`
}
type L2ContractEvent struct {
*ContractEvent
ContractEvent `gorm:"embedded"`
}
type ContractEventsView interface {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment