Exemplo n.º 1
0
        private EventABI GetNethEventABI(IAbiEventDefinition definition)
        {
            EventABI eventABI = new EventABI(definition.Name, definition.Anonymous);

            eventABI.InputParameters = AbiEventBuilder.GetNethParameters(definition.inputs);
            return(eventABI);
        }
Exemplo n.º 2
0
        public AbiEventTopic[] DecodeTopics(byte[][] topics, byte[] data)
        {
            List <AbiEventTopic> result       = new List <AbiEventTopic>();
            EventABI             nethEventAbi = new EventABI(this._definition.Name, this._definition.Anonymous);

            nethEventAbi.InputParameters = AbiEventBuilder.GetNethParameters(this._definition.inputs);
            List <string> topicsStr = new List <string>();

            foreach (byte[] topic in topics)
            {
                topicsStr.Add(topic.ToHexString());
            }
            List <ParameterOutput> nethTopics = (new EventTopicDecoder(this._definition.Anonymous)).DecodeDefaultTopics(nethEventAbi, topicsStr.ToArray(), data.ToHexString());

            foreach (ParameterOutput output in nethTopics.OrderBy(item => item.Parameter.Order))
            {
                IAbiEventInputDefinition definition = this._definition.inputs.Where(item => item.Name.Equals(output.Parameter.Name)).First();
                result.Add(new AbiEventTopic(definition, output.Result));
            }

            return(result.ToArray());
        }