Created
May 8, 2020 21:51
-
-
Save movitto/87ecf95d9f00803ea8f87f0edf611939 to your computer and use it in GitHub Desktop.
xrp1ntel - TXs By Result: Critical Results Patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/wipple/metrics/txs_by_result.rb b/lib/wipple/metrics/txs_by_result.rb | |
index 10c5f7c..5badc0d 100644 | |
--- a/lib/wipple/metrics/txs_by_result.rb | |
+++ b/lib/wipple/metrics/txs_by_result.rb | |
@@ -3,6 +3,8 @@ module Wipple | |
class TxsByResult | |
include BaseMetric | |
+ CRITICAL_RESULTS = ['tecINVARIANT_FAILED'] | |
+ | |
def initialize(report) | |
@report = report | |
end | |
@@ -20,6 +22,15 @@ module Wipple | |
end | |
def tweet | |
+ critical = CRITICAL_RESULTS & results | |
+ unless critical.empty? | |
+ critical.collect! { |c| | |
+ "#{c}: #{by_result[c]}" | |
+ } | |
+ return = "WARNING - Critical XRP Result Detected: "\ | |
+ "#{critical.join(", ")}" | |
+ end | |
+ | |
result = (results - ['tesSUCCESS']).sample | |
"#{by_result[result]} XRPL transactions resulted in #{result} "\ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment