Skip to content

Commit

Permalink
Fix extrinsic page which has erc20 bridge withdrawal (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
KarishmaBothara authored May 30, 2024
1 parent b883ed7 commit f119af0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions components/events/transactionActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export default function TransactionActions({ events, isSuccess }) {
"Erc20Peg.Erc20Withdraw": Erc20PegErc20Withdraw,
"Assets.Burned": AssetsBurned,
};

const parsedEvents = Object.keys(mapped);
const filteredEvents = events?.length
? events.filter((e) => parsedEvents.includes(e.name))
Expand Down Expand Up @@ -61,7 +60,13 @@ const AssetsBurned = ({ data }) => {
};

const Erc20PegErc20Withdraw = ({ data }) => {
let [assetId, amount, to] = data?.args;
const { args } = data;
let assetId, amount, to;
if (Array.isArray(args)) {
[assetId, amount, to] = args;
} else {
({ assetId, amount, beneficiary: to } = args);
}
const asset = getAssetMetadata(assetId);
const formattedAmount = ethers.utils
.formatUnits(amount, asset?.decimals)
Expand Down

0 comments on commit f119af0

Please sign in to comment.