Skip to content

Commit

Permalink
Merge pull request #2910 from umardevX/development
Browse files Browse the repository at this point in the history
Cleaning Up Code Of ActionBase
  • Loading branch information
moreal authored Oct 18, 2024
2 parents 8f11988 + 872e30a commit 6fa652b
Showing 1 changed file with 0 additions and 28 deletions.
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 6fa652b

Please sign in to comment.