Skip to content

Commit

Permalink
TestWallet is mocked
Browse files Browse the repository at this point in the history
  • Loading branch information
vncoelho committed Aug 28, 2024
1 parent dc3db66 commit 48641f9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions tests/Neo.Plugins.DBFTPlugin.Tests/UT_ConsensusService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
using System.Net;
using System.Numerics;
using System.Text;
using Neo.Plugins.DBFTPlugin.Consensus;
using Neo.UnitTests;

namespace Neo.Plugins.DBFTPlugin.Tests
{
Expand Down Expand Up @@ -75,6 +77,9 @@ public void ConsensusService_SingleNodeActors_OnStart_PrepReq_PrepResponses_Comm

var mockNeoSystem = new Mock<TestNeoSystem>();
var mockWallet = new Mock<Wallet>();
mockWallet.Setup(p => p.GetAccount(It.IsAny<UInt160>())).Returns<UInt160>(p => new TestWalletAccount(p));
Console.WriteLine($"\n(UT-Consensus) Wallet is: {mockWallet.Object.GetAccount(UInt160.Zero).GetKey().PublicKey}");

var mockContext = new Mock<ConsensusContext>(mockNeoSystem.Object, mockWallet.Object, ProtocolSettings.Default);
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Neo.UnitTests/TestWalletAccount.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

namespace Neo.UnitTests
{
class TestWalletAccount : WalletAccount
public class TestWalletAccount : WalletAccount
{
private static readonly KeyPair key;

Expand Down

0 comments on commit 48641f9

Please sign in to comment.