Ejemplo n.º 1
0
 public static RpcApplicationLog FromJson(JObject json)
 {
     return(new RpcApplicationLog
     {
         TxId = json["txid"] is null ? null : UInt256.Parse(json["txid"].AsString()),
         Trigger = json["trigger"].TryGetEnum <TriggerType>(),
         VMState = json["vmstate"].TryGetEnum <VMState>(),
         GasConsumed = long.Parse(json["gasconsumed"].AsString()),
         Stack = ((JArray)json["stack"]).Select(p => Utility.StackItemFromJson(p)).ToList(),
         Notifications = ((JArray)json["notifications"]).Select(p => RpcNotifyEventArgs.FromJson(p)).ToList()
     });
Ejemplo n.º 2
0
        public static RpcApplicationLog FromJson(JObject json)
        {
            RpcApplicationLog log = new RpcApplicationLog();

            log.TxId          = json["txid"] is null ? null : UInt256.Parse(json["txid"].AsString());
            log.Trigger       = json["trigger"].TryGetEnum <TriggerType>();
            log.VMState       = json["vmstate"].TryGetEnum <VMState>();
            log.GasConsumed   = long.Parse(json["gas_consumed"].AsString());
            log.Stack         = ((JArray)json["stack"]).Select(p => ContractParameter.FromJson(p)).ToList();
            log.Notifications = ((JArray)json["notifications"]).Select(p => RpcNotifyEventArgs.FromJson(p)).ToList();
            return(log);
        }