Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,757 changes: 2,147 additions & 610 deletions package-lock.json

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@
"@multiversx/sdk-core": "^13.2.2",
"@multiversx/sdk-data-api-client": "^0.7.0",
"@multiversx/sdk-exchange": "^0.2.21",
"@multiversx/sdk-nestjs-auth": "5.0.0",
"@multiversx/sdk-nestjs-cache": "5.0.0",
"@multiversx/sdk-nestjs-common": "5.0.0",
"@multiversx/sdk-nestjs-elastic": "5.0.0",
"@multiversx/sdk-nestjs-http": "5.0.0",
"@multiversx/sdk-nestjs-monitoring": "5.0.0",
"@multiversx/sdk-nestjs-rabbitmq": "5.0.0",
"@multiversx/sdk-nestjs-redis": "5.0.0",
"@multiversx/sdk-nestjs-auth": "6.0.0",
"@multiversx/sdk-nestjs-cache": "6.0.0",
"@multiversx/sdk-nestjs-common": "6.0.0",
"@multiversx/sdk-nestjs-elastic": "6.0.0",
"@multiversx/sdk-nestjs-http": "6.0.0",
"@multiversx/sdk-nestjs-monitoring": "6.0.0",
"@multiversx/sdk-nestjs-rabbitmq": "6.0.0",
"@multiversx/sdk-nestjs-redis": "6.0.0",
"@multiversx/sdk-transaction-processor": "^0.1.35",
"@nestjs/apollo": "12.0.11",
"@nestjs/common": "10.2.0",
Expand Down
4 changes: 2 additions & 2 deletions src/common/pubsub/pub.sub.listener.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ export class PubSubListenerController {
) { }

@EventPattern('deleteCacheKeys')
async deleteCacheKey(keys: string[]) {
deleteCacheKey(keys: string[]) {
for (const key of keys) {
this.logger.log(`Deleting local cache key ${key}`);
await this.cachingService.deleteLocal(key);
this.cachingService.deleteLocal(key);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/common/rabbitmq/rabbitmq.nft.handler.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class RabbitMqNftHandlerService {
) { }

private async getCollectionType(collectionIdentifier: string): Promise<NftType | null> {
const type = await this.cachingService.getLocal<NftType>(CacheInfo.CollectionType(collectionIdentifier).key) ??
const type = this.cachingService.getLocal<NftType>(CacheInfo.CollectionType(collectionIdentifier).key) ??
await this.getCollectionTypeRaw(collectionIdentifier);

if (!type) {
Expand Down
4 changes: 2 additions & 2 deletions src/endpoints/caching/local.cache.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class LocalCacheController {
status: 404,
description: 'Key not found',
})
async delCache(@Param('key') key: string) {
await this.cachingService.deleteLocal(key);
delCache(@Param('key') key: string) {
this.cachingService.deleteLocal(key);
}
}
2 changes: 1 addition & 1 deletion src/endpoints/esdt/esdt.address.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ export class EsdtAddressService {
return result;
}

const cachedValue = await this.cachingService.getLocal<{ [key: string]: any }>(`address:${address}:esdts`);
const cachedValue = this.cachingService.getLocal<{ [key: string]: any }>(`address:${address}:esdts`);

if (cachedValue) {
this.metricsService.incrementCachedApiHit('Gateway.AccountEsdts');
Expand Down
2 changes: 1 addition & 1 deletion src/endpoints/mex/mex.settings.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class MexSettingsService {
}

async getMexContracts(): Promise<Set<string>> {
let contracts = await this.cachingService.getLocal<Set<string>>(CacheInfo.MexContracts.key);
let contracts = this.cachingService.getLocal<Set<string>>(CacheInfo.MexContracts.key);
if (!contracts) {
contracts = await this.getMexContractsRaw();
this.cachingService.setLocal(CacheInfo.MexContracts.key, contracts, Constants.oneMinute() * 10);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class StakeActionRecognizerService implements TransactionActionRecognizer
) { }

private async getProviders(): Promise<{ [key: string]: { providerName: string, providerAvatar: string } }> {
let providersDetails = await this.cachingService.getLocal<{ [key: string]: { providerName: string, providerAvatar: string } }>('plugins:staking:providerAddresses');
let providersDetails = this.cachingService.getLocal<{ [key: string]: { providerName: string, providerAvatar: string } }>('plugins:staking:providerAddresses');
if (!providersDetails) {
const providers = await this.providerService.getAllProviders();
const identities = await this.identitiesService.getAllIdentities();
Expand Down
6 changes: 3 additions & 3 deletions src/test/unit/services/blocks.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ describe('Block Service', () => {

const blses = ['bls_key_0', 'bls_key_1', 'bls_key_2'];

jest.spyOn(cacheService, 'getLocal').mockImplementation(() => Promise.resolve(blses));
jest.spyOn(cacheService, 'getLocal').mockImplementation(() => blses);
jest.spyOn(blsService, 'getPublicKeys').mockImplementation(() => Promise.resolve(blses));

const result = await blockService.computeProposerAndValidators(inputItem);
Expand All @@ -253,8 +253,8 @@ describe('Block Service', () => {

const blses = ['bls_key_0', 'bls_key_1', 'bls_key_2'];

jest.spyOn(cacheService, 'getLocal').mockImplementationOnce(() => Promise.resolve(null));
jest.spyOn(cacheService, 'setLocal').mockImplementation(() => Promise.resolve());
jest.spyOn(cacheService, 'getLocal').mockImplementationOnce(() => null);
jest.spyOn(cacheService, 'setLocal').mockImplementation();
jest.spyOn(blsService, 'getPublicKeys').mockImplementation(() => Promise.resolve(blses));

await blockService.computeProposerAndValidators(inputItem);
Expand Down
4 changes: 2 additions & 2 deletions src/test/unit/services/esdt.address.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ describe('EsdtAddressService', () => {
},
};

jest.spyOn(cacheService, 'getLocal').mockResolvedValue(cachedEsdts);
jest.spyOn(cacheService, 'getLocal').mockReturnValue(cachedEsdts);
jest.spyOn(metricsService, 'incrementCachedApiHit');

const result = await service.getAllEsdtsForAddressFromGateway(address);
Expand All @@ -224,7 +224,7 @@ describe('EsdtAddressService', () => {
const address = 'some-address';
const ttl = 1000;

jest.spyOn(cacheService, 'getLocal').mockResolvedValueOnce(null);
jest.spyOn(cacheService, 'getLocal').mockReturnValueOnce(null);
jest.spyOn(cacheService, 'setLocal');
jest.spyOn(protocolService, 'getSecondsRemainingUntilNextRound').mockResolvedValue(ttl);

Expand Down