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);
        }
Exemple #2
0
 public async Task <ConsolidationBlock> GetLastConsolidationBlockAsync() => await StopWatcher.TrackAsync(() => _store.GetLastConsolidationBlockAsync(), StopWatcher.GetCurrentMethod()); //_store.GetSyncBlockAsync();
Exemple #3
0
 public Task <ServiceBlock> FindServiceBlockByIndexAsync(long index)
 {
     return(StopWatcher.TrackAsync(() => _store.FindServiceBlockByIndexAsync(index), StopWatcher.GetCurrentMethod()));
 }
Exemple #4
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()));
 }
Exemple #5
0
 public Task <Block> FindFirstBlockAsync(string AccountId)
 {
     return(StopWatcher.TrackAsync(() => _store.FindFirstBlockAsync(AccountId), StopWatcher.GetCurrentMethod()));
 }
Exemple #6
0
 public async Task <SendTransferBlock> FindUnsettledSendBlockAsync(string AccountId) => await StopWatcher.TrackAsync(() => _store.FindUnsettledSendBlockAsync(AccountId), StopWatcher.GetCurrentMethod());                            //_store.FindUnsettledSendBlockAsync(AccountId);
 public async Task <TransactionBlock> FindBlockByPreviousBlockHashAsync(string previousBlockHash) => await StopWatcher.TrackAsync(() => _store.FindBlockByPreviousBlockHashAsync(previousBlockHash), StopWatcher.GetCurrentMethod()); //_store.FindBlockByPreviousBlockHashAsync(previousBlockHash);
Exemple #7
0
 public async Task <TransactionBlock> FindBlockByIndexAsync(string AccountId, long index) => await StopWatcher.TrackAsync(() => _store.FindBlockByIndexAsync(AccountId, index), StopWatcher.GetCurrentMethod());                      //_store.FindBlockByIndexAsync(AccountId, index);
 public async Task <List <NonFungibleToken> > GetNonFungibleTokensAsync(string AccountId) => await StopWatcher.TrackAsync(() => _store.GetNonFungibleTokensAsync(AccountId), StopWatcher.GetCurrentMethod());                         //_store.GetNonFungibleTokensAsync(AccountId);
Exemple #8
0
 public async Task <ReceiveTransferBlock> FindBlockBySourceHashAsync(string hash) => await StopWatcher.TrackAsync(() => _store.FindBlockBySourceHashAsync(hash), StopWatcher.GetCurrentMethod());                                     //_store.FindBlockBySourceHashAsync(hash);
 public async Task <long> GetBlockCountAsync() => await StopWatcher.TrackAsync(() => _store.GetBlockCountAsync(), StopWatcher.GetCurrentMethod());                                                                                    //_store.GetBlockCountAsync();
Exemple #9
0
 public Task <PendingStats> GetPendingStatsAsync(string accountId)
 {
     return(StopWatcher.TrackAsync(() => _store.GetPendingStatsAsync(accountId), StopWatcher.GetCurrentMethod()));
 }
Exemple #10
0
 public Task <decimal> GetPendingReceiveAsync(string accountId)
 {
     return(StopWatcher.TrackAsync(() => _store.GetPendingReceiveAsync(accountId), StopWatcher.GetCurrentMethod()));
 }
Exemple #11
0
 public Task <ProfitingStats> GetBenefitStatsAsync(string pftid, string stkid, DateTime begin, DateTime end)
 {
     return(StopWatcher.TrackAsync(() => _store.GetBenefitStatsAsync(pftid, stkid, begin, end), StopWatcher.GetCurrentMethod()));
 }
Exemple #12
0
 public Task <ProfitingStats> GetAccountStatsAsync(string accountId, DateTime begin, DateTime end)
 {
     return(StopWatcher.TrackAsync(() => _store.GetAccountStatsAsync(accountId, begin, end), StopWatcher.GetCurrentMethod()));
 }
