From b895927e1c127deb8009f3c38a0848224df07236 Mon Sep 17 00:00:00 2001 From: Salvatore Ingala <6681844+bigspider@users.noreply.github.com> Date: Tue, 10 Dec 2024 14:19:43 +0100 Subject: [PATCH] Apply suggestions from code review Co-authored-by: lpascal-ledger --- test_utils/musig2.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test_utils/musig2.py b/test_utils/musig2.py index 60f2c430..0de22957 100644 --- a/test_utils/musig2.py +++ b/test_utils/musig2.py @@ -288,7 +288,7 @@ def __init__(self, key: KeyPlaceholder, tree=Optional[Tree]): self.tree: Optional[Tree] = tree @classmethod - def from_string(cls, input_string): + def from_string(cls, input_string: str) -> "TrDescriptorTemplate": parser = cls.Parser(input_string.replace("/**", "/<0;1>/*")) return parser.parse() @@ -298,7 +298,7 @@ def __init__(self, input): self.index = 0 self.length = len(input) - def parse(self): + def parse(self) -> "TrDescriptorTemplate": if self.input.startswith('tr('): self.consume('tr(') key = self.parse_keyplaceholder() @@ -312,7 +312,7 @@ def parse(self): raise Exception( "Syntax error: Input does not start with 'tr('") - def parse_keyplaceholder(self): + def parse_keyplaceholder(self) -> KeyPlaceholder: if self.peek() == '@': self.consume('@') key_index = self.parse_num()