|
|
@ -83,11 +83,11 @@ module.exports = class txProvideUtil { |
|
|
|
async validateTxParams (txParams) { |
|
|
|
async validateTxParams (txParams) { |
|
|
|
if ('value' in txParams) { |
|
|
|
if ('value' in txParams) { |
|
|
|
const value = txParams.value.toString() |
|
|
|
const value = txParams.value.toString() |
|
|
|
if (value.indexOf('-') === 0) { |
|
|
|
if (value.includes('-')) { |
|
|
|
throw new Error(`Invalid transaction value of ${txParams.value} not a positive number.`) |
|
|
|
throw new Error(`Invalid transaction value of ${txParams.value} not a positive number.`) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (value.indexOf('.') >= 0) { |
|
|
|
if (value.includes('.')) { |
|
|
|
throw new Error(`Invalid transaction value of ${txParams.value} number must be in wei`) |
|
|
|
throw new Error(`Invalid transaction value of ${txParams.value} number must be in wei`) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|