Skip to content

Commit

Permalink
Update min fee rates env variables
Browse files Browse the repository at this point in the history
  • Loading branch information
lserra-iov authored and alexjavabraz committed Dec 19, 2023
1 parent 51ed456 commit 2b66e4f
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 14 deletions.
7 changes: 3 additions & 4 deletions .env.local.test
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ VUE_RSK_EXPLORER=https://explorer.testnet.rsk.co/
VUE_APP_PEGOUT_MIN_AMOUNT_ALLOWED_IN_RBTC=0.004
VUE_APP_PEGOUT_MAX_AMOUNT_ALLOWED_IN_RBTC=1
## fee boundaries
VUE_APP_FEE_PER_KB_FAST_MIN=8
VUE_APP_FEE_PER_KB_AVERAGE_MIN=5
VUE_APP_FEE_PER_KB_SLOW_MIN=2

VUE_APP_MIN_FEE_SAT_PER_BYTE_FAST=8
VUE_APP_MIN_FEE_SAT_PER_BYTE_AVG=4
VUE_APP_MIN_FEE_SAT_PER_BYTE_SLOW=1
VUE_APP_FAST_MINING_BLOCK=1
VUE_APP_AVERAGE_MINING_BLOCK=6
VUE_APP_SLOW_MINING_BLOCK=12
Expand Down
6 changes: 6 additions & 0 deletions ENV_VARIABLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ The value of these variables are used in **environment-variables.ts** file.
|VUE_APP_PEGOUT_MIN_AMOUNT_ALLOWED_IN_RBTC | `0.004` | 0,004 Minimum allowed value for a PEGOUT transaction |
|VUE_APP_PEGOUT_MAX_AMOUNT_ALLOWED_IN_RBTC | `1` | 1 Maximum allowed value for a PEGOUT transaction |
|VUE_APP_BURN_DUST_VALUE | `30000` | Max value to burn in the tx fee |
|VUE_APP_MIN_FEE_SAT_PER_BYTE_FAST | `8` | Min fee rate (sats/byte) required to broadcast the transaction |
|VUE_APP_MIN_FEE_SAT_PER_BYTE_AVG | `4` | Min fee rate (sats/byte) required to broadcast the transaction |
|VUE_APP_MIN_FEE_SAT_PER_BYTE_SLOW | `1` | Min fee rate (sats/byte) required to broadcast the transaction |

## Example for .env.local.test file

Expand All @@ -33,4 +36,7 @@ VUE_APP_WALLET_ADDRESS_PER_CALL=5
VUE_APP_PEGOUT_MIN_AMOUNT_ALLOWED_IN_RBTC=0.005
VUE_APP_PEGOUT_MAX_AMOUNT_ALLOWED_IN_RBTC=1
VUE_APP_BURN_DUST_VALUE=30000
VUE_APP_MIN_FEE_SAT_PER_BYTE_FAST=8
VUE_APP_MIN_FEE_SAT_PER_BYTE_AVG=4
VUE_APP_MIN_FEE_SAT_PER_BYTE_SLOW=1
```
12 changes: 6 additions & 6 deletions src/common/types/environment-variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ export class EnvironmentVariables {
this.pegoutMaxValue = process.env.VUE_APP_PEGOUT_MAX_AMOUNT_ALLOWED_IN_RBTC
|| defaultValues.pegoutMaxValue;
this.minFeeSatPerByte = {
fast: process.env.VUE_APP_FEE_PER_KB_FAST_MIN
|| (defaultValues.minFeePerKb ? defaultValues.minFeePerKb.fast : 0),
average: process.env.VUE_APP_FEE_PER_KB_AVERAGE_MIN
|| (defaultValues.minFeePerKb ? defaultValues.minFeePerKb.average : 0),
slow: process.env.VUE_APP_FEE_PER_KB_SLOW_MIN
|| (defaultValues.minFeePerKb ? defaultValues.minFeePerKb.slow : 0),
fast: process.env.VUE_APP_MIN_FEE_SAT_PER_BYTE_FAST
|| (defaultValues.minFeeSatPerByte ? defaultValues.minFeeSatPerByte.fast : 0),
average: process.env.VUE_APP_MIN_FEE_SAT_PER_BYTE_AVG
|| (defaultValues.minFeeSatPerByte ? defaultValues.minFeeSatPerByte.average : 0),
slow: process.env.VUE_APP_MIN_FEE_SAT_PER_BYTE_SLOW
|| (defaultValues.minFeeSatPerByte ? defaultValues.minFeeSatPerByte.slow : 0),
};
this.miningSpeedBlock = {
fast: process.env.VUE_APP_FAST_MINING_BLOCK
Expand Down
6 changes: 3 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ const defaultEnvironmentVariables = {
vueAppClarityId: '',
pegoutMinValue: 0.004,
pegoutMaxValue: 1,
minFeePerKb: {
minFeeSatPerByte: {
fast: 8,
average: 5,
slow: 2,
average: 4,
slow: 1,
},
miningSpeedBlock: {
fast: 1,
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/pegin/services/TxFeeService.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function setEnvironment() {
vueAppRskNodeHost: '',
vueAppApiBaseUrl: API_URL,
miningSpeedBlock: { fast: 1, average: 6, slow: 12 },
minFeePerKb: { fast: 100, average: 80, slow: 20 },
minFeeSatPerByte: { fast: 100, average: 80, slow: 20 },
};
EnvironmentAccessorService.initializeEnvironmentVariables(defaultEnvironmentVariables);
}
Expand Down

0 comments on commit 2b66e4f

Please sign in to comment.