fix: make the gas price regex case sensitive

This commit is contained in:
MadReza 2023-12-19 14:21:16 +03:30
parent 8ca4560b6e
commit 075b54cc89

View File

@ -37,7 +37,7 @@ export class GasPrice {
*/ */
public static fromString(gasPrice: string): GasPrice { public static fromString(gasPrice: string): GasPrice {
// Use Decimal.fromUserInput and checkDenom for detailed checks and helpful error messages // Use Decimal.fromUserInput and checkDenom for detailed checks and helpful error messages
const matchResult = gasPrice.match(/^([0-9.]+)([a-zA-Z][a-zA-Z0-9/:._-]*)$/i); const matchResult = gasPrice.match(/^([0-9.]+)([a-zA-Z][a-zA-Z0-9/:._-]*)$/);
if (!matchResult) { if (!matchResult) {
throw new Error("Invalid gas price string"); throw new Error("Invalid gas price string");
} }