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 ( ...@@ -15,18 +15,18 @@ import (
*/ */
type BlockHeader struct { type BlockHeader struct {
Hash common.Hash Hash common.Hash `gorm:"serializer:json"`
ParentHash common.Hash ParentHash common.Hash `gorm:"serializer:json"`
Number pgtype.Numeric Number pgtype.Numeric
Timestamp uint64 Timestamp uint64
} }
type L1BlockHeader struct { type L1BlockHeader struct {
*BlockHeader BlockHeader
} }
type L2BlockHeader struct { type L2BlockHeader struct {
*BlockHeader BlockHeader
// Marked when the proposed output is finalized on L1. // Marked when the proposed output is finalized on L1.
// All bedrock blocks will have `LegacyStateBatchIndex == NULL` // All bedrock blocks will have `LegacyStateBatchIndex == NULL`
......
...@@ -13,15 +13,15 @@ import ( ...@@ -13,15 +13,15 @@ import (
*/ */
type Transaction struct { type Transaction struct {
fromAddress common.Address FromAddress common.Address `gorm:"serializer:json"`
toAddress common.Address ToAddress common.Address `gorm:"serializer:json"`
amount pgtype.Numeric Amount pgtype.Numeric
data []byte Data []byte
} }
type TokenPair struct { type TokenPair struct {
l1TokenAddress common.Address L1TokenAddress common.Address `gorm:"serializer:json"`
l2TokenAddress common.Address L2TokenAddress common.Address `gorm:"serializer:json"`
} }
type Deposit struct { type Deposit struct {
...@@ -34,14 +34,14 @@ type Deposit struct { ...@@ -34,14 +34,14 @@ type Deposit struct {
type DepositWithTransactionHash struct { type DepositWithTransactionHash struct {
Deposit *Deposit `gorm:"embedded"` Deposit *Deposit `gorm:"embedded"`
L1TransactionHash common.Hash L1TransactionHash common.Hash `gorm:"serializer:json"`
} }
type Withdrawal struct { type Withdrawal struct {
GUID string GUID string
InitiatedL2EventGUID string InitiatedL2EventGUID string
WithdrawalHash common.Hash WithdrawalHash common.Hash `gorm:"serializer:json"`
ProvenL1EventGUID sql.NullString ProvenL1EventGUID sql.NullString
FinalizedL1EventGUID sql.NullString FinalizedL1EventGUID sql.NullString
...@@ -51,10 +51,10 @@ type Withdrawal struct { ...@@ -51,10 +51,10 @@ type Withdrawal struct {
type WithdrawalWithTransactionHashes struct { type WithdrawalWithTransactionHashes struct {
Withdrawal *Withdrawal `gorm:"embedded"` Withdrawal *Withdrawal `gorm:"embedded"`
L2TransactionHash common.Hash L2TransactionHash common.Hash `gorm:"serializer:json"`
ProvenL1TransactionHash *common.Hash ProvenL1TransactionHash *common.Hash `gorm:"serializer:json"`
FinalizedL1TransactionHash *common.Hash FinalizedL1TransactionHash *common.Hash `gorm:"serializer:json"`
} }
type BridgeView interface { type BridgeView interface {
......
...@@ -11,19 +11,19 @@ import ( ...@@ -11,19 +11,19 @@ import (
type ContractEvent struct { type ContractEvent struct {
GUID string GUID string
BlockHash common.Hash BlockHash common.Hash `gorm:"serializer:json"`
TransactionHash common.Hash TransactionHash common.Hash `gorm:"serializer:json"`
EventSignature []byte EventSignature []byte `gorm:"serializer:json"`
LogIndex uint64 LogIndex uint64
} }
type L1ContractEvent struct { type L1ContractEvent struct {
*ContractEvent ContractEvent `gorm:"embedded"`
} }
type L2ContractEvent struct { type L2ContractEvent struct {
*ContractEvent ContractEvent `gorm:"embedded"`
} }
type ContractEventsView interface { 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