private async Task <IWalletAddress> CreateMultisig(string clientPubKey, string exchangePubKey) { var scriptPubKey = MultisigHelper.GenerateMultisigRedeemScript(clientPubKey, exchangePubKey); return(await _walletAddressRepository.Create(scriptPubKey.GetScriptAddress(_connectionParams.Network).ToString(), clientPubKey, exchangePubKey, scriptPubKey.ToString())); }
//[TestCase(11, 20)] public async Task MultisigKeyCombination(int m, int n) { //Arrange int expectedEncryptedBoxesCount = MultisigHelper.GetExpectedKeyCombinationsCount(m, n); var multisigComposer = MultisigHelper.GetNewMultisigComposer(m, n); //Act var boxes = await multisigComposer.GetKeyBoxesAsync(t => { for (int j = 0; j < m; j++) { Console.Write(t[j] + " "); } Console.WriteLine(""); }); var boxesValues = boxes.Select(b => b.ToString()); var boxesAsString = string.Join("; ", boxesValues); //Assert Assert.AreEqual(expectedEncryptedBoxesCount, boxes.Count()); Assert.IsTrue(boxesValues.All(v => v.Length == m), "some values have wrong lenght"); Assert.DoesNotThrow(() => new HashSet <string>(boxesValues)); Assert.Pass("passed: {0}", boxesAsString); }