test: integration test with contract deployment, adding interactions and reading state

This commit is contained in:
ppedziwiatr
2021-09-06 13:34:59 +02:00
committed by Piotr Pędziwiatr
parent 3e71792b57
commit 38287bcb94
6 changed files with 128 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
import { BlockHeightKey, BlockHeightSwCache, GQLEdgeInterface, InteractionsLoader, LoggerFactory } from '@smartweave';
/**
* This implementation InteractionsLoader tries to limit the amount of interactions
* This implementation of the {@link InteractionsLoader} tries to limit the amount of interactions
* with GraphQL endpoint. Additionally, it is downloading only the missing interactions
* (starting from the latest already cached) - to additionally limit the amount of "paging".
*/
@@ -33,6 +33,11 @@ export class CacheableContractInteractionsLoader implements InteractionsLoader {
);
}
this.logger.trace('Cached:', {
cachedHeight,
cachedValue
});
const missingInteractions = await this.baseImplementation.load(contractId, cachedHeight + 1, toBlockHeight);
const result = cachedValue