-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Action exceptions should be recorded as a part of blockchain #860
Comments
@ipdae Any ideas? |
In my opinion, it would be nice to be able to retrieve the exception that occurs when executing the action in the game through an interface such as |
so there are several options if we want to allow to access generated exception to users.
The former is more natural to me. Is there any idea? @planetarium/libplanet @ipdae |
How about adding a new distinct method to public interface IAction
{
IAccountStateDelta Execute(IActionContext context);
void Render(IActionContext context, IAccountStateDelta nextStates);
void Unrender(IActionContext context, IAccountStateDelta nextStates);
void RenderError(IActionContext context, Exception exception); // 🆕
void UnrenderError(IActionContext context, Exception exception); // 🆕
IValue PlainValue { get; }
void LoadPlainValue(IValue plainValue);
} |
|
It seems resolved by #875 |
Due to the limitation of the current
IAction
API, validation logic tends to be duplicated (one in theExecute()
method and other one in the game UI code). If exceptions raised by actions are recorded as a part of blockchain, such duplicated validation code in the game UI side can be replaced by reusing the result/error code of an action.The text was updated successfully, but these errors were encountered: