-
Notifications
You must be signed in to change notification settings - Fork 264
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
Basic implementation of World State. #40
Conversation
@EanCuznaivy Hi, I have changed dev and merge my codes, can you merge some code from dev? |
@loning Let me see... |
# Conflicts: # AElf.Kernel/Chain.cs # AElf.Kernel/ChainManager.cs # AElf.Kernel/IAccountDataProvider.cs # AElf.Kernel/IDataProvider.cs # AElf.Kernel/ISmartContract.cs # AElf.Kernel/KernelAccount/SmartContractZero.cs # AElf.Kernel/Merkle/BinaryMerkleNode.cs
@loning Finally fixed the conflicts :) |
{ | ||
public static class SerializationExtensions | ||
{ | ||
public static byte[] Serialize(this object obj) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ISerializable a;
ojbect b= (object)a;
ISeralizable c = (ISeralizable) b;
var bytes= c.GetBytes();
var d=bytes.ToObject(); //Deseralize
AElf.Kernel/Hash.cs
Outdated
|
||
namespace AElf.Kernel | ||
{ | ||
[Serializable] | ||
public class Hash<T> : IHash<T> | ||
public class Hash<T> : IHash<T>, IComparer<Hash<T>> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interface IHash: IComparer<Hash>{
}
AElf.Kernel/Hash.cs
Outdated
@@ -24,5 +23,15 @@ public Hash():this(new byte[32]) | |||
public byte[] GetHashBytes() => Value; | |||
|
|||
public bool Equals(IHash other) => Value == other.GetHashBytes(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need compare every bytes, not just compare the reference
AElf.Kernel/Hash.cs
Outdated
|
||
public int Compare(Hash<T> x, Hash<T> y) | ||
{ | ||
if (x.ToString() == y.ToString()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not use ToString();
AElf.Kernel/IAccountDataProvider.cs
Outdated
@@ -6,7 +6,7 @@ namespace AElf.Kernel | |||
/// <summary> | |||
/// Data is stored associated with Account | |||
/// </summary> | |||
public interface IAccountDataProvider | |||
public interface IAccountDataProvider : ISerializable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Data Provider is a Driver, should not be ISerializable, it's just a tool for data access
💸💴💵💰 |
вт, 6 февр. 2018 г. в 00:05, samsoull <notifications@github.com>:
💸💴💵💰
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#40 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AiRYj1xpanznW0vY5cCukhSZ1liWbdRjks5tR3spgaJpZM4R2wLq>
.
Thanks!!
|
Thank you for subscribing me |
And slightly modify the structure about Block.