-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: new
DENCUN_FORK_EPOCH
env variable
Add a new `DENCUN_FORK_EPOCH` environmental variable that allows users to set the custom epoch number of the Dencun fork for networks other than officially supported ones (Mainnet, Goerli, and Holesky). Add the appropriate validation for this environmental variable. It is possible not to set a value for the `DENCUN_FORK_EPOCH` variable if the `ETH_NETWORK` is Mainnet, Goerli, or Holesky. Even if the `ETH_NETWORK` is one of these 3 networks, it is also possible to set the valid Dencun hard fork epoch as the value of the `DENCUN_FORK_EPOCH` variable. If the `ETH_NETWORK` variable has a value other than 1, 5, or 17000, the value of the `DENCUN_FORK_EPOCH` must be set, otherwise the the validation error will be returned. NOTE. We need to apply the `@Expose()` decorator to the `DENCUN_FORK_EPOCH` field of the `EnvironmentVariables` class to force calling the handler specified in the `@Transform` decorator when the `DENCUN_FORK_EPOCH` is not presented in the `.env` file. https://github.com/typestack/class-transformer?tab=readme-ov-file#enforcing-type-safe-instance The `transformDencunEpoch()` function is responsible for setting the default values for the `DENCUN_FORK_EPOCH` variable and must be called regardless of the `DENCUN_FORK_EPOCH` variable is presented in the `.env` file or not. Once the `DENCUN_FORK_EPOCH` variable is set in the config, the application assumes that this value is correct and uses this value as the primary source of truth.
- Loading branch information
1 parent
58558f8
commit 77952e2
Showing
5 changed files
with
104 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters