]> git.codecow.com Git - libnemo.git/commitdiff
Revert regex to just check for hex format and maximum length, and rely on left-padded...
authorChris Duncan <chris@codecow.com>
Sat, 8 Aug 2026 09:06:45 +0000 (02:06 -0700)
committerChris Duncan <chris@codecow.com>
Sat, 8 Aug 2026 09:06:45 +0000 (02:06 -0700)
src/lib/block/index.ts

index afa614c13dd83d4d756b3efed6e0efebcb72e3e2..04b4229504ba29d545c8e8c14812f984ee6229bd 100644 (file)
@@ -80,7 +80,7 @@ export class Block {
                        if (typeof previous !== 'string') {
                                throw new TypeError('Account frontier is unknown')
                        }
-                       if (!(/^[0-9A-F]{64}$/i.test(previous))) {
+                       if (!(/^([0-9A-F]{2}){1,64}$/i.test(previous))) {
                                throw new RangeError('Invalid frontier hash')
                        }
                        this.account = account