tokenbridge-monitor/presenter/types.go

104 lines
2.2 KiB
Go
Raw Normal View History

2021-10-08 10:25:18 -07:00
package presenter
import (
"time"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
2022-05-22 04:29:01 -07:00
2022-05-23 07:47:31 -07:00
"github.com/poanetwork/tokenbridge-monitor/config"
2022-05-22 04:29:01 -07:00
"github.com/poanetwork/tokenbridge-monitor/entity"
2021-10-08 10:25:18 -07:00
)
type MessageInfo struct {
2021-10-13 11:23:26 -07:00
BridgeID string
2021-10-08 10:25:18 -07:00
MsgHash common.Hash
MessageID common.Hash
Direction entity.Direction
Sender common.Address
Executor common.Address
DataType uint
}
type InformationRequestInfo struct {
2021-10-13 11:23:26 -07:00
BridgeID string
MessageID common.Hash
Direction entity.Direction
Sender common.Address
Executor common.Address
}
2022-04-02 04:49:18 -07:00
type ErcToNativeMessageInfo struct {
BridgeID string
MsgHash common.Hash
Direction entity.Direction
Sender common.Address
2022-04-02 04:49:18 -07:00
Receiver common.Address
Value string
}
2021-10-08 10:25:18 -07:00
type EventInfo struct {
2021-10-13 11:23:26 -07:00
Action string
LogID uint `json:"-"`
Signer *common.Address `json:",omitempty"`
Data hexutil.Bytes `json:",omitempty"`
Count uint `json:",omitempty"`
Status bool `json:",omitempty"`
CallbackStatus bool `json:",omitempty"`
2021-10-08 10:25:18 -07:00
*TxInfo
}
type SearchResult struct {
2021-10-13 11:23:26 -07:00
Event *EventInfo
Message interface{}
RelatedEvents []*EventInfo
2021-10-08 10:25:18 -07:00
}
2022-03-14 02:43:14 -07:00
2022-05-06 09:59:45 -07:00
type LogResult struct {
LogID uint
ChainID string
Address common.Address
Topic0 *common.Hash `json:",omitempty"`
Topic1 *common.Hash `json:",omitempty"`
Topic2 *common.Hash `json:",omitempty"`
Topic3 *common.Hash `json:",omitempty"`
Data hexutil.Bytes
TxHash common.Hash
BlockNumber uint
}
2022-05-23 07:47:31 -07:00
type BridgeInfo struct {
BridgeID string
Mode config.BridgeMode
Home *BridgeSideInfo
Foreign *BridgeSideInfo
}
type BridgeSideInfo struct {
Chain string
ChainID string
BridgeAddress common.Address
LastFetchedBlock uint
LastFetchBlockTime time.Time
LastProcessedBlock uint
LastProcessedBlockTime time.Time
Validators []common.Address
}
type ValidatorsInfo struct {
BridgeID string
Mode config.BridgeMode
Validators []*ValidatorInfo
}
type ValidatorInfo struct {
Address common.Address
LastConfirmation *TxInfo
}
type TxInfo struct {
BlockNumber uint
Timestamp time.Time
Link string
}