Exemple #13
0
 public async Task <ServiceBlock> GetLastServiceBlockAsync() => await StopWatcher.TrackAsync(() => _store.GetLastServiceBlockAsync(), StopWatcher.GetCurrentMethod());                   //_store.GetLastServiceBlockAsync();
Exemple #14
0
 public Task <List <StakingGenesis> > FindAllStakingAccountForOwnerAsync(string ownerAccountId)
 {
     return(StopWatcher.TrackAsync(() => _store.FindAllStakingAccountForOwnerAsync(ownerAccountId), StopWatcher.GetCurrentMethod()));
 }
Exemple #15
0
 public async Task <ConsolidationBlock> GetLastConsolidationBlockAsync() => await StopWatcher.TrackAsync(() => _store.GetLastConsolidationBlockAsync(), StopWatcher.GetCurrentMethod()); //_store.GetSyncBlockAsync();
 public async Task <List <ConsolidationBlock> > GetConsolidationBlocksAsync(long startHeight, int count) => await StopWatcher.TrackAsync(() => _store.GetConsolidationBlocksAsync(startHeight, count), StopWatcher.GetCurrentMethod());
Exemple #16
0
 public async Task <List <TokenGenesisBlock> > FindTokenGenesisBlocksAsync(string keyword) => await StopWatcher.TrackAsync(() => _store.FindTokenGenesisBlocksAsync(keyword), StopWatcher.GetCurrentMethod());                        //_store.FindTokenGenesisBlocksAsync(keyword);
 public async Task <TokenGenesisBlock> FindTokenGenesisBlockAsync(string Hash, string Ticker) => await StopWatcher.TrackAsync(() => _store.FindTokenGenesisBlockAsync(Hash, Ticker), StopWatcher.GetCurrentMethod());                 //_store.FindTokenGenesisBlockAsync(Hash, Ticker);
Exemple #17
0
 public async Task <TokenGenesisBlock> FindTokenGenesisBlockAsync(string Hash, string Ticker) => await StopWatcher.TrackAsync(() => _store.FindTokenGenesisBlockAsync(Hash, Ticker), StopWatcher.GetCurrentMethod());                 //_store.FindTokenGenesisBlockAsync(Hash, Ticker);
 public async Task <ReceiveTransferBlock> FindBlockBySourceHashAsync(string hash) => await StopWatcher.TrackAsync(() => _store.FindBlockBySourceHashAsync(hash), StopWatcher.GetCurrentMethod());                                     //_store.FindBlockBySourceHashAsync(hash);
Exemple #18
0
 public Task <List <TransactionBlock> > GetAllDexWalletsAsync(string owner)
 {
     return(StopWatcher.TrackAsync(() => _store.GetAllDexWalletsAsync(owner), StopWatcher.GetCurrentMethod()));
 }
Exemple #19
0
 public async Task <long> GetBlockCountAsync() => await StopWatcher.TrackAsync(() => _store.GetBlockCountAsync(), StopWatcher.GetCurrentMethod());                                                                                    //_store.GetBlockCountAsync();
 public async Task <TransactionBlock> FindBlockByIndexAsync(string AccountId, long index) => await StopWatcher.TrackAsync(() => _store.FindBlockByIndexAsync(AccountId, index), StopWatcher.GetCurrentMethod());                      //_store.FindBlockByIndexAsync(AccountId, index);
Exemple #20
0
 public Task <TransactionBlock> FindDexWalletAsync(string owner, string symbol, string provider)
 {
     return(StopWatcher.TrackAsync(() => _store.FindDexWalletAsync(owner, symbol, provider), StopWatcher.GetCurrentMethod()));
 }
Exemple #21
0
 public async Task <List <NonFungibleToken> > GetNonFungibleTokensAsync(string AccountId) => await StopWatcher.TrackAsync(() => _store.GetNonFungibleTokensAsync(AccountId), StopWatcher.GetCurrentMethod());                         //_store.GetNonFungibleTokensAsync(AccountId);
 public async Task <SendTransferBlock> FindUnsettledSendBlockAsync(string AccountId) => await StopWatcher.TrackAsync(() => _store.FindUnsettledSendBlockAsync(AccountId), StopWatcher.GetCurrentMethod());                            //_store.FindUnsettledSendBlockAsync(AccountId);
