Skip to content

Commit

Permalink
fix block creation for xcm test
Browse files Browse the repository at this point in the history
  • Loading branch information
Chralt98 committed Dec 11, 2024
1 parent e4be2e2 commit 7b17925
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
16 changes: 9 additions & 7 deletions integration-tests/tests/common-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export async function canCreateBlocks(
export async function canSendBalanceTransfer(
context: ChopsticksContext,
providerName: string,
paraApi: ApiPromise,
paraApi: ApiPromise
) {
const randomAccount = generateKeyringPair("sr25519");
const keyring = new Keyring({ type: "sr25519" });
Expand Down Expand Up @@ -60,11 +60,12 @@ export async function canSendBalanceTransfer(
const events = await apiAt.query.system.events();

// in the case that the transfer fails, it's logged here
console.log(
`ExtrinsicFailed ${events.find((evt) =>
paraApi.events.system.ExtrinsicFailed.is(evt.event)
)}`
const extrinsicFailedEvent = events.find((evt) =>
paraApi.events.system.ExtrinsicFailed.is(evt.event)
);
if (extrinsicFailedEvent) {
console.log(`ExtrinsicFailed: ${extrinsicFailedEvent}`);
}

const block = await paraApi.rpc.chain.getBlock(result.result);
const includedTxHashes = block.block.extrinsics.map((x) =>
Expand Down Expand Up @@ -96,6 +97,7 @@ export async function canSendXcmTransfer(
senderProviderName: string,
senderParaApi: ApiPromise,
receiverParaApi: ApiPromise,
receiverProviderName: string,
receiverParaId: number,
tokensIndex: number
) {
Expand All @@ -116,7 +118,7 @@ export async function canSendXcmTransfer(
).free.toBigInt();

const ztg = { Ztg: null };
const amount: bigint = BigInt("192913122185847181");
const amount: bigint = BigInt("100000000000000000");
const bobAccountId = senderParaApi
.createType("AccountId32", bob.address)
.toHex();
Expand Down Expand Up @@ -174,7 +176,7 @@ export async function canSendXcmTransfer(
jsonrpc: "2.0",
id: 1,
method: "dev_newBlock",
params: [{ count: 1 }],
params: [{ count: 2 }],
};

ws.send(JSON.stringify(message));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ describeSuite({
"ZeitgeistPara",
zeitgeistParaApi,
hydradxParaApi,
"HydraDXPara",
HYDRADX_PARA_ID,
ZEITGEIST_TOKENS_INDEX
);
Expand Down

0 comments on commit 7b17925

Please sign in to comment.