From 872e30a0bf81b29447c878d9a551c8db26865554 Mon Sep 17 00:00:00 2001 From: umardevX Date: Thu, 17 Oct 2024 21:01:47 +0500 Subject: [PATCH 1/2] Cleaning Up Code Of ActionBase --- Lib9c/Action/ActionBase.cs | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/Lib9c/Action/ActionBase.cs b/Lib9c/Action/ActionBase.cs index 49bc052a32..9b21310330 100644 --- a/Lib9c/Action/ActionBase.cs +++ b/Lib9c/Action/ActionBase.cs @@ -19,9 +19,6 @@ namespace Nekoyume.Action [Serializable] public abstract class ActionBase : IAction { - // FIXME GoldCurrencyState 에 정의된 것과 다른데 괜찮을지 점검해봐야 합니다. - protected static readonly Currency GoldCurrencyMock = new Currency(); - public abstract IValue PlainValue { get; } public abstract void LoadPlainValue(IValue plainValue); public abstract IWorld Execute(IActionContext context); @@ -45,18 +42,6 @@ protected string GetSignerAndOtherAddressesHex(IActionContext ctx, params Addres return sb.ToString(); } - protected IWorld LogError(IActionContext context, string message, params object[] values) - { - string actionType = GetType().Name; - object[] prependedValues = new object[values.Length + 2]; - prependedValues[0] = context.BlockIndex; - prependedValues[1] = context.Signer; - values.CopyTo(prependedValues, 2); - string msg = $"#{{BlockIndex}} {actionType} (by {{Signer}}): {message}"; - Log.Error(msg, prependedValues); - return context.PreviousState; - } - protected bool TryGetAdminState(IActionContext ctx, out AdminState state) { state = default; @@ -97,18 +82,5 @@ protected void CheckObsolete(long obsoleteIndex, IActionContext ctx) throw new ActionObsoletedException(); } } - - protected bool UseV100291Sheets(long blockIndex) - { - return blockIndex < ActionObsoleteConfig.V100301ExecutedBlockIndex; - } - - protected void CheckActionAvailable(long startedIndex, IActionContext ctx) - { - if (ctx.BlockIndex <= startedIndex) - { - throw new ActionUnavailableException(); - } - } } } From 50146892b9e81cf981e353487e1c75d7d5344504 Mon Sep 17 00:00:00 2001 From: eugene-hong <58686228+eugene-doobu@users.noreply.github.com> Date: Mon, 21 Oct 2024 15:43:55 +0900 Subject: [PATCH 2/2] update message pack to 2.5.187 --- .../Formatters/ExceptionFormatter.cs | 18 +++++++++++++++++- Lib9c.MessagePack/Lib9c.MessagePack.csproj | 6 +++--- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/Lib9c.MessagePack/Formatters/ExceptionFormatter.cs b/Lib9c.MessagePack/Formatters/ExceptionFormatter.cs index 481f1f7fb5..5cedaef121 100644 --- a/Lib9c.MessagePack/Formatters/ExceptionFormatter.cs +++ b/Lib9c.MessagePack/Formatters/ExceptionFormatter.cs @@ -55,13 +55,29 @@ public void Serialize(ref MessagePackWriter writer, T? value, for (int i = 0; i < count; i++) { var name = reader.ReadString(); + if (name == null) + { + throw new MessagePackSerializationException("Exception Name is missing."); + } + if (name == "ExceptionType") { typeName = reader.ReadString(); } else { - var type = Type.GetType(reader.ReadString()); + var readType = reader.ReadString(); + if (readType == null) + { + throw new MessagePackSerializationException("Exception type information is missing."); + } + + var type = Type.GetType(readType); + if (type == null) + { + throw new MessagePackSerializationException("Exception type information is missing."); + } + var value = MessagePackSerializer.Deserialize(type, ref reader, options); info.AddValue(name, value); } diff --git a/Lib9c.MessagePack/Lib9c.MessagePack.csproj b/Lib9c.MessagePack/Lib9c.MessagePack.csproj index de51061462..6b5a8ee0e3 100644 --- a/Lib9c.MessagePack/Lib9c.MessagePack.csproj +++ b/Lib9c.MessagePack/Lib9c.MessagePack.csproj @@ -12,9 +12,9 @@ - - - + + + runtime; build; native; contentfiles; analyzers all