Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactoring #288

Merged
merged 53 commits into from Sep 14, 2018
Merged
Show file tree
Hide file tree
Changes from 42 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
8d0633a
refactoring
erikzhang Jun 25, 2018
eef4231
message priority
erikzhang Jun 28, 2018
852540c
add failure reason for `sendrawtransaction` (neo-project/neo-cli#116)
erikzhang Jun 29, 2018
9b7817d
change version: 3.0.0-preview2
erikzhang Jun 29, 2018
e7bc99d
fix bug in `sendrawtransaction`
erikzhang Jun 29, 2018
09878c1
improve RpcServer and Plugin system
erikzhang Jun 29, 2018
c409c09
add `unconnected` to RPC command `getpeers`
erikzhang Jul 3, 2018
95c2fd8
update dependencies:
erikzhang Jul 3, 2018
876e7d5
add WebSocket
erikzhang Jul 3, 2018
69e36a2
minor fix
erikzhang Jul 4, 2018
dc77602
fix bug in Snapshot.Dispose()
erikzhang Jul 4, 2018
82b9702
Hides the caught exceptions logs in `RemoteNode`
erikzhang Jul 5, 2018
0a8bd57
fix bug
erikzhang Jul 6, 2018
18be40a
Merge branch 'master' into Neo.Actor
erikzhang Jul 9, 2018
edfd60b
fix block stuck
Jul 20, 2018
91bc58e
fix bug in p2p connection
Jul 27, 2018
90df0de
fix #305
Jul 27, 2018
357cca0
fix consensus
Aug 6, 2018
baaa21a
checked on Fixed8 mul
shargon Aug 14, 2018
e60718b
Merge branch 'master' into Neo.Actor
erikzhang Aug 15, 2018
08070c3
change version to v3.0.0-preview2-08
erikzhang Aug 15, 2018
37186d1
solve the problem of disconnecting from peers
erikzhang Aug 15, 2018
efebeb7
Merge branch 'master' into Neo.Actor
erikzhang Aug 15, 2018
bd5c707
fix bug in `System.Runtime.GetTime`
erikzhang Aug 16, 2018
461140f
Merge branch 'master' into Neo.Actor
erikzhang Aug 17, 2018
7ea2090
add RPC command: `getwalletheight`
erikzhang Aug 20, 2018
d75212d
Merge branch 'master' into Neo.Actor
erikzhang Aug 27, 2018
4280a5d
Merge branch 'master' into Neo.Actor
erikzhang Aug 27, 2018
79cfd8c
fix p2p bug
erikzhang Aug 30, 2018
b76aa0d
Prevent error messages when exiting
erikzhang Aug 30, 2018
e98985e
optimize p2p network
erikzhang Aug 30, 2018
b5b6380
change version to 3.0.0-preview2-10
erikzhang Aug 31, 2018
e547116
allow user interface to send messages to plugins
erikzhang Sep 1, 2018
a2ca623
change version to 3.0.0-preview2-11
erikzhang Sep 1, 2018
2d023c9
Merge branch 'master' into Neo.Actor
erikzhang Sep 7, 2018
62b4758
Merge branch 'master' into Neo.Actor
erikzhang Sep 8, 2018
e9168d4
Merge branch 'master' into Neo.Actor
erikzhang Sep 9, 2018
e534435
Merge branch 'master' into Neo.Actor
erikzhang Sep 10, 2018
0b6fd83
Merge branch 'master' into Neo.Actor
erikzhang Sep 10, 2018
04bd787
Merge branch 'master' into Neo.Actor
erikzhang Sep 10, 2018
e2a5ae3
change version to 2.9.0
erikzhang Sep 10, 2018
9318e60
Merge branch 'master' into Neo.Actor
erikzhang Sep 10, 2018
b235524
backward compatible for sendrawtransaction
erikzhang Sep 11, 2018
307b73a
Solve the problem of resynchronizing blocks
erikzhang Sep 12, 2018
0baace9
Merge branch 'master' into Neo.Actor
erikzhang Sep 13, 2018
6bedccb
put unverified transactions in the memory pool back into the message …
erikzhang Sep 13, 2018
57aacf7
minor change to consensus
erikzhang Sep 13, 2018
e53235c
Merge branch 'master' into Neo.Actor
erikzhang Sep 13, 2018
cc69e09
Merge branch 'master' into Neo.Actor
erikzhang Sep 13, 2018
3be02c2
Merge branch 'master' into Neo.Actor
erikzhang Sep 13, 2018
aece82b
Merge branch 'master' into Neo.Actor
erikzhang Sep 13, 2018
98c5540
Update UserWallet.cs
shargon Sep 14, 2018
5553fc2
Update Contract.cs (#379)
shargon Sep 14, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion neo.UnitTests/README.md
Expand Up @@ -28,7 +28,6 @@ Coverage
* Header.cs
* Helper.cs
* InvocationTransaction.cs
* IssueTransaction.cs
* MinerTransaction.cs
* SpentCoin.cs
* SpentCoinState.cs
Expand Down
161 changes: 0 additions & 161 deletions neo.UnitTests/TestBlockchain.cs

This file was deleted.

10 changes: 9 additions & 1 deletion neo.UnitTests/TestMetaDataCache.cs
Expand Up @@ -3,16 +3,24 @@

namespace Neo.UnitTests
{
public class TestMetaDataCache<T> : MetaDataCache<T> where T : class, ISerializable, new()
public class TestMetaDataCache<T> : MetaDataCache<T> where T : class, ICloneable<T>, ISerializable, new()
{
public TestMetaDataCache()
: base(null)
{
}

protected override void AddInternal(T item)
{
}

protected override T TryGetInternal()
{
return null;
}

protected override void UpdateInternal(T item)
{
}
}
}
5 changes: 1 addition & 4 deletions neo.UnitTests/TestTransaction.cs
@@ -1,7 +1,4 @@
using Neo.Core;
using System;
using System.Collections.Generic;
using System.Text;
using Neo.Network.P2P.Payloads;

namespace Neo.UnitTests
{
Expand Down
61 changes: 6 additions & 55 deletions neo.UnitTests/TestUtils.cs
@@ -1,9 +1,7 @@
using System;
using Neo.Core;
using Neo.Cryptography.ECC;
using Neo.Cryptography.ECC;
using Neo.Network.P2P.Payloads;
using Neo.VM;
using Neo.Wallets;
using Neo.SmartContract;
using System;

namespace Neo.UnitTests
{
Expand All @@ -30,7 +28,7 @@ public static ClaimTransaction GetClaimTransaction()
Attributes = new TransactionAttribute[0],
Inputs = new CoinReference[0],
Outputs = new TransactionOutput[0],
Scripts = new Witness[0]
Witnesses = new Witness[0]
};
}

Expand All @@ -42,48 +40,7 @@ public static MinerTransaction GetMinerTransaction()
Attributes = new TransactionAttribute[0],
Inputs = new CoinReference[0],
Outputs = new TransactionOutput[0],
Scripts = new Witness[0]
};
}

