Skip to content

Commit c429c95

Browse files
committed
Fix iteration of pending withdrawals in LockedGols SC wrapper
1 parent b0c8bf3 commit c429c95

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sdk/contracts/LockedGoldWrapper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ def relock(self, account: str, value: int) -> List[str]:
112112

113113
res = []
114114
remaining_to_relock = value
115-
for ind, withd in enumerate(pending_withdrawals):
116-
value_to_relock = min(withd['value'], remaining_to_relock)
115+
for ind in reversed(range(len(pending_withdrawals))):
116+
value_to_relock = min(pending_withdrawals[ind]['value'], remaining_to_relock)
117117
if value_to_relock > 0:
118118
remaining_to_relock -= value_to_relock
119119
res.append(self.relock_single(ind, value_to_relock))

0 commit comments

Comments
 (0)