@acala-network/chopsticks-core 0.14.0 → 0.14.2-1
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.
|
@@ -211,7 +211,7 @@ class TxPool {
|
|
|
211
211
|
horizontalMessages,
|
|
212
212
|
unsafeBlockHeight
|
|
213
213
|
});
|
|
214
|
-
// with the latest message queue, messages
|
|
214
|
+
// with the latest message queue, messages could be processed in the upcoming block
|
|
215
215
|
if (!_class_private_field_get(this, _chain).processQueuedMessages) return;
|
|
216
216
|
// if block was built without horizontal or downward messages then skip
|
|
217
217
|
if (_lodash.default.isEmpty(horizontalMessages) && _lodash.default.isEmpty(downwardMessages)) return;
|
|
@@ -226,7 +226,7 @@ class TxPool {
|
|
|
226
226
|
const rawValue = await _class_private_field_get(this, _chain).head.get(key);
|
|
227
227
|
if (!rawValue) continue;
|
|
228
228
|
const message = meta.registry.createType('PalletMessageQueueBookState', (0, _toU8a.hexToU8a)(rawValue)).toJSON();
|
|
229
|
-
if (message.size > 0) {
|
|
229
|
+
if (message.size > 0 && message.end > message.begin) {
|
|
230
230
|
logger.info('Queued messages detected, building a new block');
|
|
231
231
|
// build a new block to process the queued messages
|
|
232
232
|
await _class_private_field_get(this, _chain).newBlock();
|
|
@@ -213,6 +213,22 @@ class GenesisProvider {
|
|
|
213
213
|
if (params.length < 1) throw Error('invalid params');
|
|
214
214
|
return _class_private_field_get(this, _genesis).genesis.raw.top[params[0]];
|
|
215
215
|
}
|
|
216
|
+
case 'state_queryStorageAt':
|
|
217
|
+
{
|
|
218
|
+
if (params.length < 2) throw Error('invalid params');
|
|
219
|
+
const [keys, hash] = params;
|
|
220
|
+
const values = [];
|
|
221
|
+
for (const key of keys){
|
|
222
|
+
const storage = _class_private_field_get(this, _genesis).genesis.raw.top[key];
|
|
223
|
+
if (storage) {
|
|
224
|
+
values.push(storage);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
return {
|
|
228
|
+
block: hash,
|
|
229
|
+
changes: values
|
|
230
|
+
};
|
|
231
|
+
}
|
|
216
232
|
default:
|
|
217
233
|
throw Error(`${method} not implemented`);
|
|
218
234
|
}
|
|
@@ -156,7 +156,7 @@ export class TxPool {
|
|
|
156
156
|
horizontalMessages,
|
|
157
157
|
unsafeBlockHeight
|
|
158
158
|
});
|
|
159
|
-
// with the latest message queue, messages
|
|
159
|
+
// with the latest message queue, messages could be processed in the upcoming block
|
|
160
160
|
if (!this.#chain.processQueuedMessages) return;
|
|
161
161
|
// if block was built without horizontal or downward messages then skip
|
|
162
162
|
if (_.isEmpty(horizontalMessages) && _.isEmpty(downwardMessages)) return;
|
|
@@ -171,7 +171,7 @@ export class TxPool {
|
|
|
171
171
|
const rawValue = await this.#chain.head.get(key);
|
|
172
172
|
if (!rawValue) continue;
|
|
173
173
|
const message = meta.registry.createType('PalletMessageQueueBookState', hexToU8a(rawValue)).toJSON();
|
|
174
|
-
if (message.size > 0) {
|
|
174
|
+
if (message.size > 0 && message.end > message.begin) {
|
|
175
175
|
logger.info('Queued messages detected, building a new block');
|
|
176
176
|
// build a new block to process the queued messages
|
|
177
177
|
await this.#chain.newBlock();
|
|
@@ -149,6 +149,22 @@ import { defaultLogger, isPrefixedChildKey } from './index.js';
|
|
|
149
149
|
if (params.length < 1) throw Error('invalid params');
|
|
150
150
|
return this.#genesis.genesis.raw.top[params[0]];
|
|
151
151
|
}
|
|
152
|
+
case 'state_queryStorageAt':
|
|
153
|
+
{
|
|
154
|
+
if (params.length < 2) throw Error('invalid params');
|
|
155
|
+
const [keys, hash] = params;
|
|
156
|
+
const values = [];
|
|
157
|
+
for (const key of keys){
|
|
158
|
+
const storage = this.#genesis.genesis.raw.top[key];
|
|
159
|
+
if (storage) {
|
|
160
|
+
values.push(storage);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
return {
|
|
164
|
+
block: hash,
|
|
165
|
+
changes: values
|
|
166
|
+
};
|
|
167
|
+
}
|
|
152
168
|
default:
|
|
153
169
|
throw Error(`${method} not implemented`);
|
|
154
170
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acala-network/chopsticks-core",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.2-1",
|
|
4
4
|
"author": "Acala Developers <hello@acala.network>",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"depcheck": "npx depcheck"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@acala-network/chopsticks-executor": "0.14.
|
|
14
|
+
"@acala-network/chopsticks-executor": "0.14.2-1",
|
|
15
15
|
"@polkadot/rpc-provider": "^12.3.1",
|
|
16
16
|
"@polkadot/types": "^12.3.1",
|
|
17
17
|
"@polkadot/types-codec": "^12.3.1",
|