@acala-network/chopsticks-core 0.9.6-4 → 0.9.6

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.
@@ -117,21 +117,19 @@ class SetValidationData {
117
117
  (0, _util.u8aToHex)(headData.toU8a())
118
118
  ]);
119
119
  // inject downward messages
120
- let dmqMqcHeadHash = decoded[dmqMqcHeadKey];
121
- if (dmqMqcHeadHash) {
122
- for (const { msg, sentAt } of params.downwardMessages){
123
- // calculate new hash
124
- dmqMqcHeadHash = (0, _utilcrypto.blake2AsHex)((0, _util.u8aConcat)(meta.registry.createType('Hash', dmqMqcHeadHash).toU8a(), meta.registry.createType('BlockNumber', sentAt).toU8a(), (0, _utilcrypto.blake2AsU8a)(meta.registry.createType('Bytes', msg).toU8a(), 256)), 256);
125
- downwardMessages.push({
126
- msg,
127
- sentAt
128
- });
129
- }
130
- newEntries.push([
131
- dmqMqcHeadKey,
132
- dmqMqcHeadHash
133
- ]);
120
+ let dmqMqcHeadHash = decoded[dmqMqcHeadKey] || '0x0000000000000000000000000000000000000000000000000000000000000000';
121
+ for (const { msg, sentAt } of params.downwardMessages){
122
+ // calculate new hash
123
+ dmqMqcHeadHash = (0, _utilcrypto.blake2AsHex)((0, _util.u8aConcat)(meta.registry.createType('Hash', dmqMqcHeadHash).toU8a(), meta.registry.createType('BlockNumber', sentAt).toU8a(), (0, _utilcrypto.blake2AsU8a)(meta.registry.createType('Bytes', msg).toU8a(), 256)), 256);
124
+ downwardMessages.push({
125
+ msg,
126
+ sentAt
127
+ });
134
128
  }
129
+ newEntries.push([
130
+ dmqMqcHeadKey,
131
+ dmqMqcHeadHash
132
+ ]);
135
133
  const hrmpIngressChannels = meta.registry.createType('Vec<ParaId>', decoded[hrmpIngressChannelIndexKey]).toJSON();
136
134
  const hrmpEgressChannels = meta.registry.createType('Vec<ParaId>', decoded[hrmpEgressChannelIndexKey]).toJSON();
137
135
  const hrmpMessages = {
@@ -102,21 +102,19 @@ export class SetValidationData {
102
102
  u8aToHex(headData.toU8a())
103
103
  ]);
104
104
  // inject downward messages
105
- let dmqMqcHeadHash = decoded[dmqMqcHeadKey];
106
- if (dmqMqcHeadHash) {
107
- for (const { msg, sentAt } of params.downwardMessages){
108
- // calculate new hash
109
- dmqMqcHeadHash = blake2AsHex(u8aConcat(meta.registry.createType('Hash', dmqMqcHeadHash).toU8a(), meta.registry.createType('BlockNumber', sentAt).toU8a(), blake2AsU8a(meta.registry.createType('Bytes', msg).toU8a(), 256)), 256);
110
- downwardMessages.push({
111
- msg,
112
- sentAt
113
- });
114
- }
115
- newEntries.push([
116
- dmqMqcHeadKey,
117
- dmqMqcHeadHash
118
- ]);
105
+ let dmqMqcHeadHash = decoded[dmqMqcHeadKey] || '0x0000000000000000000000000000000000000000000000000000000000000000';
106
+ for (const { msg, sentAt } of params.downwardMessages){
107
+ // calculate new hash
108
+ dmqMqcHeadHash = blake2AsHex(u8aConcat(meta.registry.createType('Hash', dmqMqcHeadHash).toU8a(), meta.registry.createType('BlockNumber', sentAt).toU8a(), blake2AsU8a(meta.registry.createType('Bytes', msg).toU8a(), 256)), 256);
109
+ downwardMessages.push({
110
+ msg,
111
+ sentAt
112
+ });
119
113
  }
114
+ newEntries.push([
115
+ dmqMqcHeadKey,
116
+ dmqMqcHeadHash
117
+ ]);
120
118
  const hrmpIngressChannels = meta.registry.createType('Vec<ParaId>', decoded[hrmpIngressChannelIndexKey]).toJSON();
121
119
  const hrmpEgressChannels = meta.registry.createType('Vec<ParaId>', decoded[hrmpEgressChannelIndexKey]).toJSON();
122
120
  const hrmpMessages = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acala-network/chopsticks-core",
3
- "version": "0.9.6-4",
3
+ "version": "0.9.6",
4
4
  "author": "Acala Developers <hello@acala.network>",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -12,7 +12,7 @@
12
12
  "docs:prep": "typedoc"
13
13
  },
14
14
  "dependencies": {
15
- "@acala-network/chopsticks-executor": "0.9.6-4",
15
+ "@acala-network/chopsticks-executor": "0.9.6",
16
16
  "@polkadot/rpc-provider": "^10.10.1",
17
17
  "@polkadot/types": "^10.10.1",
18
18
  "@polkadot/types-codec": "^10.10.1",