-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GRPC and NotifierConfig update #6744
base: MX-16271-indexing-incoming-tokens
Are you sure you want to change the base?
Changes from 3 commits
6d013bc
ef1de5a
a838eaf
30cdb92
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,13 +29,30 @@ def update_key(lines, key, value) -> []: | |
return updated_lines | ||
|
||
|
||
def enable_key(lines, section): | ||
updated_lines = [] | ||
section_found = False | ||
|
||
for line in lines: | ||
if line.startswith("[" + section + "]"): | ||
section_found = True | ||
if section_found and "Enabled" in line: | ||
line = re.sub(r'(Enabled\s*=\s*)\w+', r'\1true', line) | ||
section_found = False | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do you set this to false since you don't use it afterwards? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will skip the second |
||
updated_lines.append(line) | ||
|
||
return updated_lines | ||
|
||
|
||
def update_sovereign_config(file_path, main_chain_address, sovereign_chain_address): | ||
with open(file_path, 'r') as file: | ||
lines = file.readlines() | ||
|
||
updated_lines = update_subscribed_addresses(lines, "OutgoingSubscribedEvents", "deposit", sovereign_chain_address) | ||
updated_lines = update_subscribed_addresses(updated_lines, "NotifierConfig", "deposit", main_chain_address) | ||
updated_lines = update_subscribed_addresses(updated_lines, "NotifierConfig", "execute", main_chain_address) | ||
updated_lines = enable_key(updated_lines, "OutGoingBridge") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does this do exactly? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will set |
||
updated_lines = enable_key(updated_lines, "NotifierConfig") | ||
|
||
with open(file_path, 'w') as file: | ||
file.writelines(updated_lines) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we also add a comment explaining this, similar to the one from
[NotifierConfig]
?