From f773c8d0b35737762af8a824dfbcd80e3e59ed7a Mon Sep 17 00:00:00 2001 From: mikewcasale Date: Wed, 14 Sep 2022 21:00:47 +0000 Subject: [PATCH 1/5] fixup: Format Python code with Black --- bancor_research/bancor_simulator/v3/spec/network.py | 3 ++- bancor_research/bancor_simulator/v3/spec/state.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bancor_research/bancor_simulator/v3/spec/network.py b/bancor_research/bancor_simulator/v3/spec/network.py index dcd67eb..e7a7390 100644 --- a/bancor_research/bancor_simulator/v3/spec/network.py +++ b/bancor_research/bancor_simulator/v3/spec/network.py @@ -19,6 +19,7 @@ def to_decimal(percent: str): except TypeError: return percent + def to_user_amount(state: State, tkn_name: str, user_name: str, amount: str): if amount.endswith("%"): return get_user_balance(state, user_name, tkn_name) * to_decimal(amount) @@ -429,7 +430,7 @@ def whitelist_token(self, tkn_name: str, timestamp: int = 0): """ state = self.get_state(copy_type="initial", timestamp=timestamp) tkn_name = tkn_name.lower() - state.price_feeds[tkn_name]=[0 for _ in range(len(state.price_feeds))] + state.price_feeds[tkn_name] = [0 for _ in range(len(state.price_feeds))] state.create_whitelisted_tkn(tkn_name) self.next_transaction(state) handle_logging( diff --git a/bancor_research/bancor_simulator/v3/spec/state.py b/bancor_research/bancor_simulator/v3/spec/state.py index 4296dd8..5728bea 100644 --- a/bancor_research/bancor_simulator/v3/spec/state.py +++ b/bancor_research/bancor_simulator/v3/spec/state.py @@ -777,7 +777,7 @@ def create_whitelisted_tkn(self, tkn_name: str): "decimals": 18, "trading_fee": DEFAULT_TRADING_FEE, "bnt_funding_limit": DEFAULT_BNT_FUNDING_LIMIT, - "ep_vault_balance": DEFAULT.EP_VAULT_BALANCE + "ep_vault_balance": DEFAULT.EP_VAULT_BALANCE, } return self From 83dd6617ecb457a8672faa4336e2bbda71dea4d3 Mon Sep 17 00:00:00 2001 From: mikewcasale Date: Wed, 14 Sep 2022 21:03:06 +0000 Subject: [PATCH 2/5] fixup: Format Python code with Black --- bancor_research/bancor_simulator/v3/spec/network.py | 3 ++- bancor_research/bancor_simulator/v3/spec/state.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bancor_research/bancor_simulator/v3/spec/network.py b/bancor_research/bancor_simulator/v3/spec/network.py index dcd67eb..e7a7390 100644 --- a/bancor_research/bancor_simulator/v3/spec/network.py +++ b/bancor_research/bancor_simulator/v3/spec/network.py @@ -19,6 +19,7 @@ def to_decimal(percent: str): except TypeError: return percent + def to_user_amount(state: State, tkn_name: str, user_name: str, amount: str): if amount.endswith("%"): return get_user_balance(state, user_name, tkn_name) * to_decimal(amount) @@ -429,7 +430,7 @@ def whitelist_token(self, tkn_name: str, timestamp: int = 0): """ state = self.get_state(copy_type="initial", timestamp=timestamp) tkn_name = tkn_name.lower() - state.price_feeds[tkn_name]=[0 for _ in range(len(state.price_feeds))] + state.price_feeds[tkn_name] = [0 for _ in range(len(state.price_feeds))] state.create_whitelisted_tkn(tkn_name) self.next_transaction(state) handle_logging( diff --git a/bancor_research/bancor_simulator/v3/spec/state.py b/bancor_research/bancor_simulator/v3/spec/state.py index 4296dd8..5728bea 100644 --- a/bancor_research/bancor_simulator/v3/spec/state.py +++ b/bancor_research/bancor_simulator/v3/spec/state.py @@ -777,7 +777,7 @@ def create_whitelisted_tkn(self, tkn_name: str): "decimals": 18, "trading_fee": DEFAULT_TRADING_FEE, "bnt_funding_limit": DEFAULT_BNT_FUNDING_LIMIT, - "ep_vault_balance": DEFAULT.EP_VAULT_BALANCE + "ep_vault_balance": DEFAULT.EP_VAULT_BALANCE, } return self From 3b46365ad33998b77a0f90c8febd4dbfcb783587 Mon Sep 17 00:00:00 2001 From: mikewcasale Date: Wed, 14 Sep 2022 22:42:14 +0000 Subject: [PATCH 3/5] fixup: Format Python code with Black --- bancor_research/bancor_simulator/v3/spec/network.py | 3 ++- bancor_research/bancor_simulator/v3/spec/state.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bancor_research/bancor_simulator/v3/spec/network.py b/bancor_research/bancor_simulator/v3/spec/network.py index 5a72360..eb8f7e7 100644 --- a/bancor_research/bancor_simulator/v3/spec/network.py +++ b/bancor_research/bancor_simulator/v3/spec/network.py @@ -19,6 +19,7 @@ def to_decimal(percent: str): except TypeError: return percent + def to_user_amount(state: State, tkn_name: str, user_name: str, amount: str): if amount.endswith("%"): return get_user_balance(state, user_name, tkn_name) * to_decimal(amount) @@ -429,7 +430,7 @@ def whitelist_token(self, tkn_name: str, timestamp: int = 0): """ state = self.get_state(copy_type="initial", timestamp=timestamp) tkn_name = tkn_name.lower() - state.price_feeds[tkn_name]=[0 for _ in range(len(state.price_feeds))] + state.price_feeds[tkn_name] = [0 for _ in range(len(state.price_feeds))] state.create_whitelisted_tkn(tkn_name) handle_whitelisting_tokens(state) diff --git a/bancor_research/bancor_simulator/v3/spec/state.py b/bancor_research/bancor_simulator/v3/spec/state.py index 4296dd8..5728bea 100644 --- a/bancor_research/bancor_simulator/v3/spec/state.py +++ b/bancor_research/bancor_simulator/v3/spec/state.py @@ -777,7 +777,7 @@ def create_whitelisted_tkn(self, tkn_name: str): "decimals": 18, "trading_fee": DEFAULT_TRADING_FEE, "bnt_funding_limit": DEFAULT_BNT_FUNDING_LIMIT, - "ep_vault_balance": DEFAULT.EP_VAULT_BALANCE + "ep_vault_balance": DEFAULT.EP_VAULT_BALANCE, } return self From 9ddf44239fbde558776f73538896e12aac4eb4aa Mon Sep 17 00:00:00 2001 From: mikewcasale Date: Fri, 16 Sep 2022 16:47:37 +0000 Subject: [PATCH 4/5] fixup: Format Python code with Black --- bancor_research/bancor_simulator/v3/spec/network.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/bancor_research/bancor_simulator/v3/spec/network.py b/bancor_research/bancor_simulator/v3/spec/network.py index 9c3dd62..6949a0d 100644 --- a/bancor_research/bancor_simulator/v3/spec/network.py +++ b/bancor_research/bancor_simulator/v3/spec/network.py @@ -217,7 +217,6 @@ def deposit( ) self.next_transaction(state) - def trade( self, tkn_amt: str, @@ -251,7 +250,6 @@ def trade( ) self.next_transaction(state) - def begin_cooldown_by_rtkn( self, tkn_amt: str, @@ -326,7 +324,6 @@ def withdraw( ) self.next_transaction(state) - def enable_trading( self, tkn_name: str, @@ -355,7 +352,6 @@ def enable_trading( ) self.next_transaction(state) - def describe(self, decimals: int = -1): """ Describes the state ledger in a format similar to BIP15 documentation. @@ -434,7 +430,7 @@ def whitelist_token(self, tkn_name: str, timestamp: int = 0): """ state = self.get_state(copy_type="initial", timestamp=timestamp) tkn_name = tkn_name.lower() - state.price_feeds[tkn_name]=state.price_feeds['bnt'].values + state.price_feeds[tkn_name] = state.price_feeds["bnt"].values state.create_whitelisted_tkn(tkn_name) handle_whitelisting_tokens(state) From 19118400c9dc34783ec92d9985aa10d11ec5628b Mon Sep 17 00:00:00 2001 From: mikewcasale Date: Mon, 19 Sep 2022 11:41:17 +0000 Subject: [PATCH 5/5] fixup: Format Python code with Black --- bancor_research/bancor_simulator/v3/spec/network.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/bancor_research/bancor_simulator/v3/spec/network.py b/bancor_research/bancor_simulator/v3/spec/network.py index ecc297b..740dff6 100644 --- a/bancor_research/bancor_simulator/v3/spec/network.py +++ b/bancor_research/bancor_simulator/v3/spec/network.py @@ -218,7 +218,6 @@ def deposit( ) self.next_transaction(state) - def trade( self, tkn_amt: str, @@ -252,7 +251,6 @@ def trade( ) self.next_transaction(state) - def begin_cooldown_by_rtkn( self, tkn_amt: str, @@ -327,7 +325,6 @@ def withdraw( ) self.next_transaction(state) - def enable_trading( self, tkn_name: str, @@ -356,7 +353,6 @@ def enable_trading( ) self.next_transaction(state) - def describe(self, decimals: int = -1): """ Describes the state ledger in a format similar to BIP15 documentation. @@ -435,7 +431,7 @@ def whitelist_token(self, tkn_name: str, timestamp: int = 0): """ state = self.get_state(copy_type="initial", timestamp=timestamp) tkn_name = tkn_name.lower() - state.price_feeds[tkn_name]=state.price_feeds['bnt'].values + state.price_feeds[tkn_name] = state.price_feeds["bnt"].values state.create_whitelisted_tkn(tkn_name) handle_whitelisting_tokens(state)