-
Notifications
You must be signed in to change notification settings - Fork 77
Expand file tree
/
Copy pathfix-mint.py
More file actions
38 lines (30 loc) · 1.01 KB
/
Copy pathfix-mint.py
File metadata and controls
38 lines (30 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env python3
"""Fix mint calls back to StellarAssetClient."""
import re
path = "contracts/forge-multisig/src/lib.rs"
with open(path, "r") as f:
content = f.read()
# Pattern: token::Client::new(...).mint(...)
# Should be: token::StellarAssetClient::new(...).mint(...)
# Replace Client::new(...)...mint( with StellarAssetClient::new(...)...mint(
content = re.sub(
r"soroban_sdk::token::Client::new\(([^)]+)\)\.mint\(",
r"soroban_sdk::token::StellarAssetClient::new(\1).mint(",
content,
)
# Also handle token::Client::new(...).mint( in setup_token helper
content = re.sub(
r"token::Client::new\(([^)]+)\)\.mint\(",
r"token::StellarAssetClient::new(\1).mint(",
content,
)
# Also handle StellarAssetClient::new(...).balance( that might have been introduced
# These should be Client::new(...).balance(
content = re.sub(
r"StellarAssetClient::new\(([^)]+)\)\.balance\(",
r"Client::new(\1).balance(",
content,
)
with open(path, "w") as f:
f.write(content)
print("Mint fixes applied.")