Skip to content

Commit

Permalink
helpers/block: query ext as u8a
Browse files Browse the repository at this point in the history
  • Loading branch information
pLabarta committed Oct 7, 2024
1 parent e4a48b0 commit 3f743d9
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions test/helpers/block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const getBlockDetails = async (
block.extrinsics.map(async (ext) =>
(
await api.at(block.header.parentHash)
).call.transactionPaymentApi.queryInfo(ext.toHex(), ext.encodedLength)
).call.transactionPaymentApi.queryInfo(ext.toU8a(), ext.encodedLength)
)
);

Expand Down Expand Up @@ -91,6 +91,7 @@ export const verifyBlockFees = async (
) => {
const api = context.polkadotJs();
debug(`========= Checking block ${fromBlockNumber}...${toBlockNumber}`);

// let sumBlockFees = 0n;
let sumBlockBurnt = 0n;

Expand Down Expand Up @@ -221,9 +222,9 @@ export const verifyBlockFees = async (
"refTime" in fee.weight
? fee.weight
: {
refTime: fee.weight,
proofSize: 0n,
}
refTime: fee.weight,
proofSize: 0n,
}
)
).toBigInt();
const multiplier = await apiAt.query.transactionPayment.nextFeeMultiplier();
Expand Down Expand Up @@ -301,7 +302,7 @@ export const verifyLatestBlockFees = async (

export async function jumpToRound(context: DevModeContext, round: number): Promise<string | null> {
let lastBlockHash = "";
for (;;) {
for (; ;) {
const currentRound = (
await context.polkadotJs().query.parachainStaking.round()
).current.toNumber();
Expand Down Expand Up @@ -334,14 +335,14 @@ export function extractPreimageDeposit(
request:
| Option<ITuple<[AccountId20, u128]>>
| {
readonly deposit: ITuple<[AccountId20, u128]>;
readonly len: u32;
}
readonly deposit: ITuple<[AccountId20, u128]>;
readonly len: u32;
}
| {
readonly deposit: Option<ITuple<[AccountId20, u128]>>;
readonly count: u32;
readonly len: Option<u32>;
}
readonly deposit: Option<ITuple<[AccountId20, u128]>>;
readonly count: u32;
readonly len: Option<u32>;
}
) {
const deposit = "deposit" in request ? request.deposit : request;
if ("isSome" in deposit && deposit.isSome) {
Expand Down

0 comments on commit 3f743d9

Please sign in to comment.