-
Couldn't load subscription status.
- Fork 1k
Isolate ApplicationEngine events #4016
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
Changes from all commits
e2541fb
057387a
d00f61e
3fc7141
5eb70c5
6f7d862
6a38a39
2144023
3bf4a80
ee182b4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,10 +62,15 @@ public override void Dispose() | |
| Blockchain.Committing -= ((ICommittingHandler)this).Blockchain_Committing_Handler; | ||
| Blockchain.Committed -= ((ICommittedHandler)this).Blockchain_Committed_Handler; | ||
| if (Settings.Default.Debug) | ||
| ApplicationEngine.Log -= ((ILogHandler)this).ApplicationEngine_Log_Handler; | ||
| ApplicationEngine.InstanceHandler -= ConfigureAppEngine; | ||
| GC.SuppressFinalize(this); | ||
| } | ||
|
|
||
| private void ConfigureAppEngine(ApplicationEngine engine) | ||
| { | ||
| engine.Log += ((ILogHandler)this).ApplicationEngine_Log_Handler; | ||
| } | ||
|
|
||
| protected override void Configure() | ||
| { | ||
| Settings.Load(GetConfiguration()); | ||
|
|
@@ -82,7 +87,7 @@ protected override void OnSystemLoaded(NeoSystem system) | |
| RpcServerPlugin.RegisterMethods(this, Settings.Default.Network); | ||
|
|
||
| if (Settings.Default.Debug) | ||
| ApplicationEngine.Log += ((ILogHandler)this).ApplicationEngine_Log_Handler; | ||
| ApplicationEngine.InstanceHandler += ConfigureAppEngine; | ||
| } | ||
|
|
||
| #endregion | ||
|
|
@@ -240,7 +245,7 @@ void ICommittedHandler.Blockchain_Committed_Handler(NeoSystem system, Block bloc | |
| _neostore.CommitBlockLog(); | ||
| } | ||
|
|
||
| void ILogHandler.ApplicationEngine_Log_Handler(object sender, LogEventArgs e) | ||
| void ILogHandler.ApplicationEngine_Log_Handler(ApplicationEngine sender, LogEventArgs e) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You know you can use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is not the provider, is the instance |
||
| { | ||
| if (Settings.Default.Debug == false) | ||
| return; | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -368,10 +368,10 @@ public void TestRuntime_Log() | |||||
| { | ||||||
| var engine = GetEngine(true); | ||||||
| var message = "hello"; | ||||||
| ApplicationEngine.Log += LogEvent; | ||||||
| engine.Log += LogEvent; | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| engine.RuntimeLog(Encoding.UTF8.GetBytes(message)); | ||||||
| Assert.AreEqual(new byte[] { 0x01, 0x02, 0x03 }.ToHexString(), ((Transaction)engine.ScriptContainer).Script.Span.ToHexString()); | ||||||
| ApplicationEngine.Log -= LogEvent; | ||||||
| engine.Log -= LogEvent; | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| } | ||||||
|
|
||||||
| [TestMethod] | ||||||
|
|
||||||
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.
IApplicationEngineProvideris better?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.
Is not the provider, is the instance