Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@movitto
Created May 8, 2020 21:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save movitto/87ecf95d9f00803ea8f87f0edf611939 to your computer and use it in GitHub Desktop.
Save movitto/87ecf95d9f00803ea8f87f0edf611939 to your computer and use it in GitHub Desktop.
xrp1ntel - TXs By Result: Critical Results Patch
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