1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-14 04:19:09 +00:00

validate ripple fee (min/max value)

This commit is contained in:
Szymon Lesisz 2019-01-03 15:37:08 +01:00
parent 7d9cbf7cbe
commit 96fd05676f

View File

@ -221,8 +221,10 @@ export const feeValidation = ($state: State): PayloadAction<State> => (dispatch:
state.errors.fee = 'Fee must be an absolute number'; state.errors.fee = 'Fee must be an absolute number';
} else { } else {
const gl: BigNumber = new BigNumber(fee); const gl: BigNumber = new BigNumber(fee);
if (gl.lessThan(10)) { if (gl.lessThan(network.fee.minFee)) {
state.errors.fee = 'Fee is below recommended'; state.errors.fee = 'Fee is below recommended';
} else if (gl.greaterThan(network.fee.maxFee)) {
state.errors.fee = 'Fee is above recommended';
} }
} }
return state; return state;