示例#1
0
        private void button14_Click(object sender, EventArgs e)
        {
            byte[] ba        = Encoding.Default.GetBytes(this.message.Text);
            var    hexString = BitConverter.ToString(ba).Replace("-", string.Empty).Replace(" ", string.Empty);

            //transactionId = chain.PublishMessage(this.indexkey.Text, this.adres.Text, hexString);
            transactionId         = chain.PublishMessage(this.indexkey.Text, hexString);
            this.transaction.Text = this.transactionId;
        }
示例#2
0
        private void button14_Click(object sender, EventArgs e)
        {
            byte[] ba        = Encoding.Default.GetBytes(this.message.Text);
            var    hexString = BitConverter.ToString(ba).Replace("-", string.Empty).Replace(" ", string.Empty);

            //transactionId = chain.PublishMessage(this.indexkey.Text, this.adres.Text, hexString);
            transactionId = chain.PublishMessage(Program.streamname, hexString);
            Program.FirstClient.MessageReceived(transactionId);
        }
示例#3
0
        public void TestMultiChainPublishMessage()
        {
            // Setup
            var processWrapper = new ProcessWrapper {
                Mock = true, ReplyMessage = "Blockchain test"
            };
            var chain = new MultiChain(null, processWrapper);

            // Test
            var str = chain.PublishMessage(new PublishMessageData {
                Key = "KEY01", HexString = "A1B2C3E4F5", StreamName = "Test01"
            });

            // Check
            Assert.AreEqual("Blockchain test", str);
            Assert.AreEqual("/c D:\\Development\\Eigenbouw\\bc\\MultiChain\\multichain-cli.exe testchain publish Test01 \"KEY01\" A1B2C3E4F5", processWrapper.ProcessInfo.Arguments);
        }