public static IssueTransaction GetIssueTransaction(bool inputVal, decimal outputVal, UInt256 assetId)
{
TestUtils.SetupTestBlockchain(assetId);

CoinReference[] inputsVal;
if (inputVal)
{
inputsVal = new[]
{
TestUtils.GetCoinReference(null)
};
}
else
{
inputsVal = new CoinReference[0];
}

return new IssueTransaction
{
Attributes = new TransactionAttribute[0],
Inputs = inputsVal,
Outputs = new[]
{
new TransactionOutput
{
AssetId = assetId,
Value = Fixed8.FromDecimal(outputVal),
ScriptHash = Contract.CreateMultiSigRedeemScript(1, TestUtils.StandbyValidators).ToScriptHash()
}
},
Scripts = new[]
{
new Witness
{
InvocationScript = new byte[0],
VerificationScript = new[] { (byte)OpCode.PUSHT }
}
}
Witnesses = new Witness[0]
};
}

Expand All @@ -97,12 +54,6 @@ public static CoinReference GetCoinReference(UInt256 prevHash)
};
}

public static void SetupTestBlockchain(UInt256 assetId)
{
Blockchain testBlockchain = new TestBlockchain(assetId);
Blockchain.RegisterBlockchain(testBlockchain);
}

public static void SetupHeaderWithValues(Header header, UInt256 val256, out UInt256 merkRootVal, out UInt160 val160, out uint timestampVal, out uint indexVal, out ulong consensusDataVal, out Witness scriptVal)
{
setupBlockBaseWithValues(header, val256, out merkRootVal, out val160, out timestampVal, out indexVal, out consensusDataVal, out scriptVal);
Expand Down Expand Up @@ -142,7 +93,7 @@ private static void setupBlockBaseWithValues(BlockBase bb, UInt256 val256, out U
InvocationScript = new byte[0],
VerificationScript = new[] { (byte)OpCode.PUSHT }
};
bb.Script = scriptVal;
bb.Witness = scriptVal;
}
}
}
7 changes: 4 additions & 3 deletions neo.UnitTests/TestVerifiable.cs
@@ -1,14 +1,15 @@
using Neo.Network.P2P.Payloads;
using Neo.Persistence;
using System;
using System.IO;
using Neo.Core;

namespace Neo.UnitTests
{
public class TestVerifiable : IVerifiable
{
private string testStr = "testStr";

public Witness[] Scripts { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public Witness[] Witnesses { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }

public int Size => throw new NotImplementedException();

Expand All @@ -27,7 +28,7 @@ public byte[] GetMessage()
throw new NotImplementedException();
}

public UInt160[] GetScriptHashesForVerifying()
public UInt160[] GetScriptHashesForVerifying(Snapshot snapshot)
{
throw new NotImplementedException();
}
Expand Down
2 changes: 1 addition & 1 deletion neo.UnitTests/UT_AccountState.cs
@@ -1,8 +1,8 @@
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Neo.Core;
using Neo.Cryptography.ECC;
using Neo.IO;
using Neo.Ledger;
using System.Collections.Generic;
using System.IO;
using System.Text;
Expand Down
3 changes: 2 additions & 1 deletion neo.UnitTests/UT_AssetState.cs
@@ -1,8 +1,9 @@
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Neo.Core;
using Neo.Cryptography.ECC;
using Neo.IO;
using Neo.Ledger;
using Neo.Network.P2P.Payloads;
using System.Globalization;
using System.IO;
using System.Text;
Expand Down