Пример #1
0
        public void MessageReceived(string transid)
        {
            if (this.Clients.SelectedItem != null)
            {
                berichtenontvangen += 1;
                var permissie = chain.Subscribe(Program.streamname);
                var mystream  = chain.GetStreamItem(Program.streamname, transid);
                this.enc.Text = mystream.data;

                var data        = this.chain.HexStringToBytes(mystream.data);
                var data2string = Encoding.Default.GetString(data);

                this.dec.Text        = data2string;
                aantalberichten.Text = this.berichtenontvangen.ToString();
            }
        }
Пример #2
0
        private void button11_Click(object sender, EventArgs e)
        {
            mystream = chain.GetStreamItem("pinjo", transactionId);

            this.publisher.Text = mystream.publishers.First();
            this.confirmed.Text = mystream.confirmations.ToString();

            this.key.Text       = mystream.key;
            this.txid.Text      = mystream.txid;
            this.blocktime.Text = mystream.blocktime.ToString();
            this.data.Text      = mystream.data;

            var data        = this.chain.HexStringToBytes(mystream.data);
            var data2string = Encoding.Default.GetString(data);

            this.datatrans.Text = data2string;
        }
Пример #3
0
        public void TestMultiChainGetStreamItem()
        {
            // Setup
            var processWrapper = new ProcessWrapper {
                Mock = true, ReplyMessage = "{ \"publishers\": [\"Test01\"], \"key\": \"Test02\", \"data\": \"Test03\", \"confirmations\": 1, \"blocktime\": 2, \"txid\": \"Test04\" }"
            };
            var chain = new MultiChain(null, processWrapper);

            // Test
            var item = chain.GetStreamItem("Test01", "12345");

            // Check
            Assert.AreEqual(1, item.publishers.Length);
            Assert.AreEqual("Test01", item.publishers[0]);
            Assert.AreEqual("Test02", item.key);
            Assert.AreEqual("Test03", item.data);
            Assert.AreEqual(1, item.confirmations);
            Assert.AreEqual(2, item.blocktime);
            Assert.AreEqual("Test04", item.txid);
            Assert.AreEqual("/c D:\\Development\\Eigenbouw\\bc\\MultiChain\\multichain-cli.exe testchain getstreamitem Test01 12345", processWrapper.ProcessInfo.Arguments);
        }