Skip to content

Commit

Permalink
api augment and fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Agusrodri committed Feb 12, 2025
1 parent caf3970 commit b7656d6
Show file tree
Hide file tree
Showing 7 changed files with 545 additions and 460 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import "@tanssi/api-augment";
import { describeSuite, expect, beforeAll } from "@moonwall/cli";
import { ApiPromise, Keyring } from "@polkadot/api";
import { type ApiPromise, Keyring } from "@polkadot/api";

describeSuite({
id: "DTR1701",
Expand All @@ -17,7 +17,7 @@ describeSuite({
it({
id: "E01",
title: "setTokenTransferChannel should update channel details",
test: async function () {
test: async () => {
const keyring = new Keyring({ type: "sr25519" });
const alice = keyring.addFromUri("//Alice", { name: "Alice default" });

Expand All @@ -43,11 +43,13 @@ describeSuite({

const currentChannelInfoAfter = (
await polkadotJs.query.ethereumTokenTransfers.currentChannelInfo()
).toJSON();
).unwrap();

console.log("currentChannelInfoAfter", currentChannelInfoAfter);

expect(currentChannelInfoAfter["channelId"]).to.eq(newChannelId);
expect(currentChannelInfoAfter["paraId"]).to.eq(newParaId);
expect(currentChannelInfoAfter["agentId"]).to.eq(newAgentId);
expect(currentChannelInfoAfter.channelId).to.eq(newChannelId);
expect(currentChannelInfoAfter.paraId).to.eq(newParaId);
expect(currentChannelInfoAfter.agentId).to.eq(newAgentId);
},
});
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import "@tanssi/api-augment";
import { describeSuite, expect, beforeAll } from "@moonwall/cli";
import { ApiPromise, Keyring } from "@polkadot/api";
import { MultiLocation } from "../../../util/xcm";
import { type ApiPromise, Keyring } from "@polkadot/api";
import type { MultiLocation } from "../../../util/xcm";
import { expectEventCount } from "../../../helpers/events";

describeSuite({
Expand All @@ -19,7 +19,7 @@ describeSuite({
it({
id: "E01",
title: "transferNativeToken should send message to Ethereum",
test: async function () {
test: async () => {
const keyring = new Keyring({ type: "sr25519" });
const alice = keyring.addFromUri("//Alice", { name: "Alice default" });

Expand Down Expand Up @@ -73,9 +73,9 @@ describeSuite({
// Should have resulted in a new "other" digest log being included in the block
const baseHeader = await polkadotJs.rpc.chain.getHeader();
const allLogs = baseHeader.digest.logs.map((x) => x.toJSON());
const otherLogs = allLogs.filter((x) => x["other"]);
const otherLogs = allLogs.filter((x) => x.other);
expect(otherLogs.length).to.be.equal(1);
const logHex = otherLogs[0]["other"];
const logHex = otherLogs[0].other;

await expectEventCount(polkadotJs, {
MessagesCommitted: 1,
Expand All @@ -88,7 +88,7 @@ describeSuite({
// Also a MessagesCommitted event with the same hash as the digest log
const events = await polkadotJs.query.system.events();
const ev1 = events.filter((a) => {
return a.event.method == "MessagesCommitted";
return a.event.method === "MessagesCommitted";
});
expect(ev1.length).to.be.equal(1);
const ev1Data = ev1[0].event.data[0].toJSON();
Expand Down
32 changes: 24 additions & 8 deletions typescript-api/src/dancelight/interfaces/augment-api-errors.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions typescript-api/src/dancelight/interfaces/augment-api-events.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion typescript-api/src/dancelight/interfaces/augment-api-tx.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b7656d6

Please sign in to comment.