Skip to content

Commit

Permalink
using json based NEP6Wallet import
Browse files Browse the repository at this point in the history
  • Loading branch information
igormcoelho committed Jun 21, 2019
1 parent 13ae9a1 commit 70ccc77
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions neo.UnitTests/UT_Transaction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,24 @@ public void Size_Get()
uut.Size.Should().Be(82);
}

private NEP6Wallet GenerateTestWallet()
{
JObject wallet = new JObject();
wallet["name"] = "noname";
wallet["version"] = new System.Version().ToString();
wallet["scrypt"] = ScryptParameters.Default.ToJson();
wallet["accounts"] = new JArray();
wallet["extra"] = null;
wallet.ToString().Should().Be("{\"name\":\"noname\",\"version\":\"0.0\",\"scrypt\":{\"n\":16384,\"r\":8,\"p\":8},\"accounts\":[],\"extra\":null}");
return new NEP6Wallet(wallet);
}

[TestMethod]
public void FeeIsMultiSigContract()
{
var store = TestBlockchain.GetStore();
var walletA = new NEP6Wallet("unit-test-A.json");
var walletB = new NEP6Wallet("unit-test-B.json");
var walletA = GenerateTestWallet();
var walletB = GenerateTestWallet();
var snapshot = store.GetSnapshot();

using (var unlockA = walletA.Unlock("123"))
Expand Down Expand Up @@ -170,7 +182,7 @@ public void FeeIsMultiSigContract()
[TestMethod]
public void FeeIsSignatureContract()
{
var wallet = new NEP6Wallet("unit-test.json");
var wallet = GenerateTestWallet();
var snapshot = store.GetSnapshot();

using (var unlock = wallet.Unlock("123"))
Expand Down

0 comments on commit 70ccc77

Please sign in to comment.