Skip to content

Commit

Permalink
chore: resolve comments
Browse files Browse the repository at this point in the history
Signed-off-by: nikolay <[email protected]>
  • Loading branch information
natanasow committed Oct 30, 2024
1 parent 8e2783b commit d519066
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Unless you need to set a non-default value, it is recommended to only populate o
| `ETH_CALL_CONSENSUS_SELECTORS` | [""] | A comma-separated list of special transaction selectors that should always be routed to the Consensus node. |
| `ETH_GET_LOGS_BLOCK_RANGE_LIMIT` | "1000" | The maximum block number range to consider during an eth_getLogs call. |
| `ETH_GET_TRANSACTION_COUNT_MAX_BLOCK_RANGE` | "1000" | The maximum number of transactions to return when running eth_getBlockByHash or eth_getBlockByNumber with transaction objects set to true call. |
| `EXCLUDED_TRANSACTION_STATUSES` | ["WRONG_NONCE", "INVALID_ACCOUNT_ID"] | The maximum number of transactions to return when running eth_getBlockByHash or eth_getBlockByNumber with transaction objects set to true call. |
| `HEDERA_SPECIFIC_REVERT_STATUSES` | ["WRONG_NONCE", "INVALID_ACCOUNT_ID"] | The maximum number of transactions to return when running eth_getBlockByHash or eth_getBlockByNumber with transaction objects set to true call. |
| `FEE_HISTORY_MAX_RESULTS` | "10" | The maximum number of results to returns as part of `eth_feeHistory`. |
| `ETH_FEE_HISTORY_FIXED` | "true" | Flag to set if eth_feeHistory should return a fixed fee for the set of results. |
| `GAS_PRICE_PERCENTAGE_BUFFER` | "0" | The additional buffer that adds a percentage on top of the calculated network gasPrice. This may be used by operators to reduce the chances of `INSUFFICIENT_TX_FEE` errors experienced by users caused by minor fluctuations in the exchange rate. |
Expand Down
4 changes: 2 additions & 2 deletions packages/config-service/src/services/globalConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ export class GlobalConfig {
required: false,
defaultValue: null,
},
EXCLUDED_TRANSACTION_STATUSES: {
envName: 'EXCLUDED_TRANSACTION_STATUSES',
HEDERA_SPECIFIC_REVERT_STATUSES: {
envName: 'HEDERA_SPECIFIC_REVERT_STATUSES',
type: 'string',
required: false,
defaultValue: '["WRONG_NONCE", "INVALID_ACCOUNT_ID"]',
Expand Down
2 changes: 0 additions & 2 deletions packages/relay/src/lib/eth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,13 @@ import {
formatContractResult,
formatTransactionIdWithoutQueryParams,
getFunctionSelector,
hexToASCII,
isHex,
isValidEthereumAddress,
nanOrNumberTo0x,
nullableNumberTo0x,
numberTo0x,
parseNumericEnvVar,
prepend0x,
strip0x,
toHash32,
trimPrecedingZeros,
weibarHexToTinyBarInt,
Expand Down
6 changes: 3 additions & 3 deletions packages/relay/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ export class Utils {
error_message: any;
}): boolean {
// @ts-ignore
const statuses = JSON.parse(ConfigService.get('EXCLUDED_TRANSACTION_STATUSES'));
const statuses = JSON.parse(ConfigService.get('HEDERA_SPECIFIC_REVERT_STATUSES'));
return (
statuses.indexOf(contractResult.result) > -1 ||
statuses.indexOf(hexToASCII(strip0x(contractResult.error_message ?? ''))) > -1
statuses.includes(contractResult.result) ||
statuses.includes(hexToASCII(strip0x(contractResult.error_message ?? '')))
);
}
}
2 changes: 1 addition & 1 deletion packages/relay/tests/lib/utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ describe('Utils', () => {
});

// @ts-ignore
JSON.parse(ConfigService.get('EXCLUDED_TRANSACTION_STATUSES')).forEach((status) => {
JSON.parse(ConfigService.get('HEDERA_SPECIFIC_REVERT_STATUSES')).forEach((status) => {
it(`should exclude transaction with result ${status}`, () => {
expect(Utils.isRevertedDueToHederaSpecificValidation({ result: status, error_message: null })).to.be.true;
});
Expand Down

0 comments on commit d519066

Please sign in to comment.