From 2a31454d29cb63dd645c3f7edb9897ef8653ce5a Mon Sep 17 00:00:00 2001 From: Josh Siegel Date: Fri, 14 Oct 2022 15:34:24 +0000 Subject: [PATCH] aptos/watcher: Update comments and errors --- node/cmd/guardiand/node.go | 15 +++++++-------- node/pkg/watchers/aptos/watcher.go | 14 +++++++------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/node/cmd/guardiand/node.go b/node/cmd/guardiand/node.go index 2c9aaad39..abc8cf659 100644 --- a/node/cmd/guardiand/node.go +++ b/node/cmd/guardiand/node.go @@ -434,6 +434,7 @@ func runNode(cmd *cobra.Command, args []string) { readiness.RegisterComponent(common.ReadinessKlaytnSyncing) readiness.RegisterComponent(common.ReadinessCeloSyncing) readiness.RegisterComponent(common.ReadinessMoonbeamSyncing) + readiness.RegisterComponent(common.ReadinessAptosSyncing) if *testnetMode { 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") } - if *unsafeDevMode { - if *aptosRPC != "" { - if *aptosAccount == "" { - logger.Fatal("If --aptosRPC is specified, then --aptosAccount must be specified") - } - if *aptosHandle == "" { - logger.Fatal("If --aptosRPC is specified, then --aptosHandle must be specified") - } + if *aptosRPC != "" { + if *aptosAccount == "" { + logger.Fatal("If --aptosRPC is specified, then --aptosAccount must be specified") + } + if *aptosHandle == "" { + logger.Fatal("If --aptosRPC is specified, then --aptosHandle must be specified") } } diff --git a/node/pkg/watchers/aptos/watcher.go b/node/pkg/watchers/aptos/watcher.go index cb12835ab..551fe638e 100644 --- a/node/pkg/watchers/aptos/watcher.go +++ b/node/pkg/watchers/aptos/watcher.go @@ -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) { em := data.Get("sender") if !em.Exists() { - logger.Info("sender") + logger.Error("sender field missing") return } @@ -96,37 +96,37 @@ func (e *Watcher) observeData(logger *zap.Logger, data gjson.Result, native_seq v := data.Get("payload") if !v.Exists() { - logger.Info("payload") + logger.Error("payload field missing") return } pl, err := hex.DecodeString(v.String()[2:]) if err != nil { - logger.Info("payload decode") + logger.Error("payload decode") return } ts := data.Get("timestamp") if !ts.Exists() { - logger.Info("timestamp") + logger.Error("timestamp field missing") return } nonce := data.Get("nonce") if !nonce.Exists() { - logger.Info("nonce") + logger.Error("nonce field missing") return } sequence := data.Get("sequence") if !sequence.Exists() { - logger.Info("sequence") + logger.Error("sequence field missing") return } consistency_level := data.Get("consistency_level") if !consistency_level.Exists() { - logger.Info("consistency_level") + logger.Error("consistency_level field missing") return }