From 1db0a21986b633d53a3f94758325d621f6c42b64 Mon Sep 17 00:00:00 2001 From: Erik Zhang Date: Thu, 20 Oct 2016 20:17:43 +0800 Subject: [PATCH] remove VotingTransaction; display unavailable ANC; optimize the process of voting; fix bug; use antcha.in as blockchain explorer; --- AntSharesCore/AntSharesCore.csproj | 1 - AntSharesCore/Core/Scripts/InterfaceEngine.cs | 11 - AntSharesCore/Core/Transaction.cs | 27 +- AntSharesCore/Core/TransactionAttribute.cs | 2 +- .../Core/TransactionAttributeUsage.cs | 2 + AntSharesCore/Core/TransactionType.cs | 4 - AntSharesCore/Core/VotingTransaction.cs | 94 -- AntSharesCore/IO/Helper.cs | 4 +- .../Blockchains/LevelDB/LevelDBBlockchain.cs | 31 +- AntSharesCore/Wallets/Wallet.cs | 28 + AntSharesDaemon/Network/RPC/RpcServer.cs | 11 +- AntSharesUI/AntSharesUI.csproj | 26 +- AntSharesUI/App.config | 6 + AntSharesUI/Properties/Settings.Designer.cs | 13 + AntSharesUI/Properties/Settings.settings | 4 + AntSharesUI/UI/ClaimForm.cs | 10 +- AntSharesUI/UI/ClaimForm.resx | 6 +- AntSharesUI/UI/ClaimForm.zh-Hans.resx | 3 - AntSharesUI/UI/Helper.cs | 9 + AntSharesUI/UI/MainForm.Designer.cs | 25 +- AntSharesUI/UI/MainForm.cs | 35 +- AntSharesUI/UI/MainForm.resx | 1410 +++++++++-------- AntSharesUI/UI/MainForm.zh-Hans.resx | 9 + ....Designer.cs => OptionsDialog.Designer.cs} | 175 +- AntSharesUI/UI/OptionsDialog.cs | 28 + .../{VotingDialog.resx => OptionsDialog.resx} | 502 +++--- ...h-Hans.resx => OptionsDialog.zh-Hans.resx} | 7 +- AntSharesUI/UI/VotingDialog.cs | 37 - 28 files changed, 1289 insertions(+), 1231 deletions(-) delete mode 100644 AntSharesCore/Core/VotingTransaction.cs rename AntSharesUI/UI/{VotingDialog.Designer.cs => OptionsDialog.Designer.cs} (78%) create mode 100644 AntSharesUI/UI/OptionsDialog.cs rename AntSharesUI/UI/{VotingDialog.resx => OptionsDialog.resx} (86%) rename AntSharesUI/UI/{VotingDialog.zh-Hans.resx => OptionsDialog.zh-Hans.resx} (98%) delete mode 100644 AntSharesUI/UI/VotingDialog.cs diff --git a/AntSharesCore/AntSharesCore.csproj b/AntSharesCore/AntSharesCore.csproj index 150c6b0099..be0474eac2 100644 --- a/AntSharesCore/AntSharesCore.csproj +++ b/AntSharesCore/AntSharesCore.csproj @@ -203,7 +203,6 @@ - diff --git a/AntSharesCore/Core/Scripts/InterfaceEngine.cs b/AntSharesCore/Core/Scripts/InterfaceEngine.cs index a9e7785484..ce254a6b9a 100644 --- a/AntSharesCore/Core/Scripts/InterfaceEngine.cs +++ b/AntSharesCore/Core/Scripts/InterfaceEngine.cs @@ -62,8 +62,6 @@ public bool Invoke(string method, ScriptEngine engine) return AssetAdmin(engine); case "AntShares.Enroll.pubkey": return EnrollPubkey(engine); - case "AntShares.Vote.enrollments": - return VoteEnrollments(engine); case "AntShares.TX.attributes": return TxAttributes(engine); case "AntShares.TX.inputs": @@ -447,15 +445,6 @@ private bool EnrollPubkey(ScriptEngine engine) return true; } - private bool VoteEnrollments(ScriptEngine engine) - { - if (engine.AltStack.Count < 1) return false; - VotingTransaction tx = engine.AltStack.Pop().GetInterface(); - if (tx == null) return false; - engine.Stack.Push(new StackItem(tx.Enrollments)); - return true; - } - private bool TxAttributes(ScriptEngine engine) { if (engine.AltStack.Count < 1) return false; diff --git a/AntSharesCore/Core/Transaction.cs b/AntSharesCore/Core/Transaction.cs index a7ced955d1..ca41965278 100644 --- a/AntSharesCore/Core/Transaction.cs +++ b/AntSharesCore/Core/Transaction.cs @@ -1,5 +1,6 @@ using AntShares.Core.Scripts; using AntShares.Cryptography; +using AntShares.Cryptography.ECC; using AntShares.IO; using AntShares.IO.Json; using AntShares.Network; @@ -169,7 +170,11 @@ private void DeserializeUnsignedWithoutType(BinaryReader reader) throw new FormatException(); DeserializeExclusiveData(reader); Attributes = reader.ReadSerializableArray(); - if (Attributes.Select(p => p.Usage).Distinct().Count() != Attributes.Length) + if (Attributes.Count(p => p.Usage == TransactionAttributeUsage.ECDH02 || p.Usage == TransactionAttributeUsage.ECDH03) > 1) + throw new FormatException(); + if (Attributes.Count(p => p.Usage == TransactionAttributeUsage.Vote) > 1024) + throw new FormatException(); + if (Attributes.Where(p => p.Usage == TransactionAttributeUsage.Vote).Select(p => new UInt256(p.Data)).Distinct().Count() != Attributes.Count(p => p.Usage == TransactionAttributeUsage.Vote)) throw new FormatException(); Inputs = reader.ReadSerializableArray(); TransactionInput[] inputs = GetAllInputs().ToArray(); @@ -177,8 +182,8 @@ private void DeserializeUnsignedWithoutType(BinaryReader reader) for (int j = 0; j < i; j++) if (inputs[i].PrevHash == inputs[j].PrevHash && inputs[i].PrevIndex == inputs[j].PrevIndex) throw new FormatException(); - Outputs = reader.ReadSerializableArray(); - if (Outputs.Length > ushort.MaxValue + 1) + Outputs = reader.ReadSerializableArray(ushort.MaxValue + 1); + if (Attributes.Any(p => p.Usage == TransactionAttributeUsage.Vote) && Outputs.All(p => !p.AssetId.Equals(Blockchain.AntShare.Hash))) throw new FormatException(); } @@ -346,8 +351,7 @@ public virtual bool Verify() return false; break; } - TransactionAttribute script = Attributes.FirstOrDefault(p => p.Usage == TransactionAttributeUsage.Script); - if (script != null) + foreach (TransactionAttribute script in Attributes.Where(p => p.Usage == TransactionAttributeUsage.Script)) { ScriptEngine engine = new ScriptEngine(new Script { @@ -356,6 +360,19 @@ public virtual bool Verify() }, this, InterfaceEngine.Default); if (!engine.Execute()) return false; } + if (Attributes.Any(p => p.Usage == TransactionAttributeUsage.Vote)) + { + if (!Blockchain.Default.Ability.HasFlag(BlockchainAbility.UnspentIndexes)) + return false; + HashSet pubkeys = new HashSet(); + foreach (UInt256 vote in Attributes.Where(p => p.Usage == TransactionAttributeUsage.Vote).Select(p => new UInt256(p.Data))) + { + EnrollmentTransaction tx = Blockchain.Default.GetTransaction(vote) as EnrollmentTransaction; + if (tx == null) return false; + if (!Blockchain.Default.ContainsUnspent(vote, 0)) return false; + if (!pubkeys.Add(tx.PublicKey)) return false; + } + } return this.VerifySignature(); } } diff --git a/AntSharesCore/Core/TransactionAttribute.cs b/AntSharesCore/Core/TransactionAttribute.cs index 194d716290..73a9235972 100644 --- a/AntSharesCore/Core/TransactionAttribute.cs +++ b/AntSharesCore/Core/TransactionAttribute.cs @@ -23,7 +23,7 @@ public class TransactionAttribute : ISerializable void ISerializable.Deserialize(BinaryReader reader) { Usage = (TransactionAttributeUsage)reader.ReadByte(); - if (Usage == TransactionAttributeUsage.ContractHash || (Usage >= TransactionAttributeUsage.Hash1 && Usage <= TransactionAttributeUsage.Hash15)) + if (Usage == TransactionAttributeUsage.ContractHash || Usage == TransactionAttributeUsage.Vote || (Usage >= TransactionAttributeUsage.Hash1 && Usage <= TransactionAttributeUsage.Hash15)) Data = reader.ReadBytes(32); else if (Usage == TransactionAttributeUsage.ECDH02 || Usage == TransactionAttributeUsage.ECDH03) Data = new[] { (byte)Usage }.Concat(reader.ReadBytes(32)).ToArray(); diff --git a/AntSharesCore/Core/TransactionAttributeUsage.cs b/AntSharesCore/Core/TransactionAttributeUsage.cs index 1d4995b69a..fc9351a11f 100644 --- a/AntSharesCore/Core/TransactionAttributeUsage.cs +++ b/AntSharesCore/Core/TransactionAttributeUsage.cs @@ -24,6 +24,8 @@ public enum TransactionAttributeUsage : byte /// Script = 0x20, + Vote = 0x30, + CertUrl = 0x80, DescriptionUrl = 0x81, Description = 0x90, diff --git a/AntSharesCore/Core/TransactionType.cs b/AntSharesCore/Core/TransactionType.cs index 5c07c83264..7aa1fd2caf 100644 --- a/AntSharesCore/Core/TransactionType.cs +++ b/AntSharesCore/Core/TransactionType.cs @@ -22,10 +22,6 @@ public enum TransactionType : byte /// EnrollmentTransaction = 0x20, /// - /// 用于投票选出记账人的特殊交易 - /// - VotingTransaction = 0x24, - /// /// 用于资产登记的特殊交易 /// RegisterTransaction = 0x40, diff --git a/AntSharesCore/Core/VotingTransaction.cs b/AntSharesCore/Core/VotingTransaction.cs deleted file mode 100644 index d42eebfdc0..0000000000 --- a/AntSharesCore/Core/VotingTransaction.cs +++ /dev/null @@ -1,94 +0,0 @@ -using AntShares.Cryptography.ECC; -using AntShares.IO; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using AntShares.IO.Json; - -namespace AntShares.Core -{ - /// - /// 用于投票选出记账人的特殊交易 - /// - public class VotingTransaction : Transaction - { - /// - /// 报名表的散列值列表,本交易中的选票将投给这些报名表所指代的候选人 - /// - public UInt256[] Enrollments; - - /// - /// 系统费用 - /// - public override Fixed8 SystemFee => Fixed8.FromDecimal(10); - - public VotingTransaction() - : base(TransactionType.VotingTransaction) - { - } - - /// - /// 反序列化交易中的额外数据 - /// - /// 数据来源 - protected override void DeserializeExclusiveData(BinaryReader reader) - { - this.Enrollments = reader.ReadSerializableArray(); - if (Enrollments.Length == 0 || Enrollments.Length > 1024) - throw new FormatException(); - if (Enrollments.Length != Enrollments.Distinct().Count()) - throw new FormatException(); - } - - /// - /// 反序列化进行完毕时触发 - /// - protected override void OnDeserialized() - { - base.OnDeserialized(); - if (Outputs.All(p => p.AssetId != Blockchain.AntShare.Hash)) - throw new FormatException(); - } - - /// - /// 序列化交易中的额外数据 - /// - /// 存放序列化后的结果 - protected override void SerializeExclusiveData(BinaryWriter writer) - { - writer.Write(Enrollments); - } - - /// - /// 将交易转变为json对象的形式 - /// - /// 返回Json对象 - public override JObject ToJson() - { - JObject json = base.ToJson(); - json["enrollments"] = new JArray(Enrollments.Select(p => (JObject)p.ToString()).ToArray()); - return json; - } - - /// - /// 验证交易 - /// - /// 返回验证结果 - public override bool Verify() - { - if (!base.Verify()) return false; - if (!Blockchain.Default.Ability.HasFlag(BlockchainAbility.UnspentIndexes)) - return false; - HashSet pubkeys = new HashSet(); - foreach (UInt256 vote in Enrollments) - { - EnrollmentTransaction tx = Blockchain.Default.GetTransaction(vote) as EnrollmentTransaction; - if (tx == null) return false; - if (!Blockchain.Default.ContainsUnspent(vote, 0)) return false; - if (!pubkeys.Add(tx.PublicKey)) return false; - } - return true; - } - } -} diff --git a/AntSharesCore/IO/Helper.cs b/AntSharesCore/IO/Helper.cs index 7a0e963af5..dee982e716 100644 --- a/AntSharesCore/IO/Helper.cs +++ b/AntSharesCore/IO/Helper.cs @@ -42,9 +42,9 @@ public static string ReadFixedString(this BinaryReader reader, int length) return obj; } - public static T[] ReadSerializableArray(this BinaryReader reader) where T : ISerializable, new() + public static T[] ReadSerializableArray(this BinaryReader reader, int max = 0x10000000) where T : ISerializable, new() { - T[] array = new T[reader.ReadVarInt(0x10000000)]; + T[] array = new T[reader.ReadVarInt((ulong)max)]; for (int i = 0; i < array.Length; i++) { array[i] = new T(); diff --git a/AntSharesCore/Implementations/Blockchains/LevelDB/LevelDBBlockchain.cs b/AntSharesCore/Implementations/Blockchains/LevelDB/LevelDBBlockchain.cs index cdfaee9076..3481f2093d 100644 --- a/AntSharesCore/Implementations/Blockchains/LevelDB/LevelDBBlockchain.cs +++ b/AntSharesCore/Implementations/Blockchains/LevelDB/LevelDBBlockchain.cs @@ -396,19 +396,21 @@ public override IEnumerable GetVotes(IEnumerable others) UInt256 hash = new UInt256(kv.Key.ToArray().Skip(1).ToArray()); ushort[] indexes = kv.Value.ToArray().GetUInt16Array().Except(others.SelectMany(p => p.GetAllInputs()).Where(p => p.PrevHash == hash).Select(p => p.PrevIndex)).ToArray(); if (indexes.Length == 0) continue; - VotingTransaction tx = (VotingTransaction)GetTransaction(options, hash, out height); + Transaction tx = GetTransaction(options, hash, out height); yield return new Vote { - Enrollments = tx.Enrollments, + Enrollments = tx.Attributes.Where(p => p.Usage == TransactionAttributeUsage.Vote).Select(p => new UInt256(p.Data)).ToArray(), Count = indexes.Sum(p => tx.Outputs[p].Value) }; } } - foreach (VotingTransaction tx in others.OfType()) + foreach (Transaction tx in others) { + UInt256[] enrollments = tx.Attributes.Where(p => p.Usage == TransactionAttributeUsage.Vote).Select(p => new UInt256(p.Data)).ToArray(); + if (enrollments.Length == 0) continue; yield return new Vote { - Enrollments = tx.Enrollments, + Enrollments = enrollments, Count = tx.Outputs.Where(p => p.AssetId == AntShare.Hash).Sum(p => p.Value) }; } @@ -512,6 +514,17 @@ private void Persist(Block block) foreach (Transaction tx in block.Transactions) { batch.Put(SliceBuilder.Begin(DataEntryPrefix.DATA_Transaction).Add(tx.Hash), SliceBuilder.Begin().Add(block.Height).Add(tx.ToArray())); + if (tx.Attributes.Any(p => p.Usage == TransactionAttributeUsage.Vote)) + { + unspent_votes.AddEmpty(tx.Hash); + for (ushort index = 0; index < tx.Outputs.Length; index++) + { + if (tx.Outputs[index].AssetId == AntShare.Hash) + { + unspent_votes.Add(tx.Hash, index); + } + } + } switch (tx.Type) { case TransactionType.IssueTransaction: @@ -539,16 +552,6 @@ private void Persist(Block block) batch.Put(SliceBuilder.Begin(DataEntryPrefix.IX_Enrollment).Add(tx.Hash), true); } break; - case TransactionType.VotingTransaction: - unspent_votes.AddEmpty(tx.Hash); - for (ushort index = 0; index < tx.Outputs.Length; index++) - { - if (tx.Outputs[index].AssetId == AntShare.Hash) - { - unspent_votes.Add(tx.Hash, index); - } - } - break; case TransactionType.PublishTransaction: foreach (byte[] script in ((PublishTransaction)tx).Contracts) { diff --git a/AntSharesCore/Wallets/Wallet.cs b/AntSharesCore/Wallets/Wallet.cs index 00446213b4..01a6a0ce35 100644 --- a/AntSharesCore/Wallets/Wallet.cs +++ b/AntSharesCore/Wallets/Wallet.cs @@ -124,6 +124,34 @@ public static Fixed8 CalculateClaimAmount(IEnumerable inputs) unclaimed.Add(claimable[claim.PrevIndex]); } } + return CalculateClaimAmountInternal(unclaimed); + } + + public static Fixed8 CalculateClaimAmountUnavailable(IEnumerable inputs, uint height) + { + List unclaimed = new List(); + foreach (var group in inputs.GroupBy(p => p.PrevHash)) + { + int height_start; + Transaction tx = Blockchain.Default.GetTransaction(group.Key, out height_start); + if (tx == null) throw new ArgumentException(); + foreach (TransactionInput claim in group) + { + if (claim.PrevIndex >= tx.Outputs.Length || !tx.Outputs[claim.PrevIndex].AssetId.Equals(Blockchain.AntShare.Hash)) + throw new ArgumentException(); + unclaimed.Add(new Claimable + { + Output = tx.Outputs[claim.PrevIndex], + StartHeight = (uint)height_start, + EndHeight = height + }); + } + } + return CalculateClaimAmountInternal(unclaimed); + } + + private static Fixed8 CalculateClaimAmountInternal(IEnumerable unclaimed) + { Fixed8 amount_claimed = Fixed8.Zero; foreach (var group in unclaimed.GroupBy(p => new { p.StartHeight, p.EndHeight })) { diff --git a/AntSharesDaemon/Network/RPC/RpcServer.cs b/AntSharesDaemon/Network/RPC/RpcServer.cs index 6005400b52..2527e4ef14 100644 --- a/AntSharesDaemon/Network/RPC/RpcServer.cs +++ b/AntSharesDaemon/Network/RPC/RpcServer.cs @@ -97,15 +97,22 @@ private JObject InternalCall(string method, JArray _params) { UInt256 hash = UInt256.Parse(_params[0].AsString()); bool verbose = _params.Count >= 2 && _params[1].AsBooleanOrDefault(false); + int height = -1; Transaction tx = LocalNode.GetTransaction(hash); if (tx == null) - tx = Blockchain.Default.GetTransaction(hash); + tx = Blockchain.Default.GetTransaction(hash, out height); if (tx == null) throw new RpcException(-101, "Unknown transaction"); if (verbose) - return tx.ToJson(); + { + JObject json = tx.ToJson(); + json["height"] = height; + return json; + } else + { return tx.ToArray().ToHexString(); + } } case "gettxout": { diff --git a/AntSharesUI/AntSharesUI.csproj b/AntSharesUI/AntSharesUI.csproj index 345fe70608..2dd30a6a64 100644 --- a/AntSharesUI/AntSharesUI.csproj +++ b/AntSharesUI/AntSharesUI.csproj @@ -119,6 +119,12 @@ IssueDialog.cs + + Form + + + OptionsDialog.cs + Form @@ -218,12 +224,6 @@ ViewPrivateKeyDialog.cs - - Form - - - VotingDialog.cs - ResXFileCodeGenerator Resources.Designer.cs @@ -309,6 +309,13 @@ OpenWalletDialog.cs + + OptionsDialog.cs + Designer + + + OptionsDialog.cs + PayToDialog.cs @@ -345,6 +352,7 @@ SigningDialog.cs + Designer CreateWalletDialog.cs @@ -368,12 +376,6 @@ ViewPrivateKeyDialog.cs - - VotingDialog.cs - - - VotingDialog.cs - SettingsSingleFileGenerator Settings.Designer.cs diff --git a/AntSharesUI/App.config b/AntSharesUI/App.config index c03e1529d5..3a4e4c0328 100644 --- a/AntSharesUI/App.config +++ b/AntSharesUI/App.config @@ -37,6 +37,12 @@ + + + + + diff --git a/AntSharesUI/Properties/Settings.Designer.cs b/AntSharesUI/Properties/Settings.Designer.cs index 63109d85bd..d9a5e69608 100644 --- a/AntSharesUI/Properties/Settings.Designer.cs +++ b/AntSharesUI/Properties/Settings.Designer.cs @@ -61,5 +61,18 @@ public string LastWalletPath { this["LastWalletPath"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("\r\n")] + public global::System.Collections.Specialized.StringCollection Votes { + get { + return ((global::System.Collections.Specialized.StringCollection)(this["Votes"])); + } + set { + this["Votes"] = value; + } + } } } diff --git a/AntSharesUI/Properties/Settings.settings b/AntSharesUI/Properties/Settings.settings index 4802ee6fd5..1be86b78f1 100644 --- a/AntSharesUI/Properties/Settings.settings +++ b/AntSharesUI/Properties/Settings.settings @@ -14,5 +14,9 @@ + + <?xml version="1.0" encoding="utf-16"?> +<ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" /> + \ No newline at end of file diff --git a/AntSharesUI/UI/ClaimForm.cs b/AntSharesUI/UI/ClaimForm.cs index 6781ae6287..729d1cdd8e 100644 --- a/AntSharesUI/UI/ClaimForm.cs +++ b/AntSharesUI/UI/ClaimForm.cs @@ -15,9 +15,11 @@ public ClaimForm() private void ClaimForm_Load(object sender, EventArgs e) { - Fixed8 amount = Wallet.CalculateClaimAmount(Program.CurrentWallet.GetUnclaimedCoins().Select(p => p.Input)); - textBox1.Text = amount.ToString(); - if (amount == Fixed8.Zero) button1.Enabled = false; + Fixed8 amount_available = Wallet.CalculateClaimAmount(Program.CurrentWallet.GetUnclaimedCoins().Select(p => p.Input)); + Fixed8 amount_unavailable = Wallet.CalculateClaimAmountUnavailable(Program.CurrentWallet.FindUnspentCoins().Where(p => p.AssetId.Equals(Blockchain.AntShare.Hash)).Select(p => p.Input), Blockchain.Default.Height); + textBox1.Text = amount_available.ToString(); + textBox2.Text = amount_unavailable.ToString(); + if (amount_available == Fixed8.Zero) button1.Enabled = false; } private void button1_Click(object sender, EventArgs e) @@ -39,7 +41,7 @@ private void button1_Click(object sender, EventArgs e) } } }); - this.Close(); + Close(); } } } diff --git a/AntSharesUI/UI/ClaimForm.resx b/AntSharesUI/UI/ClaimForm.resx index 2b83d54b1d..028863556e 100644 --- a/AntSharesUI/UI/ClaimForm.resx +++ b/AntSharesUI/UI/ClaimForm.resx @@ -235,7 +235,7 @@ 3 - Unknown + 0 textBox2 @@ -249,9 +249,9 @@ 0 - + True - + 7, 17 diff --git a/AntSharesUI/UI/ClaimForm.zh-Hans.resx b/AntSharesUI/UI/ClaimForm.zh-Hans.resx index db8fab1ebb..fba2954917 100644 --- a/AntSharesUI/UI/ClaimForm.zh-Hans.resx +++ b/AntSharesUI/UI/ClaimForm.zh-Hans.resx @@ -148,9 +148,6 @@ 86, 48 - - 未知 - 257, 127 diff --git a/AntSharesUI/UI/Helper.cs b/AntSharesUI/UI/Helper.cs index 6e6f17890a..532e108b54 100644 --- a/AntSharesUI/UI/Helper.cs +++ b/AntSharesUI/UI/Helper.cs @@ -2,6 +2,7 @@ using AntShares.Properties; using System; using System.Collections.Generic; +using System.Linq; using System.Windows.Forms; namespace AntShares.UI @@ -34,6 +35,14 @@ public static void SignAndShowInformation(Transaction tx) MessageBox.Show(Strings.InsufficientFunds); return; } + if (tx.Attributes.All(p => p.Usage != TransactionAttributeUsage.Vote) && tx.Outputs.Any(p => p.AssetId.Equals(Blockchain.AntShare.Hash)) && Settings.Default.Votes.Count > 0) + { + tx.Attributes = tx.Attributes.Concat(Settings.Default.Votes.OfType().Select(p => new TransactionAttribute + { + Usage = TransactionAttributeUsage.Vote, + Data = UInt256.Parse(p).ToArray() + })).ToArray(); + } SignatureContext context; try { diff --git a/AntSharesUI/UI/MainForm.Designer.cs b/AntSharesUI/UI/MainForm.Designer.cs index 498f11a11a..5c88532d94 100644 --- a/AntSharesUI/UI/MainForm.Designer.cs +++ b/AntSharesUI/UI/MainForm.Designer.cs @@ -51,7 +51,8 @@ private void InitializeComponent() this.资产分发IToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator(); this.选举EToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.投票VToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator(); + this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.帮助HToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.查看帮助VToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.官网WToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -216,7 +217,8 @@ private void InitializeComponent() this.资产分发IToolStripMenuItem, this.toolStripSeparator8, this.选举EToolStripMenuItem, - this.投票VToolStripMenuItem}); + this.toolStripSeparator9, + this.optionsToolStripMenuItem}); this.高级AToolStripMenuItem.Name = "高级AToolStripMenuItem"; // // 提取小蚁币CToolStripMenuItem @@ -253,11 +255,16 @@ private void InitializeComponent() this.选举EToolStripMenuItem.Name = "选举EToolStripMenuItem"; this.选举EToolStripMenuItem.Click += new System.EventHandler(this.选举EToolStripMenuItem_Click); // - // 投票VToolStripMenuItem + // toolStripSeparator9 // - resources.ApplyResources(this.投票VToolStripMenuItem, "投票VToolStripMenuItem"); - this.投票VToolStripMenuItem.Name = "投票VToolStripMenuItem"; - this.投票VToolStripMenuItem.Click += new System.EventHandler(this.投票VToolStripMenuItem_Click); + resources.ApplyResources(this.toolStripSeparator9, "toolStripSeparator9"); + this.toolStripSeparator9.Name = "toolStripSeparator9"; + // + // optionsToolStripMenuItem + // + resources.ApplyResources(this.optionsToolStripMenuItem, "optionsToolStripMenuItem"); + this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem"; + this.optionsToolStripMenuItem.Click += new System.EventHandler(this.optionsToolStripMenuItem_Click); // // 帮助HToolStripMenuItem // @@ -320,6 +327,7 @@ private void InitializeComponent() this.listView1.Name = "listView1"; this.listView1.UseCompatibleStateImageBehavior = false; this.listView1.View = System.Windows.Forms.View.Details; + this.listView1.DoubleClick += new System.EventHandler(this.listView1_DoubleClick); // // columnHeader1 // @@ -505,6 +513,7 @@ private void InitializeComponent() this.listView2.ShowGroups = false; this.listView2.UseCompatibleStateImageBehavior = false; this.listView2.View = System.Windows.Forms.View.Details; + this.listView2.DoubleClick += new System.EventHandler(this.listView2_DoubleClick); // // columnHeader2 // @@ -560,6 +569,7 @@ private void InitializeComponent() this.listView3.ShowGroups = false; this.listView3.UseCompatibleStateImageBehavior = false; this.listView3.View = System.Windows.Forms.View.Details; + this.listView3.DoubleClick += new System.EventHandler(this.listView3_DoubleClick); // // columnHeader7 // @@ -672,7 +682,6 @@ private void InitializeComponent() private System.Windows.Forms.ToolStripMenuItem 提取小蚁币CToolStripMenuItem; private System.Windows.Forms.ToolStripSeparator toolStripSeparator8; private System.Windows.Forms.ToolStripMenuItem 选举EToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem 投票VToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem 重建钱包数据库RToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem 交易TToolStripMenuItem1; private System.Windows.Forms.TabPage tabPage3; @@ -688,6 +697,8 @@ private void InitializeComponent() private System.Windows.Forms.ColumnHeader columnHeader10; private System.Windows.Forms.ContextMenuStrip contextMenuStrip3; private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator9; + private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem; } } diff --git a/AntSharesUI/UI/MainForm.cs b/AntSharesUI/UI/MainForm.cs index 32b6d261e4..b28c4cf276 100644 --- a/AntSharesUI/UI/MainForm.cs +++ b/AntSharesUI/UI/MainForm.cs @@ -65,7 +65,10 @@ private void ChangeWallet(UserWallet wallet) 修改密码CToolStripMenuItem.Enabled = Program.CurrentWallet != null; 重建钱包数据库RToolStripMenuItem.Enabled = Program.CurrentWallet != null; 交易TToolStripMenuItem.Enabled = Program.CurrentWallet != null; - 高级AToolStripMenuItem.Enabled = Program.CurrentWallet != null; + 提取小蚁币CToolStripMenuItem.Enabled = Program.CurrentWallet != null; + 注册资产RToolStripMenuItem.Enabled = Program.CurrentWallet != null; + 资产分发IToolStripMenuItem.Enabled = Program.CurrentWallet != null; + 选举EToolStripMenuItem.Enabled = Program.CurrentWallet != null; 创建新地址NToolStripMenuItem.Enabled = Program.CurrentWallet != null; 导入私钥IToolStripMenuItem.Enabled = Program.CurrentWallet != null; 创建智能合约SToolStripMenuItem.Enabled = Program.CurrentWallet != null; @@ -136,7 +139,7 @@ private void CurrentWallet_TransactionsChanged(object sender, IEnumerable System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 重建钱包数据库RToolStripMenuItem + + 17, 17 + + + + 261, 22 - - 帮助HToolStripMenuItem + + &New Wallet Database... - - - CenterScreen + + 261, 22 - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + &Open Wallet Database... + + + 258, 6 - + False - - tabControl1 + + 261, 22 - + + &Change Password... + + False - - toolStripSeparator3 + + 261, 22 - - 100 + + Wallet Database &Reconstruction - - tabPage2 + + 258, 6 - - 1 + + 261, 22 - - System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + E&xit - - System.Windows.Forms.Timer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 56, 21 - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + &Wallet - - - 27, 17 + + 174, 22 - - toolStripSeparator6 + + &Transfer... - - 2 + + 174, 22 - - Fill + + Transactions(&X)... - - 300 + + 171, 6 - - System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 174, 22 - - 219, 22 + + &Signature... - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + False - - 205, 22 + + 87, 21 - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + &Transaction - - toolStripSeparator7 + + False - - columnHeader7 + + 190, 22 - - 482 + + AntCoin &Claim... - - System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 187, 6 - - 创建新地址NToolStripMenuItem + + False - - System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 190, 22 - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Asset &Registration... - - Balance + + False - - 0/0 + + 190, 22 - - $this + + Asset D&istribution... - - 903, 22 + + 187, 6 - - System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + False - - columnHeader1 + + 190, 22 - - 895, 527 + + &Election... - - 开发人员工具TToolStripMenuItem + + 187, 6 - - AntShares Core + + 190, 22 - - &Transfer... + + &Options... - - toolStripSeparator1 + + 77, 21 - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + &Advanced - - Asset + + 194, 22 - - toolStripStatusLabel2 + + &Check for Help - - 4 + + 194, 22 - - 7, 3, 0, 3 + + Official &Web - - &Help + + 191, 6 - - 关于AntSharesToolStripMenuItem + + + F12 - - &Change Password... + + 194, 22 - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Developer &Tool - - 0, 27 + + 191, 6 - - System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 194, 22 - - 修改密码CToolStripMenuItem + + &About AntShares - - False + + 47, 21 - - False + + &Help - - System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 0, 0 - - tabControl1 + + 7, 3, 0, 3 - - $this + + 903, 27 - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 0 - - &Delete... + + menuStrip1 - - False + + menuStrip1 - - 转账TToolStripMenuItem + + System.Windows.Forms.MenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 398 + + $this - - AntCoin &Claim... + + 5 - - columnHeader8 + + Address - - Asset D&istribution... + + 300 - - 187, 6 + + 348, 17 + + + False - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 205, 22 + + + Create &New Add. + + + 219, 22 + + + Import from &WIF... + + + 219, 22 + + + Import from &Certificate... + + + False + + + 205, 22 + + + &Import Private Key... + + + 174, 22 &Multi-Signature... - - &Transaction + + 174, 22 - - 0 + + &Custom... - - Type + + False - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 205, 22 - - 官网WToolStripMenuItem + + Create &Smart Contract - - importWIFToolStripMenuItem + + 202, 6 - - System.Windows.Forms.MenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + False - - 0 + + 205, 22 - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + &View Private Key - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + False - - 0, 0 + + Ctrl+C - - E&xit + + False - - 0 + + 205, 22 - - 7, 17 + + &Copy to Clipboard - - 261, 22 + + False - - 903, 27 + + 205, 22 - - 创建智能合约SToolStripMenuItem + + &Delete... - - 261, 22 + + 206, 142 - - System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + contextMenuStrip1 - - 3, 3, 3, 3 + + System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Transaction Type + + Fill - - toolStripSeparator4 + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w + LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACJTeXN0 + ZW0uV2luZG93cy5Gb3Jtcy5MaXN0Vmlld0dyb3VwBAAAAAZIZWFkZXIPSGVhZGVyQWxpZ25tZW50A1Rh + ZwROYW1lAQQCAShTeXN0ZW0uV2luZG93cy5Gb3Jtcy5Ib3Jpem9udGFsQWxpZ25tZW50AgAAAAIAAAAG + AwAAABBTdGFuZGFyZCBBY2NvdW50Bfz///8oU3lzdGVtLldpbmRvd3MuRm9ybXMuSG9yaXpvbnRhbEFs + aWdubWVudAEAAAAHdmFsdWVfXwAIAgAAAAAAAAAKBgUAAAAVc3RhbmRhcmRDb250cmFjdEdyb3VwCw== + - - columnHeader10 + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w + LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACJTeXN0 + ZW0uV2luZG93cy5Gb3Jtcy5MaXN0Vmlld0dyb3VwBAAAAAZIZWFkZXIPSGVhZGVyQWxpZ25tZW50A1Rh + ZwROYW1lAQQCAShTeXN0ZW0uV2luZG93cy5Gb3Jtcy5Ib3Jpem9udGFsQWxpZ25tZW50AgAAAAIAAAAG + AwAAABBDb250cmFjdCBBZGRyZXNzBfz///8oU3lzdGVtLldpbmRvd3MuRm9ybXMuSG9yaXpvbnRhbEFs + aWdubWVudAEAAAAHdmFsdWVfXwAIAgAAAAAAAAAKBgUAAAAYbm9uc3RhbmRhcmRDb250cmFjdEdyb3Vw + Cw== + - - statusStrip1 + + 3, 3 - - System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 889, 521 - - False + + 1 - - 3, 3, 3, 3 + + listView1 - - Developer &Tool + + System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 903, 557 + + tabPage1 - - 174, 22 + + 0 - - 2 + + 137, 17 + + + 49, 17 - - Import from &WIF... + + Height: - - tabControl1 + + 27, 17 - - Type + + 0/0 - - System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 73, 17 - - 2 + + Connected: - - toolStripSeparator5 + + 15, 17 + + + 0 + + + 100, 16 + + + 140, 17 + + + Waiting for next block: 0, 584 - - System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 903, 22 - - 0 + + 2 - - False + + statusStrip1 - - contextMenuStrip1 + + statusStrip1 System.Windows.Forms.StatusStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + $this - - 复制到剪贴板CToolStripMenuItem + + 4 - - 174, 22 + + 258, 17 + + + 4, 26 - - 3, 4, 3, 4 + + 3, 3, 3, 3 - - Fill + + 895, 527 - - Transactions(&X)... + + 0 - - Address + + Account - - 3, 3 + + tabPage1 - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - confirm + + tabControl1 - - 205, 22 + + 0 - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Asset - - 191, 6 + + 160 - - &Copy TXID + + Type - - columnHeader9 + + 100 - - 138, 22 + + Balance - - 78 + + 127 + + + Issuer + + + 398 + + + 513, 17 + + + 122, 22 + + + &Delete... + + + 123, 26 + + + contextMenuStrip2 + + + System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Fill - - contextMenuStrip3 - - + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACJTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5MaXN0Vmlld0dyb3VwBAAAAAZIZWFkZXIPSGVhZGVyQWxpZ25tZW50A1Rh ZwROYW1lAQQCAShTeXN0ZW0uV2luZG93cy5Gb3Jtcy5Ib3Jpem9udGFsQWxpZ25tZW50AgAAAAIAAAAG - AwAAABBDb250cmFjdCBBZGRyZXNzBfz///8oU3lzdGVtLldpbmRvd3MuRm9ybXMuSG9yaXpvbnRhbEFs - aWdubWVudAEAAAAHdmFsdWVfXwAIAgAAAAAAAAAKBgUAAAAYbm9uc3RhbmRhcmRDb250cmFjdEdyb3Vw - Cw== - - - - 5 - - - 191, 6 - - - Transaction ID - - - 140, 17 + AwAAAAl1bmNoZWNrZWQF/P///yhTeXN0ZW0uV2luZG93cy5Gb3Jtcy5Ib3Jpem9udGFsQWxpZ25tZW50 + AQAAAAd2YWx1ZV9fAAgCAAAAAAAAAAoGBQAAAAl1bmNoZWNrZWQL + - - 87, 21 + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w + LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACJTeXN0 + ZW0uV2luZG93cy5Gb3Jtcy5MaXN0Vmlld0dyb3VwBAAAAAZIZWFkZXIPSGVhZGVyQWxpZ25tZW50A1Rh + ZwROYW1lAQQCAShTeXN0ZW0uV2luZG93cy5Gb3Jtcy5Ib3Jpem9udGFsQWxpZ25tZW50AgAAAAIAAAAG + AwAAAAdjaGVja2VkBfz///8oU3lzdGVtLldpbmRvd3MuRm9ybXMuSG9yaXpvbnRhbEFsaWdubWVudAEA + AAAHdmFsdWVfXwAIAgAAAAAAAAAKBgUAAAAHY2hlY2tlZAs= + - + 3, 3 - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - &Advanced - - - System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 889, 521 - - False + + 2 - - toolStripSeparator8 + + listView2 - - 261, 22 + + System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 174, 22 + + tabPage2 - - 122, 22 + + 0 - - 投票VToolStripMenuItem + + 4, 26 - - 206, 142 + + 3, 3, 3, 3 - - 194, 22 + + 895, 527 - - 261, 22 + + 1 - - 4, 26 + + Asset - - System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + tabPage2 System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 3, 3, 3, 3 - - - toolStripStatusLabel1 - - - Create &New Add. - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + tabControl1 - - menuStrip1 + + 1 - - 4, 26 + + Time - - columnHeader2 + + 132 - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Transaction ID - - Issuer + + 482 - - False + + confirm - - 258, 6 + + 78 - - 0 + + Transaction Type 163 - - Transaction History - - - &Election... + + 678, 17 + + + 138, 22 - - 219, 22 + + &Copy TXID 139, 26 - - 205, 22 - - - System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 258, 6 + + contextMenuStrip3 - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 190, 22 + + Fill - + 3, 3 - - 123, 26 - - - 174, 22 - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 资产分发IToolStripMenuItem - - - 删除DToolStripMenuItem - - - 171, 6 + + 889, 521 - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 0 - - 174, 22 + + listView3 - - 高级AToolStripMenuItem + + System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - &Copy to Clipboard + + tabPage3 - - 190, 22 + + 0 - - 194, 22 + + 4, 26 - - 提取小蚁币CToolStripMenuItem + + 3, 3, 3, 3 - - 100, 16 + + 895, 527 - - Account + + 2 - - &Signature... + + Transaction History - - 钱包WToolStripMenuItem + + tabPage3 - - System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + tabControl1 - - System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 2 - - 889, 521 + + Fill - - System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 0, 27 - - 交易TToolStripMenuItem1 + + 903, 557 - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 3 - - System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + tabControl1 - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 889, 521 + + $this - - 205, 22 + + 3 - - 895, 527 + + True + + + 7, 17 - - Import from &Certificate... + + 903, 606 - - 187, 6 + + Microsoft YaHei UI, 9pt - - 190, 22 + + 3, 4, 3, 4 - - listView2 + + CenterScreen - - 889, 521 + + AntShares Core - - - AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w - LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACJTeXN0 - ZW0uV2luZG93cy5Gb3Jtcy5MaXN0Vmlld0dyb3VwBAAAAAZIZWFkZXIPSGVhZGVyQWxpZ25tZW50A1Rh - ZwROYW1lAQQCAShTeXN0ZW0uV2luZG93cy5Gb3Jtcy5Ib3Jpem9udGFsQWxpZ25tZW50AgAAAAIAAAAG - AwAAAAl1bmNoZWNrZWQF/P///yhTeXN0ZW0uV2luZG93cy5Gb3Jtcy5Ib3Jpem9udGFsQWxpZ25tZW50 - AQAAAAd2YWx1ZV9fAAgCAAAAAAAAAAoGBQAAAAl1bmNoZWNrZWQL - + + 钱包WToolStripMenuItem - + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 退出XToolStripMenuItem + + 创建钱包数据库NToolStripMenuItem - - columnHeader4 + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 打开钱包数据库OToolStripMenuItem System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - tabPage1 - - - 47, 21 + + toolStripSeparator1 - - importCertificateToolStripMenuItem + + System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 0 + + 修改密码CToolStripMenuItem - + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w - LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACJTeXN0 - ZW0uV2luZG93cy5Gb3Jtcy5MaXN0Vmlld0dyb3VwBAAAAAZIZWFkZXIPSGVhZGVyQWxpZ25tZW50A1Rh - ZwROYW1lAQQCAShTeXN0ZW0uV2luZG93cy5Gb3Jtcy5Ib3Jpem9udGFsQWxpZ25tZW50AgAAAAIAAAAG - AwAAAAdjaGVja2VkBfz///8oU3lzdGVtLldpbmRvd3MuRm9ybXMuSG9yaXpvbnRhbEFsaWdubWVudAEA - AAAHdmFsdWVfXwAIAgAAAAAAAAAKBgUAAAAHY2hlY2tlZAs= - + + 重建钱包数据库RToolStripMenuItem - - $this + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 0 + + toolStripSeparator2 - - F12 + + System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - &Custom... + + 退出XToolStripMenuItem - - 56, 21 + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - lbl_height + + 交易TToolStripMenuItem - - tabControl1 + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - MainForm + + 转账TToolStripMenuItem - - False + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - listView1 + + 交易TToolStripMenuItem1 - - 查看帮助VToolStripMenuItem + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Microsoft YaHei UI, 9pt + + toolStripSeparator5 - - columnHeader6 + + System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 205, 22 + + 签名SToolStripMenuItem - - 创建钱包数据库NToolStripMenuItem + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - &Import Private Key... + + 高级AToolStripMenuItem - + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 提取小蚁币CToolStripMenuItem - - Create &Smart Contract + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 49, 17 + + toolStripSeparator7 - + System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - &New Wallet Database... - - - 选举EToolStripMenuItem + + 注册资产RToolStripMenuItem - + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - &Open Wallet Database... - - - 删除DToolStripMenuItem1 - - - tabPage1 + + 资产分发IToolStripMenuItem - - 3 + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - statusStrip1 + + toolStripSeparator8 - - Waiting for next block: + + System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 选举EToolStripMenuItem - + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 15, 17 + + toolStripSeparator9 - + System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - timer1 - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + optionsToolStripMenuItem - - Asset &Registration... + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 自定义CToolStripMenuItem + + 帮助HToolStripMenuItem - - 1 + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - &Delete... + + 查看帮助VToolStripMenuItem - - Ctrl+C + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 77, 21 + + 官网WToolStripMenuItem - - 4, 26 + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.ToolStripProgressBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + toolStripSeparator3 - - &Wallet + + System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - toolStripProgressBar1 + + 开发人员工具TToolStripMenuItem - - 注册资产RToolStripMenuItem + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - lbl_count_node + + toolStripSeparator4 - - menuStrip1 + + System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 3 + + 关于AntSharesToolStripMenuItem - - contextMenuStrip2 + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 73, 17 + + columnHeader1 - + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 查看私钥VToolStripMenuItem + + 创建新地址NToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 导入私钥IToolStripMenuItem - - 190, 22 - - - Fill + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Height: + + importWIFToolStripMenuItem - - Asset + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 127 + + importCertificateToolStripMenuItem - - columnHeader3 + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Official &Web + + 创建智能合约SToolStripMenuItem - - - AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w - LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACJTeXN0 - ZW0uV2luZG93cy5Gb3Jtcy5MaXN0Vmlld0dyb3VwBAAAAAZIZWFkZXIPSGVhZGVyQWxpZ25tZW50A1Rh - ZwROYW1lAQQCAShTeXN0ZW0uV2luZG93cy5Gb3Jtcy5Ib3Jpem9udGFsQWxpZ25tZW50AgAAAAIAAAAG - AwAAABBTdGFuZGFyZCBBY2NvdW50Bfz///8oU3lzdGVtLldpbmRvd3MuRm9ybXMuSG9yaXpvbnRhbEFs - aWdubWVudAEAAAAHdmFsdWVfXwAIAgAAAAAAAAAKBgUAAAAVc3RhbmRhcmRDb250cmFjdEdyb3VwCw== - + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 多方签名MToolStripMenuItem - - 1 + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - &Vote... + + 自定义CToolStripMenuItem - - System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 160 + + toolStripSeparator6 - - Time + + System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 903, 606 + + 查看私钥VToolStripMenuItem - - 多方签名MToolStripMenuItem + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - False + + 复制到剪贴板CToolStripMenuItem - - tabPage3 + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - &View Private Key + + 删除DToolStripMenuItem - - tabPage2 + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 194, 22 + + toolStripStatusLabel1 - - 打开钱包数据库OToolStripMenuItem + + System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + lbl_height - - columnHeader5 + + System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - tabPage3 + + toolStripStatusLabel4 - - 签名SToolStripMenuItem + + System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 2 + + lbl_count_node - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 205, 22 + + toolStripProgressBar1 - - Connected: + + System.Windows.Forms.ToolStripProgressBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 194, 22 + + toolStripStatusLabel2 - - toolStripSeparator2 + + System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + timer1 - - listView3 + + System.Windows.Forms.Timer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - &About AntShares + + columnHeader2 - - toolStripMenuItem1 + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 220 + + columnHeader6 - - 202, 6 + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 0 + + columnHeader3 - - 261, 22 + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 交易TToolStripMenuItem + + columnHeader5 - - System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 895, 527 + + 删除DToolStripMenuItem1 - + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + columnHeader7 - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - toolStripStatusLabel4 + + columnHeader8 - - 132 + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - &Check for Help + + columnHeader9 - - Wallet Database &Reconstruction + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 190, 22 + + columnHeader10 - + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 513, 17 - - - 678, 17 - - - True - - - 258, 17 - - - 137, 17 - - - 17, 17 - - - 348, 17 - + + toolStripMenuItem1 + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + MainForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + \ No newline at end of file diff --git a/AntSharesUI/UI/MainForm.zh-Hans.resx b/AntSharesUI/UI/MainForm.zh-Hans.resx index a8936f5093..88a393318d 100644 --- a/AntSharesUI/UI/MainForm.zh-Hans.resx +++ b/AntSharesUI/UI/MainForm.zh-Hans.resx @@ -223,6 +223,15 @@ 投票(&V)... + + 158, 6 + + + 161, 22 + + + 选项(&O)... + 60, 21 diff --git a/AntSharesUI/UI/VotingDialog.Designer.cs b/AntSharesUI/UI/OptionsDialog.Designer.cs similarity index 78% rename from AntSharesUI/UI/VotingDialog.Designer.cs rename to AntSharesUI/UI/OptionsDialog.Designer.cs index 2c49badb3c..0d66da945c 100644 --- a/AntSharesUI/UI/VotingDialog.Designer.cs +++ b/AntSharesUI/UI/OptionsDialog.Designer.cs @@ -1,83 +1,94 @@ -namespace AntShares.UI -{ - partial class VotingDialog - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(VotingDialog)); - this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.textBox1 = new System.Windows.Forms.TextBox(); - this.button1 = new System.Windows.Forms.Button(); - this.groupBox1.SuspendLayout(); - this.SuspendLayout(); - // - // groupBox1 - // - resources.ApplyResources(this.groupBox1, "groupBox1"); - this.groupBox1.Controls.Add(this.textBox1); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.TabStop = false; - // - // textBox1 - // - this.textBox1.AcceptsReturn = true; - resources.ApplyResources(this.textBox1, "textBox1"); - this.textBox1.Name = "textBox1"; - this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged); - // - // button1 - // - resources.ApplyResources(this.button1, "button1"); - this.button1.DialogResult = System.Windows.Forms.DialogResult.OK; - this.button1.Name = "button1"; - this.button1.UseVisualStyleBackColor = true; - // - // VotingDialog - // - this.AcceptButton = this.button1; - resources.ApplyResources(this, "$this"); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.button1); - this.Controls.Add(this.groupBox1); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "VotingDialog"; - this.ShowInTaskbar = false; - this.groupBox1.ResumeLayout(false); - this.groupBox1.PerformLayout(); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.GroupBox groupBox1; - private System.Windows.Forms.TextBox textBox1; - private System.Windows.Forms.Button button1; - } +namespace AntShares.UI +{ + partial class OptionsDialog + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(OptionsDialog)); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.button1 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.groupBox1.SuspendLayout(); + this.SuspendLayout(); + // + // groupBox1 + // + resources.ApplyResources(this.groupBox1, "groupBox1"); + this.groupBox1.Controls.Add(this.textBox1); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.TabStop = false; + // + // textBox1 + // + this.textBox1.AcceptsReturn = true; + resources.ApplyResources(this.textBox1, "textBox1"); + this.textBox1.Name = "textBox1"; + // + // button1 + // + resources.ApplyResources(this.button1, "button1"); + this.button1.DialogResult = System.Windows.Forms.DialogResult.OK; + this.button1.Name = "button1"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // button2 + // + resources.ApplyResources(this.button2, "button2"); + this.button2.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.button2.Name = "button2"; + this.button2.UseVisualStyleBackColor = true; + // + // OptionsDialog + // + this.AcceptButton = this.button1; + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.button2; + this.Controls.Add(this.button2); + this.Controls.Add(this.button1); + this.Controls.Add(this.groupBox1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.Name = "OptionsDialog"; + this.ShowInTaskbar = false; + this.Load += new System.EventHandler(this.OptionsDialog_Load); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.TextBox textBox1; + } } \ No newline at end of file diff --git a/AntSharesUI/UI/OptionsDialog.cs b/AntSharesUI/UI/OptionsDialog.cs new file mode 100644 index 0000000000..586025c2c0 --- /dev/null +++ b/AntSharesUI/UI/OptionsDialog.cs @@ -0,0 +1,28 @@ +using AntShares.Properties; +using System; +using System.Linq; +using System.Windows.Forms; + +namespace AntShares.UI +{ + public partial class OptionsDialog : Form + { + public OptionsDialog() + { + InitializeComponent(); + } + + private void OptionsDialog_Load(object sender, EventArgs e) + { + textBox1.Lines = Settings.Default.Votes.OfType().ToArray(); + } + + private void button1_Click(object sender, EventArgs e) + { + UInt256 ignore; + Settings.Default.Votes.Clear(); + Settings.Default.Votes.AddRange(textBox1.Lines.Where(p => UInt256.TryParse(p, out ignore)).ToArray()); + Settings.Default.Save(); + } + } +} diff --git a/AntSharesUI/UI/VotingDialog.resx b/AntSharesUI/UI/OptionsDialog.resx similarity index 86% rename from AntSharesUI/UI/VotingDialog.resx rename to AntSharesUI/UI/OptionsDialog.resx index 8bef84c3fc..9758f0d291 100644 --- a/AntSharesUI/UI/VotingDialog.resx +++ b/AntSharesUI/UI/OptionsDialog.resx @@ -1,240 +1,264 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - Top, Bottom, Left, Right - - - Top, Bottom, Left, Right - - - - Consolas, 9pt - - - 6, 22 - - - - True - - - Vertical - - - 486, 282 - - - 0 - - - textBox1 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 0 - - - 12, 12 - - - 498, 310 - - - 0 - - - Nominees - - - groupBox1 - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 1 - - - Bottom, Right - - - False - - - 435, 328 - - - 75, 23 - - - 1 - - - confirm - - - button1 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 0 - - - True - - - 7, 17 - - - 522, 363 - - - 微软雅黑, 9pt - - - 3, 4, 3, 4 - - - CenterScreen - - - Vote - - - VotingDialog - - - System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 2 + + + True + + + 0 + + + + 7, 17 + + + Options + + + 75, 23 + + + System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + button2 + + + OptionsDialog + + + Cancel + + + + Bottom, Right + + + groupBox1 + + + False + + + 500, 301 + + + 530, 376 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Bottom, Right + + + CenterScreen + + + 2 + + + Vertical + + + 3, 4, 3, 4 + + + Top, Bottom, Left, Right + + + 0 + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 3, 19 + + + 12, 12 + + + 1 + + + 0 + + + Fill + + + $this + + + Voting + + + groupBox1 + + + 0 + + + 1 + + + button1 + + + textBox1 + + + OK + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 362, 341 + + + Microsoft YaHei UI, 9pt + + + 506, 323 + + + 443, 341 + + + 75, 23 + + + $this + + + True + \ No newline at end of file diff --git a/AntSharesUI/UI/VotingDialog.zh-Hans.resx b/AntSharesUI/UI/OptionsDialog.zh-Hans.resx similarity index 98% rename from AntSharesUI/UI/VotingDialog.zh-Hans.resx rename to AntSharesUI/UI/OptionsDialog.zh-Hans.resx index f62513d5f1..44faebf9c8 100644 --- a/AntSharesUI/UI/VotingDialog.zh-Hans.resx +++ b/AntSharesUI/UI/OptionsDialog.zh-Hans.resx @@ -118,12 +118,15 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - 候选人 + 投票 确定 + + 取消 + - 投票 + 选项 \ No newline at end of file diff --git a/AntSharesUI/UI/VotingDialog.cs b/AntSharesUI/UI/VotingDialog.cs deleted file mode 100644 index efe3b2071c..0000000000 --- a/AntSharesUI/UI/VotingDialog.cs +++ /dev/null @@ -1,37 +0,0 @@ -using AntShares.Core; -using System; -using System.Linq; -using System.Windows.Forms; - -namespace AntShares.UI -{ - public partial class VotingDialog : Form - { - public VotingDialog() - { - InitializeComponent(); - } - - public VotingTransaction GetTransaction() - { - return Program.CurrentWallet.MakeTransaction(new VotingTransaction - { - Enrollments = textBox1.Lines.Where(p => !string.IsNullOrWhiteSpace(p)).Select(p => UInt256.Parse(p)).ToArray(), - Outputs = new[] - { - new TransactionOutput - { - AssetId = Blockchain.AntShare.Hash, - Value = Program.CurrentWallet.GetAvailable(Blockchain.AntShare.Hash), - ScriptHash = Program.CurrentWallet.GetChangeAddress() - } - } - }, Fixed8.Zero); - } - - private void textBox1_TextChanged(object sender, EventArgs e) - { - button1.Enabled = textBox1.TextLength > 0; - } - } -}