Skip to content

Commit ae3605e

Browse files
author
Erik Zhang
authored
1 parent 01ce716 commit ae3605e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+480
-1255
lines changed

neo-gui/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
using Neo.Core;
22
using Neo.Implementations.Blockchains.LevelDB;
3-
using Neo.Implementations.Wallets.EntityFramework;
43
using Neo.Network;
54
using Neo.Properties;
65
using Neo.UI;
6+
using Neo.Wallets;
77
using System;
88
using System.ComponentModel;
99
using System.Diagnostics;
@@ -19,7 +19,7 @@ namespace Neo
1919
internal static class Program
2020
{
2121
public static LocalNode LocalNode;
22-
public static UserWallet CurrentWallet;
22+
public static Wallet CurrentWallet;
2323
public static MainForm MainForm;
2424

2525
private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)

neo-gui/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@
3030
//
3131
// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
3232
// 方法是按如下所示使用“*”:
33-
[assembly: AssemblyVersion("2.4.*")]
33+
[assembly: AssemblyVersion("2.5.*")]
3434
//[assembly: AssemblyVersion("1.0.0.0")]
3535
//[assembly: AssemblyFileVersion("1.0.0.0")]

neo-gui/Properties/Strings.Designer.cs

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

neo-gui/Properties/Strings.es-Es.resx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,6 @@
193193
<value>Abriendo ficheros de monederos antiguos, actualizar al nuevo formato?
194194
Aviso: los ficheros actualizados no podran ser abiertos por clientes de versiones antiguas.</value>
195195
</data>
196-
<data name="MigrateWalletSucceedMessage" xml:space="preserve">
197-
<value>Ficheros de monederos realojados. Los ficheros antiguos se guardaron automáticamente en:</value>
198-
</data>
199196
<data name="PasswordIncorrect" xml:space="preserve">
200197
<value>Contraseña incorrecta</value>
201198
</data>

neo-gui/Properties/Strings.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@
194194
Note: updated files cannot be openned by clients in older versions!</value>
195195
</data>
196196
<data name="MigrateWalletSucceedMessage" xml:space="preserve">
197-
<value>Wallet files relocated. Old files have been auto-saved at: </value>
197+
<value>Wallet file relocated. New wallet file has been saved at: </value>
198198
</data>
199199
<data name="PasswordIncorrect" xml:space="preserve">
200200
<value>Password Incorrect</value>

neo-gui/Properties/Strings.zh-Hans.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@
194194
注意,升级后将无法用旧版本的客户端打开该文件!</value>
195195
</data>
196196
<data name="MigrateWalletSucceedMessage" xml:space="preserve">
197-
<value>钱包文件迁移成功,旧的文件已经自动保存到以下位置:</value>
197+
<value>钱包文件迁移成功,新的钱包文件已经自动保存到以下位置:</value>
198198
</data>
199199
<data name="PasswordIncorrect" xml:space="preserve">
200200
<value>密码错误!</value>

neo-gui/UI/AssetRegisterDialog.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ public InvocationTransaction GetTransaction()
4747
private void AssetRegisterDialog_Load(object sender, EventArgs e)
4848
{
4949
comboBox1.Items.AddRange(new object[] { AssetType.Share, AssetType.Token });
50-
comboBox2.Items.AddRange(Program.CurrentWallet.GetContracts().Where(p => p.IsStandard).Select(p => Program.CurrentWallet.GetKey(p.PublicKeyHash).PublicKey).ToArray());
51-
comboBox3.Items.AddRange(Program.CurrentWallet.GetContracts().Select(p => p.Address).ToArray());
52-
comboBox4.Items.AddRange(Program.CurrentWallet.GetContracts().Select(p => p.Address).ToArray());
50+
comboBox2.Items.AddRange(Program.CurrentWallet.GetAccounts().Where(p => !p.WatchOnly && p.Contract.IsStandard).Select(p => p.GetKey().PublicKey).ToArray());
51+
comboBox3.Items.AddRange(Program.CurrentWallet.GetAccounts().Where(p => !p.WatchOnly).Select(p => p.Address).ToArray());
52+
comboBox4.Items.AddRange(Program.CurrentWallet.GetAccounts().Where(p => !p.WatchOnly).Select(p => p.Address).ToArray());
5353
}
5454

5555
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)

