protected virtual async Task <APIResultCodes> AuthorizeImplAsync <T>(DagSystem sys, T tblock) where T : Block
        {
            var prevBlock = await sys.Storage.FindBlockByHashAsync(tblock.PreviousHash);

            var result = await StopWatcher.TrackAsync(() => VerifyWithPrevAsync(sys, tblock, prevBlock), "VerifyWithPrevAsync");

            return(result);
        }
Exemplo n.º 2
0
 public Task <List <TransactionBlock> > FindOtcTradeForOrderAsync(string orderid)
 {
     return(StopWatcher.Track(() => _store.FindOtcTradeForOrderAsync(orderid), "FindOtcTradeForOrder"));
 }
Exemplo n.º 3
0
 public async Task <List <NonFungibleToken> > GetNonFungibleTokensAsync(string AccountId) => await StopWatcher.Track(_store.GetNonFungibleTokensAsync(AccountId), StopWatcher.GetCurrentMethod());                         //_store.GetNonFungibleTokensAsync(AccountId);
 public async Task <SendTransferBlock> FindUnsettledSendBlockAsync(string AccountId) => await StopWatcher.Track(_store.FindUnsettledSendBlockAsync(AccountId), StopWatcher.GetCurrentMethod());                            //_store.FindUnsettledSendBlockAsync(AccountId);
Exemplo n.º 4
0
 public async Task <long> GetBlockCountAsync() => await StopWatcher.Track(_store.GetBlockCountAsync(), StopWatcher.GetCurrentMethod());                                                                                    //_store.GetBlockCountAsync();
 public async Task <TransactionBlock> FindBlockByIndexAsync(string AccountId, long index) => await StopWatcher.Track(_store.FindBlockByIndexAsync(AccountId, index), StopWatcher.GetCurrentMethod());                      //_store.FindBlockByIndexAsync(AccountId, index);
Exemplo n.º 5
0
 public async Task <TokenGenesisBlock> FindTokenGenesisBlockAsync(string Hash, string Ticker) => await StopWatcher.Track(_store.FindTokenGenesisBlockAsync(Hash, Ticker), StopWatcher.GetCurrentMethod());                 //_store.FindTokenGenesisBlockAsync(Hash, Ticker);
 public async Task <ReceiveTransferBlock> FindBlockBySourceHashAsync(string hash) => await StopWatcher.Track(_store.FindBlockBySourceHashAsync(hash), StopWatcher.GetCurrentMethod());                                     //_store.FindBlockBySourceHashAsync(hash);
Exemplo n.º 6
0
 public async Task <Block> FindBlockByHashAsync(string AccountId, string hash) => await StopWatcher.Track(_store.FindBlockByHashAsync(AccountId, hash), StopWatcher.GetCurrentMethod());                                   //_store.FindBlockByHashAsync(AccountId, hash);
 public async Task <List <TokenGenesisBlock> > FindTokenGenesisBlocksAsync(string keyword) => await StopWatcher.Track(_store.FindTokenGenesisBlocksAsync(keyword), StopWatcher.GetCurrentMethod());                        //_store.FindTokenGenesisBlocksAsync(keyword);
Exemplo n.º 7
0
 public async Task <Block> FindLatestBlockAsync(string AccountId) => await StopWatcher.Track(_store.FindLatestBlockAsync(AccountId), StopWatcher.GetCurrentMethod());                                                      //_store.FindLatestBlockAsync(AccountId);
 public async Task <NullTransactionBlock> FindNullTransBlockByHashAsync(string hash) => await StopWatcher.Track(_store.FindNullTransBlockByHashAsync(hash), StopWatcher.GetCurrentMethod());                               //_store.FindNullTransBlockByHashAsync(hash);
Exemplo n.º 8
0
 public async Task <bool> AccountExistsAsync(string AccountId) => await StopWatcher.Track(_store.AccountExistsAsync(AccountId), StopWatcher.GetCurrentMethod());                                                           //_store.AccountExistsAsync(AccountId);
 public async Task <Block> FindLatestBlockAsync() => await StopWatcher.Track(_store.FindLatestBlockAsync(), StopWatcher.GetCurrentMethod());                                                                               //_store.FindLatestBlockAsync();
Exemplo n.º 9
0
 public Task <bool> DoesAccountHaveCollectibleNFTInstanceAsync(string owner_account_id, TokenGenesisBlock token_block, string serial_number)
 {
     return(StopWatcher.TrackAsync(() => _store.DoesAccountHaveCollectibleNFTInstanceAsync(owner_account_id, token_block, serial_number), StopWatcher.GetCurrentMethod()));
 }
