public QueryBlock GetBlock(long blockIndex, bool getTransactions = true) { Storage.Types.SyncBlockInfo block = storage.BlockGetByIndex(blockIndex); if (block == null) { return(new QueryBlock()); } var queryBlock = new QueryBlock { Symbol = chainConfiguration.Symbol, BlockHash = block.BlockHash, BlockIndex = block.BlockIndex, BlockSize = block.BlockSize, BlockTime = block.BlockTime, NextBlockHash = block.NextBlockHash, PreviousBlockHash = block.PreviousBlockHash, Synced = block.SyncComplete, TransactionCount = block.TransactionCount, Bits = block.Bits, Confirmations = block.Confirmations, Merkleroot = block.Merkleroot, Nonce = block.Nonce, PosBlockSignature = block.PosBlockSignature, PosBlockTrust = block.PosBlockTrust, PosChainTrust = block.PosChainTrust, PosFlags = block.PosFlags, PosHashProof = block.PosHashProof, PosModifierv2 = block.PosModifierv2, Version = block.Version, Transactions = Enumerable.Empty <string>() }; if (getTransactions) { IEnumerable <Storage.Types.SyncTransactionInfo> transactions = storage.BlockTransactionGetByBlockIndex(block.BlockIndex); queryBlock.Transactions = transactions.Select(s => s.TransactionHash); } return(queryBlock); }
public QueryBlock GetLastBlock(bool getTransactions = true) { var block = this.storage.BlockGetCompleteBlockCount(1).FirstOrDefault(); if (block == null) { return(new QueryBlock()); } var queryBlock = new QueryBlock { CoinTag = this.configuration.CoinTag, BlockHash = block.BlockHash, BlockIndex = block.BlockIndex, BlockSize = block.BlockSize, BlockTime = block.BlockTime, NextBlockHash = block.NextBlockHash, PreviousBlockHash = block.PreviousBlockHash, Synced = block.SyncComplete, TransactionCount = block.TransactionCount, Bits = block.Bits, Confirmations = block.Confirmations, Merkleroot = block.Merkleroot, Nonce = block.Nonce, PosBlockSignature = block.PosBlockSignature, PosBlockTrust = block.PosBlockTrust, PosChainTrust = block.PosChainTrust, PosFlags = block.PosFlags, PosHashProof = block.PosHashProof, PosModifierv2 = block.PosModifierv2, Version = block.Version, Transactions = Enumerable.Empty <string>() }; if (getTransactions) { var transactions = this.storage.BlockTransactionGetByBlockIndex(block.BlockIndex); queryBlock.Transactions = transactions.Select(s => s.TransactionHash); } return(queryBlock); }
public QueryBlocks GetBlocks(long blockIndex, int count) { var blocks = new List <QueryBlock>(); if (blockIndex == -1) { QueryBlock lastBlock = this.GetLastBlock(false); blocks.Add(lastBlock); blockIndex = lastBlock.BlockIndex - 1; count--; } for (long i = 0; i < count; i++) { blocks.Add(this.GetBlock((int)blockIndex - i, false)); } return(new QueryBlocks { Blocks = blocks }); }
public Where(QueryBlock block, Expression expr, Location loc) : base(block, expr, loc) { }
public GroupJoin(QueryBlock block, RangeVariable lt, Expression inner, QueryBlock outerSelector, QueryBlock innerSelector, RangeVariable into, Location loc) : base(block, lt, inner, outerSelector, innerSelector, loc) { this.into = into; }
//get the main queryable //for each level we have to produce a single selector expression //if the field is singular join it //if the field is a collection we need to apply a selector to the entity collection with the join condition and any additional conditions private Expression MakeQueryableExpression(IModel targetModel, Expression parentItem, QueryBlock block) { return(null); }
public override ScalarValue VisitQueryBlock(QueryBlock node) { throw new NotImplementedException(); }
public OrderByDescending(QueryBlock block, Expression expr) : base(block, expr, expr.Location) { }
public ThenByDescending(QueryBlock block, Expression expr) : base(block, expr) { }
public Join(QueryBlock block, RangeVariable lt, Expression inner, QueryBlock outerSelector, QueryBlock innerSelector, Location loc) : base(block, lt, inner, loc) { this.outer_selector = outerSelector; this.inner_selector = innerSelector; }
public SelectMany(QueryBlock block, RangeVariable identifier, Expression expr, Location loc) : base(block, identifier, expr, loc) { }
protected ARangeVariableQueryClause(QueryBlock block, RangeVariable identifier, Expression expr, Location loc) : base(block, expr, loc) { this.identifier = identifier; }
public FieldBlock(QueryBlock query, Expression expression) { _query = query; Inspect(expression); }
public ActionResult PageList(QueryBlock query) { var list = BlockManager.GetInstance().GetPageList(query); return(Json(new { data = list.DataList, pagehtml = list.PagerHtml(), index = list.Index })); }
public Select(QueryBlock block, Expression expr, Location loc) : base(block, expr, loc) { }