From 7d6f2cda241b5f2519cc1101846ea0074931646f Mon Sep 17 00:00:00 2001 From: erikzhang Date: Tue, 2 Jul 2019 04:16:27 +0800 Subject: [PATCH] fix --- neo.UnitTests/UT_RemoteNode.cs | 10 ++++++---- neo/Network/P2P/RemoteNode.cs | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/neo.UnitTests/UT_RemoteNode.cs b/neo.UnitTests/UT_RemoteNode.cs index 173d8edef5..abd39a4d4d 100644 --- a/neo.UnitTests/UT_RemoteNode.cs +++ b/neo.UnitTests/UT_RemoteNode.cs @@ -1,5 +1,4 @@ -using Akka.Actor; -using Akka.IO; +using Akka.IO; using Akka.TestKit.Xunit2; using FluentAssertions; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -7,8 +6,6 @@ using Neo.Network.P2P.Capabilities; using Neo.Network.P2P.Payloads; using System; -using System.Collections.Generic; -using System.Text; namespace Neo.UnitTests { @@ -19,6 +16,11 @@ public class UT_RemoteNode : TestKit private static NeoSystem testBlockchain; + public UT_RemoteNode() + : base($"remote-node-mailbox {{ mailbox-type: \"{typeof(RemoteNodeMailbox).AssemblyQualifiedName}\" }}" + + $"protocol-handler-mailbox {{ mailbox-type: \"{typeof(ProtocolHandlerMailbox).AssemblyQualifiedName}\" }}") + { + } [ClassInitialize] public static void TestSetup(TestContext ctx) diff --git a/neo/Network/P2P/RemoteNode.cs b/neo/Network/P2P/RemoteNode.cs index 872a760ba2..7700c896b2 100644 --- a/neo/Network/P2P/RemoteNode.cs +++ b/neo/Network/P2P/RemoteNode.cs @@ -36,7 +36,7 @@ public RemoteNode(NeoSystem system, object connection, IPEndPoint remote, IPEndP : base(connection, remote, local) { this.system = system; - this.protocol = system.ActorSystem.ActorOf(ProtocolHandler.Props(system)); + this.protocol = Context.ActorOf(ProtocolHandler.Props(system)); LocalNode.Singleton.RemoteNodes.TryAdd(Self, this); var capabilities = new List