コード例 #1
0
        public IRlpItem EncodeToRlp(dynamic obj)
        {
            if (obj == null && this.Nullable)
            {
                return(new RlpItem());
            }

            Boolean value    = false;
            bool    canParse = Boolean.TryParse(obj.ToString(), out value);

            if (canParse)
            {
                return(value.EncodeToRlpItem());
            }
            else
            {
                throw new ArgumentException("value type invalid");
            }
        }