diff --git a/packages/chopsticks/src/xcm/downward.ts b/packages/chopsticks/src/xcm/downward.ts index eb7769fa..8c13b227 100644 --- a/packages/chopsticks/src/xcm/downward.ts +++ b/packages/chopsticks/src/xcm/downward.ts @@ -15,7 +15,7 @@ export const connectDownward = async (relaychain: Blockchain, parachain: Blockch const value = pairs[0][1] if (!value) return - const meta = await relaychain.head.meta + const meta = await head.meta const downwardMessageQueuesKey = compactHex(meta.query.dmp.downwardMessageQueues(paraId)) // clear relaychain message queue diff --git a/packages/chopsticks/src/xcm/horizontal.ts b/packages/chopsticks/src/xcm/horizontal.ts index de578cea..0bf6665e 100644 --- a/packages/chopsticks/src/xcm/horizontal.ts +++ b/packages/chopsticks/src/xcm/horizontal.ts @@ -5,7 +5,6 @@ import { Blockchain } from '../blockchain' import { HorizontalMessage } from '../blockchain/txpool' import { compactHex } from '../utils' import { logger } from '.' -import { setStorage } from '../utils/set-storage' export const connectHorizontal = async (parachains: Record) => { for (const [id, chain] of Object.entries(parachains)) { @@ -17,12 +16,7 @@ export const connectHorizontal = async (parachains: Record) const value = pairs[0][1] if (!value) return - const meta = await chain.head.meta - - const hrmpOutboundMessagesKey = compactHex(meta.query.parachainSystem.hrmpOutboundMessages()) - - // clear sender message queue - await setStorage(chain, [[hrmpOutboundMessagesKey, null]], head.hash) + const meta = await head.meta const outboundHrmpMessage = meta.registry .createType('Vec', hexToU8a(value)) @@ -32,7 +26,7 @@ export const connectHorizontal = async (parachains: Record) for (const { recipient, data } of outboundHrmpMessage) { const horizontalMessages: Record = { - [Number(id)]: [{ sentAt: chain.head.number, data }], + [Number(id)]: [{ sentAt: head.number, data }], } const receiver = parachains[recipient] if (receiver) { diff --git a/packages/chopsticks/src/xcm/upward.ts b/packages/chopsticks/src/xcm/upward.ts index cbb54f0d..d072693b 100644 --- a/packages/chopsticks/src/xcm/upward.ts +++ b/packages/chopsticks/src/xcm/upward.ts @@ -3,7 +3,6 @@ import { hexToU8a } from '@polkadot/util' import { Blockchain } from '../blockchain' import { compactHex, getParaId } from '../utils' import { logger } from '.' -import { setStorage } from '../utils/set-storage' export const connectUpward = async (parachain: Blockchain, relaychain: Blockchain) => { const meta = await parachain.head.meta @@ -14,12 +13,7 @@ export const connectUpward = async (parachain: Blockchain, relaychain: Blockchai const value = pairs[0][1] if (!value) return - const parachainMeta = await parachain.head.meta - const upwardMessagesKey = compactHex(parachainMeta.query.parachainSystem.upwardMessages()) - - // clear parachain message queue - await setStorage(parachain, [[upwardMessagesKey, null]], head.hash) - + const parachainMeta = await head.meta const relaychainMeta = await relaychain.head.meta const upwardMessages = parachainMeta.registry.createType('Vec', hexToU8a(value))