Skip to content

Commit

Permalink
fix(feeByEvent): use registry to convert hex to string (#997)
Browse files Browse the repository at this point in the history
  • Loading branch information
TarikGul committed Aug 2, 2022
1 parent 45b25bf commit 13ca62f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/services/blocks/BlocksService.ts
Expand Up @@ -30,7 +30,7 @@ import {
} from '@polkadot/types/interfaces';
import { AnyJson, Codec, Registry } from '@polkadot/types/types';
import { ICompact, INumber } from '@polkadot/types-codec/types/interfaces';
import { hexToNumber, isHex, u8aToHex } from '@polkadot/util';
import { isHex, u8aToHex } from '@polkadot/util';
import { blake2AsU8a } from '@polkadot/util-crypto';
import BN from 'bn.js';
import { BadRequest, InternalServerError } from 'http-errors';
Expand Down Expand Up @@ -618,8 +618,8 @@ export class BlocksService extends AbstractService {
*/
private sanitizeFee(fee: string): string {
if (isHex(fee)) {
const numFee = hexToNumber(fee);
return numFee.toString(10);
const feeType = this.api.registry.createType('Balance', fee);
return feeType.toString(10);
}

return fee;
Expand Down

0 comments on commit 13ca62f

Please sign in to comment.