Esempio n. 1
0
        public static void Decode <TItem>(AbiTypeInfo solidityType, ref AbiDecodeBuffer buff, out TItem val)
        {
            var encoder = EncoderFactory.LoadEncoder(solidityType);

            encoder.SetTypeInfo(solidityType);
            encoder.DecodeObject(ref buff, out var objectVal);
            val = (TItem)objectVal;
        }
Esempio n. 2
0
        public static DecodeDelegate <TItem> GetDecoder <TItem>(AbiTypeInfo solidityType)
        {
            var encoder = EncoderFactory.LoadEncoder(solidityType);

            encoder.SetTypeInfo(solidityType);

            void Decode(AbiTypeInfo st, ref AbiDecodeBuffer buff, out TItem val)
            {
                encoder.DecodeObject(ref buff, out var objectVal);
                val = (TItem)objectVal;
            }

            return(Decode);
        }