Skip to content

Commit

Permalink
Merge branch 'main' into '3042-Update-eth_getTransactionByBlockHashOr…
Browse files Browse the repository at this point in the history
…BlockNumAndIndex'

Signed-off-by: Victor Yanev <[email protected]>
  • Loading branch information
victor-yanev committed Oct 3, 2024
2 parents c989ae6 + f1794d8 commit 5a1c6a0
Show file tree
Hide file tree
Showing 129 changed files with 4,598 additions and 3,506 deletions.
107 changes: 6 additions & 101 deletions dapp-example/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 13 additions & 13 deletions docs/design/distributed-cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ Important details is that, if an operator does not want to use Redis or it went

```javascript
interface ICacheClient {
get(key: string, callingMethod: string, requestIdPrefix?: string): any;
set(key: string, value: any, callingMethod: string, ttl?: number, requestIdPrefix?: string): void;
delete(key: string, callingMethod: string, requestIdPrefix?: string): void;
get(key: string, callingMethod: string, requestDetails: RequestDetails): any;
set(key: string, value: any, callingMethod: string, ttl?: number, requestDetails: RequestDetails): void;
delete(key: string, callingMethod: string, requestDetails: RequestDetails): void;
clear(): void;
}
```
Expand All @@ -40,15 +40,15 @@ class LocalLRUCache implements ICacheClient{
public constructor() {
this.cache = new LRU(this.options);
}
get(key: string, callingMethod: string, requestIdPrefix?: string) {
get(key: string, callingMethod: string, requestDetails: RequestDetails) {
// Get item from internal cache implementation
}

set(key: string, value: any, callingMethod: string, ttl?: number, requestIdPrefix?: string) {
set(key: string, value: any, callingMethod: string, requestDetails: RequestDetails, ttl?: number) {
// Set item to internal cache implementation
}

delete(key: string, callingMethod: string, requestIdPrefix?: string) {
delete(key: string, callingMethod: string, requestDetails: RequestDetails) {
// Delete item from internal cache implementation
}

Expand Down Expand Up @@ -81,15 +81,15 @@ class RedisCache implements ICacheClient{

this.cache = client;
}
get(key: string, callingMethod: string, requestIdPrefix?: string) {
get(key: string, callingMethod: string, requestDetails: RequestDetails) {
// Get item from shared cache implementation
}

set(key: string, value: any, callingMethod: string, ttl?: number, requestIdPrefix?: string) {
set(key: string, value: any, callingMethod: string, requestDetails: RequestDetails, ttl?: number) {
// Set item to shared cache implementation
}

delete(key: string, callingMethod: string, requestIdPrefix?: string) {
delete(key: string, callingMethod: string, requestDetails: RequestDetails) {
// Delete item from shared cache implementation
}

Expand Down Expand Up @@ -120,25 +120,25 @@ class CacheClientService{
const sharedCache = new RedisCache();
}

get(key: string, callingMethod: string, requestIdPrefix?: string, shared: boolean = false) {
get(key: string, callingMethod: string, requestDetails: RequestDetails, shared: boolean = false) {
// Depending on the shared boolean, this method decide from where it should request the data.
// Fallbacks to internalCache in case of error from the shared cache.
// Getting from shared cache depends on REDIS_ENABLED env. variable
}

set(key: string, value: any, callingMethod: string, ttl?: number, requestIdPrefix?: string, shared: boolean = false) {
set(key: string, value: any, callingMethod: string, requestDetails: RequestDetails, ttl?: number, shared: boolean = false) {
// Depending on the shared boolean, this method decide where it should save the data.
// Fallbacks to internalCache in case of error from the shared cache.
// Setting to shared cache depends on REDIS_ENABLED env. variable
}

delete(key: string, callingMethod: string, requestIdPrefix?: string, shared: boolean = false) {
delete(key: string, callingMethod: string, requestDetails: RequestDetails, shared: boolean = false) {
// Depending on the shared boolean, this method decide from where it should delete the data.
// Fallbacks to internalCache in case of error from the shared cache.
// Deleting from shared cache depends on REDIS_ENABLED env. variable
}

clear(shared: boolean = false) {
clear(requestDetails: RequestDetails, shared: boolean = false) {
// In case of error does NOT fallback to shared cache.
// Clearing from shared cache depends on REDIS_ENABLED env. variable
}
Expand Down
14 changes: 14 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"@types/find-config": "^1.0.4",
"@types/koa-cors": "^0.0.6",
"@types/sinon": "^10.0.20",
"@types/lodash": "^4.17.7",
"@typescript-eslint/eslint-plugin": "^6.5.0",
"@typescript-eslint/parser": "^6.5.0",
"ajv": "^8.16.0",
Expand Down
2 changes: 0 additions & 2 deletions packages/relay/src/formatters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
import crypto from 'crypto';
import constants from './lib/constants';
import { BigNumber as BN } from 'bignumber.js';
import { TransactionRecord } from '@hashgraph/sdk';
import { BigNumber } from '@hashgraph/sdk/lib/Transfer';
import { MirrorNodeTransactionRecord } from './lib/types/mirrorNode';
import { Transaction, Transaction1559, Transaction2930 } from './lib/model';

const EMPTY_HEX = '0x';
Expand Down
Loading

0 comments on commit 5a1c6a0

Please sign in to comment.