neo-gui/UI/CertificateRequestWizard.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
using Neo.Cryptography.ECC;
1+
using CERTENROLLLib;
22
using Neo.Wallets;
3-
using CERTENROLLLib;
43
using System;
54
using System.IO;
65
using System.Linq;
@@ -17,7 +16,7 @@ public CertificateRequestWizard()
1716

1817
private void CertificateRequestWizard_Load(object sender, EventArgs e)
1918
{
20-
comboBox1.Items.AddRange(Program.CurrentWallet.GetContracts().Where(p => p.IsStandard).Select(p => Program.CurrentWallet.GetKey(p.PublicKeyHash).PublicKey).ToArray());
19+
comboBox1.Items.AddRange(Program.CurrentWallet.GetAccounts().Where(p => !p.WatchOnly && p.Contract.IsStandard).Select(p => p.GetKey()).ToArray());
2120
}
2221

2322
private void textBox_TextChanged(object sender, EventArgs e)
@@ -28,9 +27,8 @@ private void textBox_TextChanged(object sender, EventArgs e)
2827
private void button1_Click(object sender, EventArgs e)
2928
{
3029
if (saveFileDialog1.ShowDialog() != DialogResult.OK) return;
31-
ECPoint point = (ECPoint)comboBox1.SelectedItem;
32-
KeyPair key = Program.CurrentWallet.GetKey(point);
33-
byte[] pubkey = point.EncodePoint(false).Skip(1).ToArray();
30+
KeyPair key = (KeyPair)comboBox1.SelectedItem;
31+
byte[] pubkey = key.PublicKey.EncodePoint(false).Skip(1).ToArray();
3432
byte[] prikey;
3533
using (key.Decrypt())
3634
{

neo-gui/UI/ContractDetailsDialog.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
using Neo.Wallets;
1+
using Neo.SmartContract;
2+
using Neo.Wallets;
23
using System.Windows.Forms;
34

45
namespace Neo.UI
56
{
67
internal partial class ContractDetailsDialog : Form
78
{
8-
public ContractDetailsDialog(VerificationContract contract)
9+
public ContractDetailsDialog(Contract contract)
910
{
1011
InitializeComponent();
1112
textBox1.Text = Wallet.ToAddress(contract.ScriptHash);

neo-gui/UI/CreateLockAccountDialog.cs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using Neo.Core;
2-
using Neo.Cryptography.ECC;
3-
using Neo.SmartContract;
1+
using Neo.SmartContract;
42
using Neo.VM;
53
using Neo.Wallets;
64
using System;
@@ -14,23 +12,27 @@ internal partial class CreateLockAccountDialog : Form
1412
public CreateLockAccountDialog()
1513
{
1614
InitializeComponent();
17-
comboBox1.Items.AddRange(Program.CurrentWallet.GetContracts().Where(p => p.IsStandard).Select(p => Program.CurrentWallet.GetKey(p.PublicKeyHash).PublicKey).ToArray());
15+
comboBox1.Items.AddRange(Program.CurrentWallet.GetAccounts().Where(p => !p.WatchOnly && p.Contract.IsStandard).Select(p => p.GetKey()).ToArray());
1816
}
1917

20-
public VerificationContract GetContract()
18+
public Contract GetContract()
2119
{
22-
ECPoint publicKey = (ECPoint)comboBox1.SelectedItem;
2320
uint timestamp = dateTimePicker1.Value.ToTimestamp();
2421
using (ScriptBuilder sb = new ScriptBuilder())
2522
{
26-
sb.EmitPush(publicKey);
23+
sb.EmitPush(GetKey().PublicKey);
2724
sb.EmitPush(timestamp);
2825
// Lock 2.0 in mainnet tx:4e84015258880ced0387f34842b1d96f605b9cc78b308e1f0d876933c2c9134b
2926
sb.EmitAppCall(UInt160.Parse("d3cce84d0800172d09c88ccad61130611bd047a4"));
30-
return VerificationContract.Create(publicKey.EncodePoint(true).ToScriptHash(), new[] { ContractParameterType.Signature }, sb.ToArray());
27+
return Contract.Create(new[] { ContractParameterType.Signature }, sb.ToArray());
3128
}
3229
}
3330

31+
public KeyPair GetKey()
32+
{
33+
return (KeyPair)comboBox1.SelectedItem;
34+
}
35+
3436
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
3537
{
3638
button1.Enabled = comboBox1.SelectedIndex >= 0;

0 commit comments

Comments
 (0)