2022-10-22 17:58:38 -07:00
|
|
|
package storage
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
2022-11-08 06:53:12 -08:00
|
|
|
|
|
|
|
"github.com/wormhole-foundation/wormhole/sdk/vaa"
|
2022-10-22 17:58:38 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
type IndexingTimestamps struct {
|
|
|
|
IndexedAt time.Time `bson:"indexedAt"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type VaaUpdate struct {
|
|
|
|
ID string `bson:"_id"`
|
|
|
|
Version uint8 `bson:"version"`
|
|
|
|
EmitterChain vaa.ChainID `bson:"emitterChain"`
|
|
|
|
EmitterAddr string `bson:"emitterAddr"`
|
|
|
|
Sequence uint64 `bson:"sequence"`
|
|
|
|
GuardianSetIndex uint32 `bson:"guardianSetIndex"`
|
|
|
|
Vaa []byte `bson:"vaas"`
|
|
|
|
Timestamp *time.Time `bson:"timestamp"`
|
2022-11-07 09:47:10 -08:00
|
|
|
UpdatedAt *time.Time `bson:"updatedAt"`
|
2022-10-22 17:58:38 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
type ObservationUpdate struct {
|
|
|
|
MessageID string `bson:"messageId"`
|
2022-11-17 07:37:29 -08:00
|
|
|
ChainID vaa.ChainID `bson:"emitterChain"`
|
|
|
|
Emitter string `bson:"emitterAddr"`
|
|
|
|
Sequence uint64 `bson:"sequence"`
|
2022-10-22 17:58:38 -07:00
|
|
|
Hash []byte `bson:"hash"`
|
|
|
|
TxHash []byte `bson:"txHash"`
|
|
|
|
GuardianAddr string `bson:"guardianAddr"`
|
|
|
|
Signature []byte `bson:"signature"`
|
|
|
|
UpdatedAt *time.Time `bson:"updatedAt"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func indexedAt(t time.Time) IndexingTimestamps {
|
|
|
|
return IndexingTimestamps{
|
|
|
|
IndexedAt: t,
|
|
|
|
}
|
|
|
|
}
|