From f004005b13d34944a0c5c909609bfe2b39d17a28 Mon Sep 17 00:00:00 2001 From: Erik Zhang Date: Tue, 20 Apr 2021 12:37:11 +0800 Subject: [PATCH] Rename --- src/RpcServer/RpcServer.SmartContract.cs | 2 +- src/RpcServer/RpcServer/config.json | 2 +- src/RpcServer/Settings.cs | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/RpcServer/RpcServer.SmartContract.cs b/src/RpcServer/RpcServer.SmartContract.cs index 6fe9fbd69..8af239ee8 100644 --- a/src/RpcServer/RpcServer.SmartContract.cs +++ b/src/RpcServer/RpcServer.SmartContract.cs @@ -78,7 +78,7 @@ private JObject GetInvokeResult(byte[] script, Signers signers = null) json["exception"] = GetExceptionMessage(engine.FaultException); try { - json["stack"] = new JArray(engine.ResultStack.Select(p => ToJson(p, settings.MaxResultItems))); + json["stack"] = new JArray(engine.ResultStack.Select(p => ToJson(p, settings.MaxIteratorResultItems))); } catch (InvalidOperationException) { diff --git a/src/RpcServer/RpcServer/config.json b/src/RpcServer/RpcServer/config.json index ab5650d64..0f65fdde4 100644 --- a/src/RpcServer/RpcServer/config.json +++ b/src/RpcServer/RpcServer/config.json @@ -13,7 +13,7 @@ "MaxGasInvoke": 20, "MaxFee": 0.1, "MaxConcurrentConnections": 40, - "MaxResultItems": 100, + "MaxIteratorResultItems": 100, "DisabledMethods": [ "openwallet" ] } ] diff --git a/src/RpcServer/Settings.cs b/src/RpcServer/Settings.cs index e9bab7267..803bdae0d 100644 --- a/src/RpcServer/Settings.cs +++ b/src/RpcServer/Settings.cs @@ -30,8 +30,8 @@ public record RpcServerSettings public string RpcPass { get; init; } public long MaxGasInvoke { get; init; } public long MaxFee { get; init; } + public int MaxIteratorResultItems { get; init; } public string[] DisabledMethods { get; init; } - public int MaxResultItems { get; init; } public static RpcServerSettings Default { get; } = new RpcServerSettings { @@ -42,9 +42,9 @@ public record RpcServerSettings MaxGasInvoke = (long)new BigDecimal(10M, NativeContract.GAS.Decimals).Value, MaxFee = (long)new BigDecimal(0.1M, NativeContract.GAS.Decimals).Value, TrustedAuthorities = Array.Empty(), + MaxIteratorResultItems = 100, DisabledMethods = Array.Empty(), MaxConcurrentConnections = 40, - MaxResultItems = 100, }; public static RpcServerSettings Load(IConfigurationSection section) => new RpcServerSettings @@ -59,9 +59,9 @@ public record RpcServerSettings RpcPass = section.GetSection("RpcPass").Value, MaxGasInvoke = (long)new BigDecimal(section.GetValue("MaxGasInvoke", Default.MaxGasInvoke), NativeContract.GAS.Decimals).Value, MaxFee = (long)new BigDecimal(section.GetValue("MaxFee", Default.MaxFee), NativeContract.GAS.Decimals).Value, + MaxIteratorResultItems = section.GetValue("MaxIteratorResultItems", Default.MaxIteratorResultItems), DisabledMethods = section.GetSection("DisabledMethods").GetChildren().Select(p => p.Get()).ToArray(), MaxConcurrentConnections = section.GetValue("MaxConcurrentConnections", Default.MaxConcurrentConnections), - MaxResultItems = section.GetValue("MaxResultItems", Default.MaxResultItems), }; } }