-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Description
When attempting to submit a transaction using polkadot-api the transaction fails to progress beyond the broadcasted status, it never gets included in a block.
Fix
This issue was addressed by the PAPI team through:
- A PR to
polkadot-sdktx/broadcast: Use client info for fetching the best block paritytech/polkadot-sdk#8162 that adjusts transaction broadcasting logic for chains usingInstantSeal. - A PR to
polkadot-apifix(client): takegenesisHashfrom RPC polkadot-api/polkadot-api#982 that updates the library to fetch the genesisHash from the RPC endpoint.
To resolve the issue in ink-node, we need to upgrade ink-node to a version of polkadot-sdk that includes paritytech/polkadot-sdk#8162
Steps to Reproduce
- Run the ink-node:
cargo run --release - Run
pnpm papi add -w ws://127.0.0.1:9944 inknode - Execute the following JS snippet:
import { inknode } from "./.papi/descriptors/dist"
import { createClient } from "polkadot-api"
import { withPolkadotSdkCompat } from "polkadot-api/polkadot-sdk-compat"
import { getWsProvider } from "polkadot-api/ws-provider/web"
import { aliceSigner } from "./signer.js";
const client = createClient(
withPolkadotSdkCompat(
getWsProvider("ws://localhost:9944"),
),
);
const clientApi = client.getTypedApi(inknode);
const BOB = "5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty"
const transfer = clientApi.tx.Balances.transfer_allow_death({
dest: MultiAddress.Id(BOB),
value: 12345n,
});
transfer.signSubmitAndWatch(aliceSigner).subscribe({
next: (event) => {
console.log("Tx event: ", event.type)
if (event.type === "txBestBlocksState") {
console.log("The tx is now in a best block, check it out:")
console.log(`https://westend.subscan.io/extrinsic/${event.txHash}`)
}
},
error: console.error,
});Metadata
Metadata
Assignees
Labels
No labels