Skip to content

Commit

Permalink
revert nft mint change, combine scaling and rounding
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelsoup42 committed Oct 5, 2023
1 parent 17aa80e commit fa7780c
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions src/cardano_account_pandas_dumper/cardano_account_pandas_dumper.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,9 @@ def _parse_nft_mint(self, meta: blockfrost.utils.Namespace) -> str:
for policy, _v in meta_dict.items():
if policy == "version":
continue
result += f"{self._format_policy(policy)}:{_v.to_dict()}"
result += f"{self._format_policy(policy)}:"
for asset_name in _v.to_dict().keys():
result += f"{asset_name} "
return result

def _format_message(self, tx_obj: blockfrost.utils.Namespace) -> str:
Expand Down Expand Up @@ -497,15 +499,6 @@ def make_balance_frame(
.sum(numeric_only=True)
.T
)

# Scale by asset decimals
balance = balance * [
np.float_power(
10,
np.negative(self.asset_decimals[c[0]]),
)
for c in balance.columns
]
if with_total:
balance = pd.concat(
[
Expand All @@ -519,8 +512,19 @@ def make_balance_frame(
),
]
)

balance = pd.concat(
[balance[c].round(self.asset_decimals[c[0]]) for c in balance.columns],
[
balance[c]
.mul(
np.float_power(
10,
np.negative(self.asset_decimals[c[0]]),
)
)
.round(self.asset_decimals[c[0]])
for c in balance.columns
],
axis=1,
)

Expand Down

0 comments on commit fa7780c

Please sign in to comment.