Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
xtaci committed Dec 13, 2017
1 parent 03091ea commit eff77e2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions AElf.Kernel/LiteDBDataProvider.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
using System;
using System.Threading.Tasks;
using System.Linq;
using LiteDB;

namespace AElf.Kernel
{
public class LiteDBDataProvider:IAccountDataProvider
{
class Record:ISerializable
struct Record:ISerializable

This comment has been minimized.

Copy link
@loning

loning Dec 13, 2017

Contributor

no struct, just use class

{
public IHash Key { get; set; }
public byte[] Value { get; set; }
Expand All @@ -29,7 +28,7 @@ public LiteDBDataProvider(string path)
async Task<ISerializable> IAccountDataProvider.GetAsync(IHash key)
{
var c = this.db.GetCollection<Record>("data");
Task<ISerializable> task = new Task<ISerializable>(() => c.Find(x => x.Key.Equals(key)));
Task<ISerializable> task = new Task<ISerializable>(() => c.FindOne(x => x.Key.Equals(key)));

This comment has been minimized.

Copy link
@loning

loning Dec 13, 2017

Contributor

findOne may have an async method

task.Start();
return await task;
}
Expand Down

0 comments on commit eff77e2

Please sign in to comment.