forked from stellarmarket-labs/stellar-market
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpatch.py
More file actions
38 lines (31 loc) · 1017 Bytes
/
Copy pathpatch.py
File metadata and controls
38 lines (31 loc) · 1017 Bytes
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
import re
with open("contracts/reputation/src/lib.rs", "r") as f:
content = f.read()
content = re.sub(
r"pub struct UserReputation \{\s+pub user: Address,\s+pub total_score: u64,\s+pub total_weight: u64,\s+pub review_count: u32,\s+\}",
"""pub struct UserReputation {
pub user: Address,
pub total_score: u64,
pub total_weight: u64,
pub review_count: u32,
pub last_updated_ledger: u32,
}""",
content
)
with open("contracts/reputation/src/lib.rs", "w") as f:
f.write(content)
with open("contracts/dispute/src/lib.rs", "r") as f:
content = f.read()
content = re.sub(
r"pub struct UserReputation \{\s+pub user: Address,\s+pub total_score: u64,\s+pub total_weight: u64,\s+pub review_count: u32,\s+\}",
"""pub struct UserReputation {
pub user: Address,
pub total_score: u64,
pub total_weight: u64,
pub review_count: u32,
pub last_updated_ledger: u32,
}""",
content
)
with open("contracts/dispute/src/lib.rs", "w") as f:
f.write(content)