-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpatch_web3_app.py
More file actions
21 lines (17 loc) Β· 799 Bytes
/
patch_web3_app.py
File metadata and controls
21 lines (17 loc) Β· 799 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import re
with open('app.js', 'r') as f:
content = f.read()
old_web3_app = """ this.resultDiv.textContent = `Signature: ${signature}`;
this.signBtn.textContent = 'Message Signed β';
this.signBtn.style.borderColor = 'var(--success-color)';"""
new_web3_app = """ this.resultDiv.style.display = 'block';
this.resultDiv.textContent = `Signature:\\n${signature}`;
this.signBtn.textContent = 'Message Signed β';
this.signBtn.style.borderColor = 'var(--success-color)';"""
if old_web3_app in content:
content = content.replace(old_web3_app, new_web3_app)
with open('app.js', 'w') as f:
f.write(content)
print("Web3 app logic updated successfully.")
else:
print("Could not find the web3 app logic block to replace.")