예제 #1
0
        private bool TryDecode(EventABI[] abis, FilterLog log, out DecodedEvent decodedEvent)
        {
            decodedEvent = null;

            if (abis == null || abis.Length == 0)
            {
                decodedEvent = log.ToDecodedEvent();
                return(true);
            }

            var abi = abis.FirstOrDefault(a => log.IsLogForEvent(a.Sha3Signature));

            if (abi is null)
            {
                return(false);
            }

            try
            {
                decodedEvent = log.ToDecodedEvent(abi);
                return(true);
            }
            catch (Exception x) when(x.IsEventDecodingIndexMisMatch())
            {
                return(false);
            }
        }
예제 #2
0
 public bool IsLogForEvent(FilterLog log)
 {
     return(log.IsLogForEvent <TEvent>());
 }
 public virtual bool IsLogForEvent(FilterLog log) => log.IsLogForEvent <TEventDto>();