public static string Key(this FilterLog log)
        {
            if (log.TransactionHash == null || log.LogIndex == null)
            {
                return(log.GetHashCode().ToString());
            }

            return($"{log.TransactionHash}{log.LogIndex.HexValue}");
        }
Example #2
0
        public void FilterLog_Key_Generates_Expected_Value()
        {
            var populatedLog = new FilterLog {
                TransactionHash = "x", LogIndex = new HexBigInteger(0)
            };
            var emptyLog = new FilterLog();

            Assert.Equal("x0x0", populatedLog.Key());
            Assert.Equal(emptyLog.GetHashCode().ToString(), emptyLog.Key());
        }