Skip to content

Commit bff321e

Browse files
committed
fix incompatible protocol name length
1 parent 78029ce commit bff321e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

bsv/wallet/key_deriver.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ class Protocol:
2121
protocol: str
2222

2323
def __init__(self, security_level: int, protocol: str):
24-
if not isinstance(protocol, str) or len(protocol) < 5 or len(protocol) > 400:
25-
raise ValueError("protocol names must be 5-400 characters")
24+
# Allow 3-400 characters to match TS/Go (e.g., "ctx" is valid in tests)
25+
# This matches _validate_protocol() behavior
26+
if not isinstance(protocol, str) or len(protocol) < 3 or len(protocol) > 400:
27+
raise ValueError("protocol names must be 3-400 characters")
2628
self.security_level = security_level
2729
self.protocol = protocol
2830

0 commit comments

Comments
 (0)