예제 #1
0
        private void button8_Click(object sender, EventArgs e)
        {
            TransactionWrapper        wrapper = (TransactionWrapper)propertyGrid1.SelectedObject;
            ContractParametersContext context = new ContractParametersContext(Program.Service.NeoSystem.StoreView, wrapper.Unwrap());

            InformationBox.Show(context.ToString(), "ParametersContext", "ParametersContext");
        }
예제 #2
0
        public static void SignAndShowInformation(Transaction tx)
        {
            if (tx == null)
            {
                MessageBox.Show(Strings.InsufficientFunds);
                return;
            }
            ContractParametersContext context;

            try
            {
                context = new ContractParametersContext(tx);
            }
            catch (InvalidOperationException)
            {
                MessageBox.Show(Strings.UnsynchronizedBlock);
                return;
            }
            Service.CurrentWallet.Sign(context);
            if (context.Completed)
            {
                tx.Witnesses = context.GetWitnesses();
                Service.NeoSystem.LocalNode.Tell(new LocalNode.Relay {
                    Inventory = tx
                });
                InformationBox.Show(tx.Hash.ToString(), Strings.SendTxSucceedMessage, Strings.SendTxSucceedTitle);
            }
            else
            {
                InformationBox.Show(context.ToString(), Strings.IncompletedSignatureMessage, Strings.IncompletedSignatureTitle);
            }
        }
예제 #3
0
 public static DialogResult Show(string text, string message = null, string title = null)
 {
     using InformationBox box = new InformationBox();
     box.textBox1.Text        = text;
     if (message != null)
     {
         box.label1.Text = message;
     }
     if (title != null)
     {
         box.Text = title;
     }
     return(box.ShowDialog());
 }
예제 #4
0
        private void button4_Click(object sender, EventArgs e)
        {
            ContractParametersContext context = ContractParametersContext.Parse(textBox2.Text, Service.NeoSystem.StoreView);

            if (!(context.Verifiable is Transaction tx))
            {
                MessageBox.Show("Only support to broadcast transaction.");
                return;
            }
            tx.Witnesses = context.GetWitnesses();
            Service.NeoSystem.Blockchain.Tell(tx);
            InformationBox.Show(tx.Hash.ToString(), Strings.RelaySuccessText, Strings.RelaySuccessTitle);
            button4.Visible = false;
        }
 private void button4_Click(object sender, EventArgs e)
 {
     if (!(context.Verifiable is Transaction tx))
     {
         MessageBox.Show("Only support to broadcast transaction.");
         return;
     }
     tx.Witnesses = context.GetWitnesses();
     Blockchain.RelayResult reason = Service.NeoSystem.Blockchain.Ask <Blockchain.RelayResult>(tx).Result;
     if (reason.Result == VerifyResult.Succeed)
     {
         InformationBox.Show(tx.Hash.ToString(), Strings.RelaySuccessText, Strings.RelaySuccessTitle);
     }
     else
     {
         MessageBox.Show($"Transaction cannot be broadcast: {reason}");
     }
 }
 private void button2_Click(object sender, EventArgs e)
 {
     InformationBox.Show(context.ToString(), "ParametersContext", "ParametersContext");
 }