public static RpcInvokeResult FromJson(JObject json) { RpcInvokeResult invokeScriptResult = new RpcInvokeResult(); invokeScriptResult.Script = json["script"].AsString(); invokeScriptResult.State = json["state"].AsString(); invokeScriptResult.GasConsumed = json["gas_consumed"].AsString(); invokeScriptResult.Stack = ((JArray)json["stack"]).Select(p => ContractParameter.FromJson(p)).ToArray(); return(invokeScriptResult); }
public static RpcInvokeResult FromJson(JObject json) { RpcInvokeResult invokeScriptResult = new RpcInvokeResult(); invokeScriptResult.Script = json["script"].AsString(); invokeScriptResult.State = json["state"].TryGetEnum <VM.VMState>(); invokeScriptResult.GasConsumed = json["gasconsumed"].AsString(); try { invokeScriptResult.Stack = ((JArray)json["stack"]).Select(p => ContractParameter.FromJson(p)).ToArray(); } catch { } invokeScriptResult.Tx = json["tx"]?.AsString(); return(invokeScriptResult); }
public static RpcInvokeResult FromJson(JObject json) { RpcInvokeResult invokeScriptResult = new RpcInvokeResult { Script = json["script"].AsString(), State = json["state"].TryGetEnum <VM.VMState>(), GasConsumed = json["gasconsumed"].AsString() }; if (json.ContainsProperty("exception")) { invokeScriptResult.Exception = json["exception"]?.AsString(); } try { invokeScriptResult.Stack = ((JArray)json["stack"]).Select(p => Utility.StackItemFromJson(p)).ToArray(); } catch { } invokeScriptResult.Tx = json["tx"]?.AsString(); return(invokeScriptResult); }