Commit ec9778c6 authored by Son of Odin's avatar Son of Odin

linting fixes

parent 98e09058
Pipeline #118100643 failed with stages
in 1 minute and 5 seconds
......@@ -183,8 +183,10 @@ txns = [
],
# Swaps
[
Transaction(Binance.chain, "USER-1", "VAULT", [Coin("BNB", 30000000)], "SWAP:BNB.BNB"),
1, # cannot swap BNB for BNB
Transaction(
Binance.chain, "USER-1", "VAULT", [Coin("BNB", 30000000)], "SWAP:BNB.BNB"
),
1, # cannot swap BNB for BNB
],
[
Transaction(
......@@ -204,7 +206,11 @@ txns = [
],
[
Transaction(
Binance.chain, "USER-1", "VAULT", [Coin("RUNE-A1F", 100000001)], "SWAP:BNB.BNB"
Binance.chain,
"USER-1",
"VAULT",
[Coin("RUNE-A1F", 100000001)],
"SWAP:BNB.BNB",
),
1,
],
......
import unittest
import os
import json
......@@ -36,8 +35,8 @@ class TestSmoke(unittest.TestCase):
export = os.environ.get("EXPORT", None)
failure = False
snaps = []
bnb = Binance() # init local binance chain
thorchain = ThorchainState() # init local thorchain
bnb = Binance() # init local binance chain
thorchain = ThorchainState() # init local thorchain
for i, unit in enumerate(txns):
(
......@@ -49,8 +48,8 @@ class TestSmoke(unittest.TestCase):
bnb.seed(txn.toAddress, txn.coins)
continue
else:
bnb.transfer(txn) # send transfer on binance chain
outbound = thorchain.handle(txn) # process transaction in thorchain
bnb.transfer(txn) # send transfer on binance chain
outbound = thorchain.handle(txn) # process transaction in thorchain
outbound = thorchain.handle_fee(outbound)
for txn in outbound:
gas = bnb.transfer(txn) # send outbound txns back to Binance
......@@ -59,7 +58,7 @@ class TestSmoke(unittest.TestCase):
# generated a snapshop picture of thorchain and bnb
snap = Breakpoint(thorchain, bnb).snapshot(i, out)
snaps.append(snap)
expected = get_balance(i) # get the expected balance from json file
expected = get_balance(i) # get the expected balance from json file
diff = DeepDiff(
snap, expected, ignore_order=True
......@@ -77,11 +76,12 @@ class TestSmoke(unittest.TestCase):
raise Exception("did not match!")
if export:
with open(export, 'w') as fp:
with open(export, "w") as fp:
json.dump(snaps, fp, indent=4)
if failure:
raise Exception("Fail")
if __name__ == "__main__":
unittest.main()
......@@ -97,7 +97,7 @@ class ThorchainState:
for txn in txns:
for coin in txn.coins:
if coin.is_rune():
coin.amount -= rune_fee # deduct 1 rune transaction fee
coin.amount -= rune_fee # deduct 1 rune transaction fee
if coin.amount > 0:
outbound.append(txn)
else:
......@@ -376,7 +376,9 @@ class Pool:
"""
Calculates how much asset we need to pay for the 1 rune transaction fee
"""
return int(round((float(100000000) / float(self.rune_balance)) * self.asset_balance))
return int(
round((float(100000000) / float(self.rune_balance)) * self.asset_balance)
)
def sub(self, rune_amt, asset_amt):
"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment