Skip to content

Commit

Permalink
Speed up multisig ut (#908)
Browse files Browse the repository at this point in the history
* Speedup multisign ut

* Start tasks
  • Loading branch information
shargon authored Jul 11, 2019
1 parent 1d949c8 commit 7e36bf8
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions neo.UnitTests/UT_Transaction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using Neo.VM;
using Neo.Wallets;
using Neo.Wallets.NEP6;
using System.Threading.Tasks;

namespace Neo.UnitTests
{
Expand Down Expand Up @@ -104,8 +105,14 @@ public void FeeIsMultiSigContract()
using (var unlockA = walletA.Unlock("123"))
using (var unlockB = walletB.Unlock("123"))
{
var a = walletA.CreateAccount();
var b = walletB.CreateAccount();
var ta = new Task<WalletAccount>(() => walletA.CreateAccount());
var tb = new Task<WalletAccount>(() => walletA.CreateAccount());
ta.Start();
tb.Start();
Task.WaitAll(ta, tb);

var a = ta.Result;
var b = tb.Result;

var multiSignContract = Contract.CreateMultiSigContract(2,
new ECPoint[]
Expand All @@ -114,8 +121,13 @@ public void FeeIsMultiSigContract()
b.GetKey().PublicKey
});

var acc = walletA.CreateAccount(multiSignContract, a.GetKey());
acc = walletB.CreateAccount(multiSignContract, b.GetKey());
ta = new Task<WalletAccount>(() => walletA.CreateAccount(multiSignContract, a.GetKey()));
tb = new Task<WalletAccount>(() => walletB.CreateAccount(multiSignContract, b.GetKey()));
ta.Start();
tb.Start();
Task.WaitAll(ta, tb);

var acc = tb.Result;

// Fake balance

Expand Down

0 comments on commit 7e36bf8

Please sign in to comment.