Skip to content

Commit

Permalink
chore: partial fee fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
rossbulat committed Dec 2, 2024
1 parent 002978e commit 4109330
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions packages/app/src/hooks/useBondGreatestFee/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@ export const useBondGreatestFee = ({ bondFor }: { bondFor: BondFor }) => {
tx = new StakingBondExtra(network, BigInt(bond)).tx();
}

if (tx) {
const { partial_fee } = await tx.getPaymentInfo(activeAccount || '');
if (tx && activeAccount) {
const partial_fee =
(await tx?.getPaymentInfo(activeAccount))?.partial_fee || 0n;

return new BigNumber(partial_fee.toString());
}
return new BigNumber(0);
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/hooks/useSubmitExtrinsic/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ export const useSubmitExtrinsic = ({
if (!tx) {
return;
}
const fee = (await tx.getPaymentInfo(from)).partial_fee;
TxSubmission.updateFee(uid, fee);
const partial_fee = (await tx?.getPaymentInfo(from)?.partial_fee) || 0n;
TxSubmission.updateFee(uid, partial_fee);
};
if (uid > 0) {
fetchTxFee();
Expand Down

0 comments on commit 4109330

Please sign in to comment.