aptos/watcher: Update comments and errors
This commit is contained in:
parent
1a7098553c
commit
2a31454d29
|
@ -434,6 +434,7 @@ func runNode(cmd *cobra.Command, args []string) {
|
||||||
readiness.RegisterComponent(common.ReadinessKlaytnSyncing)
|
readiness.RegisterComponent(common.ReadinessKlaytnSyncing)
|
||||||
readiness.RegisterComponent(common.ReadinessCeloSyncing)
|
readiness.RegisterComponent(common.ReadinessCeloSyncing)
|
||||||
readiness.RegisterComponent(common.ReadinessMoonbeamSyncing)
|
readiness.RegisterComponent(common.ReadinessMoonbeamSyncing)
|
||||||
|
readiness.RegisterComponent(common.ReadinessAptosSyncing)
|
||||||
|
|
||||||
if *testnetMode {
|
if *testnetMode {
|
||||||
readiness.RegisterComponent(common.ReadinessEthRopstenSyncing)
|
readiness.RegisterComponent(common.ReadinessEthRopstenSyncing)
|
||||||
|
@ -592,14 +593,12 @@ func runNode(cmd *cobra.Command, args []string) {
|
||||||
logger.Fatal("If --xplaWS is not specified, then --xplaLCD and --xplaContract must not be specified")
|
logger.Fatal("If --xplaWS is not specified, then --xplaLCD and --xplaContract must not be specified")
|
||||||
}
|
}
|
||||||
|
|
||||||
if *unsafeDevMode {
|
if *aptosRPC != "" {
|
||||||
if *aptosRPC != "" {
|
if *aptosAccount == "" {
|
||||||
if *aptosAccount == "" {
|
logger.Fatal("If --aptosRPC is specified, then --aptosAccount must be specified")
|
||||||
logger.Fatal("If --aptosRPC is specified, then --aptosAccount must be specified")
|
}
|
||||||
}
|
if *aptosHandle == "" {
|
||||||
if *aptosHandle == "" {
|
logger.Fatal("If --aptosRPC is specified, then --aptosHandle must be specified")
|
||||||
logger.Fatal("If --aptosRPC is specified, then --aptosHandle must be specified")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,7 @@ func (e *Watcher) retrievePayload(s string) ([]byte, error) {
|
||||||
func (e *Watcher) observeData(logger *zap.Logger, data gjson.Result, native_seq uint64) {
|
func (e *Watcher) observeData(logger *zap.Logger, data gjson.Result, native_seq uint64) {
|
||||||
em := data.Get("sender")
|
em := data.Get("sender")
|
||||||
if !em.Exists() {
|
if !em.Exists() {
|
||||||
logger.Info("sender")
|
logger.Error("sender field missing")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,37 +96,37 @@ func (e *Watcher) observeData(logger *zap.Logger, data gjson.Result, native_seq
|
||||||
|
|
||||||
v := data.Get("payload")
|
v := data.Get("payload")
|
||||||
if !v.Exists() {
|
if !v.Exists() {
|
||||||
logger.Info("payload")
|
logger.Error("payload field missing")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
pl, err := hex.DecodeString(v.String()[2:])
|
pl, err := hex.DecodeString(v.String()[2:])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Info("payload decode")
|
logger.Error("payload decode")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
ts := data.Get("timestamp")
|
ts := data.Get("timestamp")
|
||||||
if !ts.Exists() {
|
if !ts.Exists() {
|
||||||
logger.Info("timestamp")
|
logger.Error("timestamp field missing")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
nonce := data.Get("nonce")
|
nonce := data.Get("nonce")
|
||||||
if !nonce.Exists() {
|
if !nonce.Exists() {
|
||||||
logger.Info("nonce")
|
logger.Error("nonce field missing")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
sequence := data.Get("sequence")
|
sequence := data.Get("sequence")
|
||||||
if !sequence.Exists() {
|
if !sequence.Exists() {
|
||||||
logger.Info("sequence")
|
logger.Error("sequence field missing")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
consistency_level := data.Get("consistency_level")
|
consistency_level := data.Get("consistency_level")
|
||||||
if !consistency_level.Exists() {
|
if !consistency_level.Exists() {
|
||||||
logger.Info("consistency_level")
|
logger.Error("consistency_level field missing")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue