-
Notifications
You must be signed in to change notification settings - Fork 451
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
t8n input processing #7690
t8n input processing #7690
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix inner exception handling
use is null
and is not null
|
||
public class T8NException : Exception, IExceptionWithExitCode | ||
{ | ||
public T8NException(Exception e, int exitCode) : base(e.Message) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
public static class T8NInputProcessor | ||
{ | ||
private static readonly TxDecoder TxDecoder = TxDecoder.Instance; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can now potentially register transaction types (including RLP and JSON parsing) from plugins. I expect this won't be able to generate tests around those injected tx types. Maybe worth to consider adding plugins support.
} | ||
catch (NotSupportedException e) | ||
{ | ||
throw new T8NException(e, T8NErrorCodes.ErrorConfig); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
throw new T8NException(e, T8NErrorCodes.ErrorConfig); | |
throw new T8NException("Failed to parse spec", T8NErrorCodes.ErrorConfig, e); |
tools/Evm/Evm/t8n/T8NInputReader.cs
Outdated
catch (FileNotFoundException) | ||
{ | ||
throw new T8NException("failed reading {filePath} file: {description}", T8NErrorCodes.ErrorIO); | ||
} | ||
catch (JsonException) | ||
{ | ||
throw new T8NException($"failed unmarshalling {filePath} file: {description}", T8NErrorCodes.ErrorJson); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pass exceptions down
|
||
namespace Evm.t8n.JsonTypes; | ||
|
||
public class TransactionJson |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this differ substantially from TransactionForRPC
or maybe it can be reused here?
Types of changes
What types of changes does your code introduce?
Testing
Requires testing
If yes, did you write tests?
Notes on testing
Optional. Remove if not applicable.
Documentation
Requires documentation update
If yes, link the PR to the docs update or the issue with the details labeled
docs
. Remove if not applicable.Requires explanation in Release Notes
If yes, fill in the details here. Remove if not applicable.
Remarks
Optional. Remove if not applicable.