@acala-network/chopsticks-core 0.9.2-2 → 0.9.2-3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -147,7 +147,9 @@ class SetValidationData {
147
147
  if (!abridgedHrmpRaw) throw new Error('Canoot find hrmp channels from validation data');
148
148
  const abridgedHrmp = meta.registry.createType('AbridgedHrmpChannel', (0, _util.hexToU8a)(abridgedHrmpRaw)).toJSON();
149
149
  const paraMessages = [];
150
- for (const { data, sentAt } of messages){
150
+ for (const { data, sentAt: _unused } of messages){
151
+ // fake relaychain sentAt to make validationData think this msg was sent at previous block
152
+ const sentAt = extrinsic.validationData.relayParentNumber + 1;
151
153
  // calculate new hash
152
154
  const bytes = meta.registry.createType('Bytes', data);
153
155
  abridgedHrmp.mqcHead = (0, _utilcrypto.blake2AsHex)((0, _util.u8aConcat)(meta.registry.createType('Hash', abridgedHrmp.mqcHead).toU8a(), meta.registry.createType('BlockNumber', sentAt).toU8a(), (0, _utilcrypto.blake2AsU8a)(bytes.toU8a(), 256)), 256);
@@ -132,7 +132,9 @@ export class SetValidationData {
132
132
  if (!abridgedHrmpRaw) throw new Error('Canoot find hrmp channels from validation data');
133
133
  const abridgedHrmp = meta.registry.createType('AbridgedHrmpChannel', hexToU8a(abridgedHrmpRaw)).toJSON();
134
134
  const paraMessages = [];
135
- for (const { data, sentAt } of messages){
135
+ for (const { data, sentAt: _unused } of messages){
136
+ // fake relaychain sentAt to make validationData think this msg was sent at previous block
137
+ const sentAt = extrinsic.validationData.relayParentNumber + 1;
136
138
  // calculate new hash
137
139
  const bytes = meta.registry.createType('Bytes', data);
138
140
  abridgedHrmp.mqcHead = blake2AsHex(u8aConcat(meta.registry.createType('Hash', abridgedHrmp.mqcHead).toU8a(), meta.registry.createType('BlockNumber', sentAt).toU8a(), blake2AsU8a(bytes.toU8a(), 256)), 256);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acala-network/chopsticks-core",
3
- "version": "0.9.2-2",
3
+ "version": "0.9.2-3",
4
4
  "author": "Acala Developers <hello@acala.network>",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -13,7 +13,7 @@
13
13
  "docs:prep": "typedoc"
14
14
  },
15
15
  "dependencies": {
16
- "@acala-network/chopsticks-executor": "0.9.2-2",
16
+ "@acala-network/chopsticks-executor": "0.9.2-3",
17
17
  "@polkadot/api": "^10.10.1",
18
18
  "@polkadot/util-crypto": "^12.5.1",
19
19
  "comlink": "^4.4.1",