Skip to content

Commit

Permalink
fixed a bug with Mirror withdrawal
Browse files Browse the repository at this point in the history
  • Loading branch information
Hendrik Schicke committed Oct 18, 2021
1 parent 955ef66 commit e73005d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
6 changes: 2 additions & 4 deletions C_Main.py
Original file line number Diff line number Diff line change
Expand Up @@ -842,10 +842,8 @@ def keep_safe():
# Check if we are in a cooldown period or if the key actually exists
if cooldowns.get(position_idx) is None or cooldowns[position_idx] <= datetime_now:

Mirror_withdraw_collateral_for_position_tx = Transaction_class.Mirror_withdraw_collateral_for_position(
position_idx, amount_to_execute_in_kind, collateral_token_denom)
Mirror_withdraw_collateral_for_position_tx_status = Queries_class.get_status_of_tx(
Mirror_withdraw_collateral_for_position_tx)
Mirror_withdraw_collateral_for_position_tx = Transaction_class.Mirror_withdraw_collateral_for_position(position_idx, amount_to_execute_in_kind, collateral_token_denom)
Mirror_withdraw_collateral_for_position_tx_status = Queries_class.get_status_of_tx(Mirror_withdraw_collateral_for_position_tx)

if Mirror_withdraw_collateral_for_position_tx_status == True:
default_logger.debug(
Expand Down
18 changes: 9 additions & 9 deletions assets/Transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,18 +125,18 @@ def Mirror_withdraw_collateral_for_position(self, idx:str, collateral_amount_in_
if denom == 'aUST':
# https://finder.terra.money/tequila-0004/tx/10C1B6310DA5B16F5EE96F3535B99C9CD7DC5D696054D547C32A54F2317E930B

contract=Terra.aTerra
contract=Terra.Mint
execute_msg={
"withdraw": {
"position_idx": idx,
"collateral": {
"amount": str(collateral_amount_in_kind),
"info": {
"token": {
"contract_addr": Terra.aTerra
}
}
}
},
"amount": str(collateral_amount_in_kind),
},
"position_idx": idx,
}
}
coins=Coins()
Expand All @@ -148,15 +148,15 @@ def Mirror_withdraw_collateral_for_position(self, idx:str, collateral_amount_in_
contract=Terra.Mint
execute_msg={
"withdraw": {
"position_idx": idx,
"collateral": {
"amount": str(collateral_amount_in_kind),
"info": {
"native_token": {
"denom": "uusd"
}
}
}
},
"amount": str(collateral_amount_in_kind),
},
"position_idx": idx,
}
}

Expand Down

0 comments on commit e73005d

Please sign in to comment.