Exemple #22
0
        public async Task <ServiceBlock> GetLastServiceBlockAsync() => await StopWatcher.TrackAsync(() => _store.GetLastServiceBlockAsync(), StopWatcher.GetCurrentMethod());                   //_store.GetLastServiceBlockAsync();

        // forward api. should have more control here.
        public async Task <bool> AddBlockAsync(Block block) => await StopWatcher.TrackAsync(() => _store.AddBlockAsync(block), StopWatcher.GetCurrentMethod());
Exemple #23
0
 public Task <long> GetBlockCountAsync(string AccountId)
 {
     return(StopWatcher.TrackAsync(() => _store.GetBlockCountAsync(AccountId), StopWatcher.GetCurrentMethod()));
 }
Exemple #24
0
 public async Task <Block> FindBlockByHeightAsync(string AccountId, long height) => await StopWatcher.TrackAsync(() => _store.FindBlockByHeightAsync(AccountId, height), StopWatcher.GetCurrentMethod());                             //_store.FindLatestBlockAsync(AccountId);
 public async Task <bool> AccountExistsAsync(string AccountId) => await StopWatcher.TrackAsync(() => _store.AccountExistsAsync(AccountId), StopWatcher.GetCurrentMethod());                                                           //_store.AccountExistsAsync(AccountId);
Exemple #25
0
 public Task <List <NonFungibleToken> > GetIssuedNFTInstancesAsync(bool GetOnlySendBlocks, string AccountId, string TokenCode)
 {
     return(StopWatcher.TrackAsync(() => _store.GetIssuedNFTInstancesAsync(GetOnlySendBlocks, AccountId, TokenCode), StopWatcher.GetCurrentMethod()));
 }
Exemple #26
0
 public async Task <Block> FindLatestBlockAsync() => await StopWatcher.TrackAsync(() => _store.FindLatestBlockAsync(), StopWatcher.GetCurrentMethod());                                                                               //_store.FindLatestBlockAsync();
 public async Task <Block> FindLatestBlockAsync(string AccountId) => await StopWatcher.TrackAsync(() => _store.FindLatestBlockAsync(AccountId), StopWatcher.GetCurrentMethod());                                                      //_store.FindLatestBlockAsync(AccountId);
Exemple #27
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()));
 }
Exemple #28
0
 public async Task <Block> FindBlockByHashAsync(string hash) => await StopWatcher.TrackAsync(() => _store.FindBlockByHashAsync(hash), StopWatcher.GetCurrentMethod());                                                                //_store.FindBlockByHashAsync(hash);
 public async Task <Block> FindBlockByHashAsync(string AccountId, string hash) => await StopWatcher.TrackAsync(() => _store.FindBlockByHashAsync(AccountId, hash), StopWatcher.GetCurrentMethod());                                   //_store.FindBlockByHashAsync(AccountId, hash);
Exemple #29
0
 public Task <SendTransferBlock> FindUnsettledSendBlockByDestinationAccountIdAsync(string AccountId)
 {
     return(StopWatcher.TrackAsync(() => _store.FindUnsettledSendBlockByDestinationAccountIdAsync(AccountId), StopWatcher.GetCurrentMethod()));
 }
Exemple #30
0
 public async Task <Block> FindBlockByHashAsync(string AccountId, string hash) => await StopWatcher.TrackAsync(() => _store.FindBlockByHashAsync(AccountId, hash), StopWatcher.GetCurrentMethod());                                   //_store.FindBlockByHashAsync(AccountId, hash);
 public async Task <List <TokenGenesisBlock> > FindTokenGenesisBlocksAsync(string keyword) => await StopWatcher.TrackAsync(() => _store.FindTokenGenesisBlocksAsync(keyword), StopWatcher.GetCurrentMethod());                        //_store.FindTokenGenesisBlocksAsync(keyword);