示例#1
0
        public void TestListContainer()
        {
            using var client = new Client.Client(key, host);
            using var source = new CancellationTokenSource();
            source.CancelAfter(10000);
            var cids = client.ListContainers(OwnerID.FromScriptHash(key.PublicKey().PublicKeyToScriptHash()), context: source.Token).Result;

            Console.WriteLine(string.Join(", ", cids.Select(p => p.String())));
            Assert.AreEqual(1, cids.Count);
            Assert.AreEqual(cid.String(), cids[0].String());
        }
        public void TestListContainer()
        {
            var host   = "localhost:8080";
            var key    = "KxDgvEKzgSBPPfuVfw67oPQBSjidEiqTHURKSDL1R7yGaGYAeYnr".LoadWif();
            var client = new Client.Client(key, host);
            var source = new CancellationTokenSource();

            source.CancelAfter(10000);
            var cids = client.ListContainers(source.Token, key.ToOwnerID());

            Assert.AreEqual(1, cids.Count);
            Assert.AreEqual("Bun3sfMBpnjKc3Tx7SdwrMxyNi8ha8JT3dhuFGvYBRTz", cids[0].ToBase58String());
        }