Skip to content

Commit 5c5465f

Browse files
committed

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/faucet/src/addresses.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
import { fromBech32 } from "@cosmjs/encoding";
22

33
export function isValidAddress(input: string, requiredPrefix: string): boolean {
4+
if (input.length > 2048) {
5+
return false;
6+
}
47
try {
58
const { prefix, data } = fromBech32(input);
69
if (prefix !== requiredPrefix) {
710
return false;
811
}
9-
return data.length >= 20 && data.length <= 32;
12+
return data.length >= 20;
1013
} catch {
1114
return false;
1215
}

0 commit comments

Comments
 (0)