Exemplo n.º 10
0
 public Task <List <NonFungibleToken> > GetIssuedNFTInstancesAsync(bool GetOnlySendBlocks, string AccountId, string TokenCode)
 {
     return(StopWatcher.TrackAsync(() => _store.GetIssuedNFTInstancesAsync(GetOnlySendBlocks, AccountId, TokenCode), StopWatcher.GetCurrentMethod()));
 }
Exemplo n.º 11
0
 public Block FindBlockByHash(string hash)
 {
     return(StopWatcher.Track(() => _store.FindBlockByHash(hash), "FindBlockByHash"));
 }
Exemplo n.º 12
0
 public TransactionBlock FindFirstBlock(string AccountId)
 {
     return(StopWatcher.Track(() => _store.FindFirstBlock(AccountId), "FindFirstBlock"));
 }
Exemplo n.º 13
0
 public Task <Block> FindFirstBlockAsync(string AccountId)
 {
     return(StopWatcher.TrackAsync(() => _store.FindFirstBlockAsync(AccountId), StopWatcher.GetCurrentMethod()));
 }
Exemplo n.º 14
0
 public Task <long> GetBlockCountAsync(string AccountId)
 {
     return(StopWatcher.TrackAsync(() => _store.GetBlockCountAsync(AccountId), StopWatcher.GetCurrentMethod()));
 }
Exemplo n.º 15
0
 public async Task <Block> FindLatestBlockAsync(string AccountId) => await StopWatcher.TrackAsync(() => _store.FindLatestBlockAsync(AccountId), StopWatcher.GetCurrentMethod());                                                      //_store.FindLatestBlockAsync(AccountId);
 public async Task <Block> FindBlockByHashAsync(string hash) => await StopWatcher.TrackAsync(() => _store.FindBlockByHashAsync(hash), StopWatcher.GetCurrentMethod());                                                                //_store.FindBlockByHashAsync(hash);
Exemplo n.º 16
0
        internal async Task <ServiceBlock> GetLastServiceBlockAsync() => await StopWatcher.Track(_store.GetLastServiceBlockAsync(), StopWatcher.GetCurrentMethod());                   //_store.GetLastServiceBlockAsync();

        // forward api. should have more control here.
        public async Task <bool> AddBlockAsync(Block block) => await StopWatcher.Track(AddBlockImplAsync(block), StopWatcher.GetCurrentMethod());
Exemplo n.º 17
0
        //public async Task AddBlockAsync(ServiceBlock serviceBlock) => await StopWatcher.Track(_store.AddBlockAsync(serviceBlock), StopWatcher.GetCurrentMethod());//_store.AddBlockAsync(serviceBlock);

        // bellow readonly access
        public async Task <bool> AccountExistsAsync(string AccountId) => await StopWatcher.Track(_store.AccountExistsAsync(AccountId), StopWatcher.GetCurrentMethod());                                                           //_store.AccountExistsAsync(AccountId);
Exemplo n.º 18
0
 public Task <List <TransactionDescription> > SearchTransactionsAsync(string accountId, DateTime startTime, DateTime endTime, int count)
 {
     return(StopWatcher.TrackAsync(() => _store.SearchTransactionsAsync(accountId, startTime, endTime, count), StopWatcher.GetCurrentMethod()));
 }
Exemplo n.º 19
0
 public async Task <Block> FindLatestBlockAsync() => await StopWatcher.Track(_store.FindLatestBlockAsync(), StopWatcher.GetCurrentMethod());                                                                               //_store.FindLatestBlockAsync();
 public async Task <Block> FindLatestBlockAsync(string AccountId) => await StopWatcher.Track(_store.FindLatestBlockAsync(AccountId), StopWatcher.GetCurrentMethod());                                                      //_store.FindLatestBlockAsync(AccountId);
Exemplo n.º 20
0
 public Task <ServiceBlock> FindServiceBlockByIndexAsync(long index)
 {
     return(StopWatcher.TrackAsync(() => _store.FindServiceBlockByIndexAsync(index), StopWatcher.GetCurrentMethod()));
 }
