Skip to content

Commit

Permalink
Merge branch 'development' into feature/rider-rule-setting
Browse files Browse the repository at this point in the history
  • Loading branch information
eugene-doobu authored Oct 21, 2024
2 parents 8c1fa07 + f6382bf commit 69dda16
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 32 deletions.
18 changes: 17 additions & 1 deletion Lib9c.MessagePack/Formatters/ExceptionFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
6 changes: 3 additions & 3 deletions Lib9c.MessagePack/Lib9c.MessagePack.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MessagePack" Version="2.3.85" />
<PackageReference Include="MessagePack.Annotations" Version="2.3.85" />
<PackageReference Include="MessagePackAnalyzer" Version="2.3.85">
<PackageReference Include="MessagePack" Version="2.5.187" />
<PackageReference Include="MessagePack.Annotations" Version="2.5.187" />
<PackageReference Include="MessagePackAnalyzer" Version="2.5.187">
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
28 changes: 0 additions & 28 deletions Lib9c/Action/ActionBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand Down Expand Up @@ -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();
}
}
}
}

0 comments on commit 69dda16

Please sign in to comment.