This commit is contained in:
Fernando Torres 2024-04-24 16:51:20 -03:00
parent 01afaab67b
commit 9873e2aadf
No known key found for this signature in database
GPG Key ID: 962617117C40D42A
6 changed files with 10 additions and 4 deletions

View File

@ -49,7 +49,8 @@ func (p *Publisher) Publish(ctx context.Context, e *watcher.Event) {
TxHash: e.TxHash, TxHash: e.TxHash,
Version: e.Version, Version: e.Version,
Revision: e.Revision, Revision: e.Revision,
Hash: e.Hash, Digest: e.Digest,
Overwrite: e.DuplicatedFixed,
} }
// In some scenarios the fly component that inserts the VAA documents does not have the txhash field available, // In some scenarios the fly component that inserts the VAA documents does not have the txhash field available,

View File

@ -19,7 +19,8 @@ type Event struct {
TxHash string `json:"txHash"` TxHash string `json:"txHash"`
Version uint16 `json:"version"` Version uint16 `json:"version"`
Revision uint16 `json:"revision"` Revision uint16 `json:"revision"`
Hash []byte `json:"hash"` Digest string `json:"digest"`
Overwrite bool `json:"overwrite"`
} }
// PushFunc is a function to push VAAEvent. // PushFunc is a function to push VAAEvent.

View File

@ -50,8 +50,9 @@ type Event struct {
TxHash string `bson:"txHash"` TxHash string `bson:"txHash"`
Version uint16 `bson:"version"` Version uint16 `bson:"version"`
Revision uint16 `bson:"revision"` Revision uint16 `bson:"revision"`
Hash []byte `bson:"hash"` Digest string `bson:"digest"`
IsDuplicated bool `bson:"isDuplicated"` IsDuplicated bool `bson:"isDuplicated"`
DuplicatedFixed bool `bson:"duplicatedFixed"`
} }
const queryTemplate = ` const queryTemplate = `

View File

@ -114,7 +114,7 @@ func (c *Consumer) processSourceTx(ctx context.Context, msg queue.ConsumerMessag
Vaa: event.Vaa, Vaa: event.Vaa,
IsVaaSigned: event.IsVaaSigned, IsVaaSigned: event.IsVaaSigned,
Metrics: c.metrics, Metrics: c.metrics,
Overwrite: false, // avoid processing the same transaction twice Overwrite: event.Overwrite, // avoid processing the same transaction twice
Source: event.Source, Source: event.Source,
} }
_, err := ProcessSourceTx(ctx, c.logger, c.rpcpool, c.wormchainRpcPool, c.repository, &p, c.p2pNetwork) _, err := ProcessSourceTx(ctx, c.logger, c.rpcpool, c.wormchainRpcPool, c.repository, &p, c.p2pNetwork)

View File

@ -25,6 +25,7 @@ type VaaEvent struct {
TxHash string `json:"txHash"` TxHash string `json:"txHash"`
Version uint16 `json:"version"` Version uint16 `json:"version"`
Revision uint16 `json:"revision"` Revision uint16 `json:"revision"`
Overwrite bool `json:"overwrite"`
} }
// VaaConverter converts a message from a VAAEvent. // VaaConverter converts a message from a VAAEvent.
@ -49,6 +50,7 @@ func NewVaaConverter(log *zap.Logger) ConverterFunc {
Vaa: vaaEvent.Vaa, Vaa: vaaEvent.Vaa,
IsVaaSigned: true, IsVaaSigned: true,
TxHash: vaaEvent.TxHash, TxHash: vaaEvent.TxHash,
Overwrite: vaaEvent.Overwrite,
}, nil }, nil
} }
} }

View File

@ -51,6 +51,7 @@ type Event struct {
Vaa []byte Vaa []byte
IsVaaSigned bool IsVaaSigned bool
Attributes any Attributes any
Overwrite bool
} }
func GetAttributes[T EventAttributes](e *Event) (T, bool) { func GetAttributes[T EventAttributes](e *Event) (T, bool) {