Example #1
0
        static void _parseCall(int height, string txid, string script, JArray notify)
        {
            foreach (JObject n in notify)
            {
                var contract = (string)n["contract"];

                //过滤 事件太多,只监视关注的合约
                if (watchContract.Contains(contract) == false)
                {
                    continue;
                }

                var      value = n["state"] as JObject;
                CallItem item  = new CallItem();
                item.block        = height;
                item.txid         = txid;
                item.callcontract = contract;
                item.value        = value;
                var firstv = ((value["value"] as JArray)[0] as JObject);
                var ftype  = (string)firstv["type"];
                var fvalue = (string)firstv["value"];
                //if (ftype == "String")
                //    item.name = fvalue;
                //else if (ftype == "ByteArray")
                //    item.name = HexStr2String(fvalue);
                //else
                //    throw new Exception("error type");
                //no name here.
                callitem.Enqueue(item);
            }
        }
Example #2
0
        public static CallItem PickCall()
        {
            CallItem outi = null;

            callitem.TryDequeue(out outi);
            return(outi);
        }