Exemplo n.º 21
0
 public async Task <Block> FindBlockByHashAsync(string hash) => await StopWatcher.Track(_store.FindBlockByHashAsync(hash), StopWatcher.GetCurrentMethod());                                                                //_store.FindBlockByHashAsync(hash);
 public async Task <Block> FindBlockByHashAsync(string AccountId, string hash) => await StopWatcher.Track(_store.FindBlockByHashAsync(AccountId, hash), StopWatcher.GetCurrentMethod());                                   //_store.FindBlockByHashAsync(AccountId, hash);
Exemplo n.º 22
0
 public Task <SendTransferBlock> FindUnsettledSendBlockByDestinationAccountIdAsync(string AccountId)
 {
     return(StopWatcher.TrackAsync(() => _store.FindUnsettledSendBlockByDestinationAccountIdAsync(AccountId), StopWatcher.GetCurrentMethod()));
 }
Exemplo n.º 23
0
 public async Task <List <TokenGenesisBlock> > FindTokenGenesisBlocksAsync(string keyword) => await StopWatcher.Track(_store.FindTokenGenesisBlocksAsync(keyword), StopWatcher.GetCurrentMethod());                        //_store.FindTokenGenesisBlocksAsync(keyword);
 public async Task <TokenGenesisBlock> FindTokenGenesisBlockAsync(string Hash, string Ticker) => await StopWatcher.Track(_store.FindTokenGenesisBlockAsync(Hash, Ticker), StopWatcher.GetCurrentMethod());                 //_store.FindTokenGenesisBlockAsync(Hash, Ticker);
Exemplo n.º 24
0
 public async Task <IEnumerable <string> > GetAllUnConsolidatedBlocksAsync() => await StopWatcher.Track(_store.GetAllUnConsolidatedBlocks(), StopWatcher.GetCurrentMethod());
Exemplo n.º 25
0
 public async Task <ReceiveTransferBlock> FindBlockBySourceHashAsync(string hash) => await StopWatcher.Track(_store.FindBlockBySourceHashAsync(hash), StopWatcher.GetCurrentMethod());                                     //_store.FindBlockBySourceHashAsync(hash);
 public async Task <long> GetBlockCountAsync() => await StopWatcher.Track(_store.GetBlockCountAsync(), StopWatcher.GetCurrentMethod());                                                                                    //_store.GetBlockCountAsync();
Exemplo n.º 26
0
 internal async Task <ConsolidationBlock> GetLastConsolidationBlockAsync() => await StopWatcher.Track(_store.GetLastConsolidationBlockAsync(), StopWatcher.GetCurrentMethod()); //_store.GetSyncBlockAsync();
Exemplo n.º 27
0
 public async Task <TransactionBlock> FindBlockByIndexAsync(string AccountId, long index) => await StopWatcher.Track(_store.FindBlockByIndexAsync(AccountId, index), StopWatcher.GetCurrentMethod());                      //_store.FindBlockByIndexAsync(AccountId, index);
 public async Task <List <NonFungibleToken> > GetNonFungibleTokensAsync(string AccountId) => await StopWatcher.Track(_store.GetNonFungibleTokensAsync(AccountId), StopWatcher.GetCurrentMethod());                         //_store.GetNonFungibleTokensAsync(AccountId);
Exemplo n.º 28
0
 internal async Task <ConsolidationBlock> GetLastConsolidationBlockAsync() => await StopWatcher.Track(_store.GetLastConsolidationBlockAsync(), StopWatcher.GetCurrentMethod()); //_store.GetSyncBlockAsync();
 public async Task <List <ConsolidationBlock> > GetConsolidationBlocksAsync(long startHeight) => await StopWatcher.Track(_store.GetConsolidationBlocksAsync(startHeight), StopWatcher.GetCurrentMethod());
Exemplo n.º 29
0
 public async Task <SendTransferBlock> FindUnsettledSendBlockAsync(string AccountId) => await StopWatcher.Track(_store.FindUnsettledSendBlockAsync(AccountId), StopWatcher.GetCurrentMethod());                            //_store.FindUnsettledSendBlockAsync(AccountId);
 public async Task <TransactionBlock> FindBlockByPreviousBlockHashAsync(string previousBlockHash) => await StopWatcher.Track(_store.FindBlockByPreviousBlockHashAsync(previousBlockHash), StopWatcher.GetCurrentMethod()); //_store.FindBlockByPreviousBlockHashAsync(previousBlockHash);
Exemplo n.º 30
0
 internal async Task <ServiceBlock> GetLastServiceBlockAsync() => await StopWatcher.Track(_store.GetLastServiceBlockAsync(), StopWatcher.GetCurrentMethod());                   //_store.GetLastServiceBlockAsync();