Skip to content

Commit

Permalink
Merge pull request #336 from BalancerMaxis/issue/335
Browse files Browse the repository at this point in the history
fix: do not reinstantiate dict every iteration
  • Loading branch information
gosuto-inzasheru authored Jun 4, 2024
2 parents a356a26 + 3fd85cd commit 4b0aba0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bal_addresses/addresses.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,11 +276,11 @@ def process_rate_providers(self) -> Optional[Munch]:
rate_providers = defaultdict(dict)
r = RateProviders(self.chain)
for rate_provider, infodict in r.info_by_rate_provider.items():
name = infodict.get("name")
name = infodict.get("name").replace(" ", "_")
summary = infodict.get("summary")
token_address = infodict.get("asset")
## create a nested dict with name/summary/token_address as keys and rate_provider as value
rate_providers[summary] = {name: {token_address: rate_provider}}
rate_providers[summary].update({name: {token_address: rate_provider}})
self._rate_providers = Munch.fromDict(rate_providers)
return self._rate_providers

Expand Down

0 comments on commit 4b0aba0

Please sign in to comment.