Skip to content

Commit

Permalink
Code cleanup, remove unused Exception and move ISerializable to its o…
Browse files Browse the repository at this point in the history
…wn file
  • Loading branch information
samfrb committed Feb 2, 2018
1 parent 5c88f12 commit 9533f1c
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 20 deletions.
9 changes: 0 additions & 9 deletions AElf.Kernel/AELFException.cs

This file was deleted.

6 changes: 0 additions & 6 deletions AElf.Kernel/IAccountDataProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@

namespace AElf.Kernel
{

public interface ISerializable
{
byte[] Serialize();
}

/// <summary>
/// Data is stored associated with Account
/// </summary>
Expand Down
7 changes: 7 additions & 0 deletions AElf.Kernel/ISerializable.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace AElf.Kernel
{
public interface ISerializable
{
byte[] Serialize();
}
}
1 change: 0 additions & 1 deletion AElf.Kernel/KernelAccount/SmartContractInvokerZero.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ namespace AElf.Kernel.KernelAccount
{
public class SmartContractInvokerZero : ISmartContractInvoker
{

private SmartContractZero _contract;
private readonly string _methodName;
private readonly object[] _objs;
Expand Down
7 changes: 4 additions & 3 deletions AElf.Kernel/Merkle/MerkleNode.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
Expand Down Expand Up @@ -43,7 +44,7 @@ public void SetLeftNode(MerkleNode left)
{
if (left.Hash == null)
{
throw new AELFException("Merkle node did not initialized.");
throw new InvalidOperationException("Merkle node did not initialized.");
}
LeftNode = left;
LeftNode.ParentNode = this;
Expand All @@ -58,7 +59,7 @@ public void SetRightNode(MerkleNode right)
{
if (right.Hash == null)
{
throw new AELFException("Merkle node did not initialized.");
throw new InvalidOperationException("Merkle node did not initialized.");
}
RightNode = right;
RightNode.ParentNode = this;
Expand Down
2 changes: 1 addition & 1 deletion AElf.Kernel/Merkle/MerkleTree.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public IHash<IMerkleTree<T>> ComputeRootHash(List<IHash<T>> hashes)
{
if (hashes.Count < 1)
{
throw new AELFException("Cannot generate merkle tree without any nodes.");
throw new InvalidOperationException("Cannot generate merkle tree without any nodes.");
}

if (hashes.Count == 1)//Finally
Expand Down

0 comments on commit 9533f1c

Please sign in to comment.