@substrate/api-sidecar 14.0.0 → 14.0.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.
- package/build/package.json +4 -4
- package/build/src/services/node/NodeTransactionPoolService.js +7 -4
- package/build/src/services/node/NodeTransactionPoolService.js.map +1 -1
- package/build/src/services/node/NodeTransactionPoolService.spec.js +4 -4
- package/package.json +4 -4
- package/build/src/controllers/pallets/PalletsNominationPoolsController.d.ts +0 -0
- package/build/src/controllers/pallets/PalletsNominationPoolsController.js +0 -2
- package/build/src/controllers/pallets/PalletsNominationPoolsController.js.map +0 -1
package/build/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "14.0.
|
|
2
|
+
"version": "14.0.1",
|
|
3
3
|
"name": "@substrate/api-sidecar",
|
|
4
4
|
"description": "REST service that makes it easy to interact with blockchain nodes built using Substrate's FRAME framework.",
|
|
5
5
|
"homepage": "https://github.com/paritytech/substrate-api-sidecar#readme",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"update-pjs-deps": "substrate-update-pjs-deps && yarn"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@polkadot/api": "^9.
|
|
57
|
-
"@polkadot/util-crypto": "^10.1.
|
|
56
|
+
"@polkadot/api": "^9.5.2",
|
|
57
|
+
"@polkadot/util-crypto": "^10.1.11",
|
|
58
58
|
"@substrate/calc": "^0.3.0",
|
|
59
59
|
"argparse": "^2.0.1",
|
|
60
60
|
"confmgr": "1.0.9",
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"polkadot",
|
|
87
87
|
"kusama"
|
|
88
88
|
],
|
|
89
|
-
"packageManager": "yarn@3.2.
|
|
89
|
+
"packageManager": "yarn@3.2.4"
|
|
90
90
|
}
|
|
@@ -86,11 +86,11 @@ class NodeTransactionPoolService extends AbstractService_1.AbstractService {
|
|
|
86
86
|
const { tip, encodedLength: len } = ext;
|
|
87
87
|
const BN_ONE = new bn_js_1.default(1);
|
|
88
88
|
const sanitizedClass = this.defineDispatchClassType(dispatchClass);
|
|
89
|
-
const maxBlockWeight = api.consts.system.blockWeights.maxBlock;
|
|
90
|
-
const maxLength = api.consts.system.blockLength.max[sanitizedClass];
|
|
89
|
+
const maxBlockWeight = api.consts.system.blockWeights.maxBlock.refTime.unwrap();
|
|
90
|
+
const maxLength = new bn_js_1.default(api.consts.system.blockLength.max[sanitizedClass]);
|
|
91
91
|
const boundedWeight = bn_js_1.default.min(bn_js_1.default.max(weight.toBn(), BN_ONE), maxBlockWeight);
|
|
92
92
|
const boundedLength = bn_js_1.default.min(bn_js_1.default.max(new bn_js_1.default(len), BN_ONE), maxLength);
|
|
93
|
-
const maxTxPerBlockWeight = maxBlockWeight.div(boundedWeight);
|
|
93
|
+
const maxTxPerBlockWeight = maxBlockWeight.toBn().div(boundedWeight);
|
|
94
94
|
const maxTxPerBlockLength = maxLength.div(boundedLength);
|
|
95
95
|
const maxTxPerBlock = bn_js_1.default.min(maxTxPerBlockWeight, maxTxPerBlockLength);
|
|
96
96
|
const saturatedTip = tip.toBn().add(BN_ONE);
|
|
@@ -114,7 +114,10 @@ class NodeTransactionPoolService extends AbstractService_1.AbstractService {
|
|
|
114
114
|
break;
|
|
115
115
|
}
|
|
116
116
|
const { baseFee, lenFee, adjustedWeightFee } = inclusionFee.unwrap();
|
|
117
|
-
const computedInclusionFee = baseFee
|
|
117
|
+
const computedInclusionFee = baseFee
|
|
118
|
+
.toBn()
|
|
119
|
+
.add(lenFee)
|
|
120
|
+
.add(adjustedWeightFee);
|
|
118
121
|
const finalFee = computedInclusionFee.add(tip.toBn());
|
|
119
122
|
const virtualTip = finalFee.mul(operationalFeeMultiplier);
|
|
120
123
|
const scaledVirtualTip = this.maxReward(virtualTip, maxTxPerBlock);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeTransactionPoolService.js","sourceRoot":"","sources":["../../../../src/services/node/NodeTransactionPoolService.ts"],"names":[],"mappings":";AAAA,oDAAoD;AACpD,8CAA8C;AAC9C,EAAE;AACF,gFAAgF;AAChF,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,kEAAkE;AAClE,iEAAiE;AACjE,gEAAgE;AAChE,+CAA+C;AAC/C,EAAE;AACF,oEAAoE;AACpE,wEAAwE;;;;;;
|
|
1
|
+
{"version":3,"file":"NodeTransactionPoolService.js","sourceRoot":"","sources":["../../../../src/services/node/NodeTransactionPoolService.ts"],"names":[],"mappings":";AAAA,oDAAoD;AACpD,8CAA8C;AAC9C,EAAE;AACF,gFAAgF;AAChF,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,kEAAkE;AAClE,iEAAiE;AACjE,gEAAgE;AAChE,+CAA+C;AAC/C,EAAE;AACF,oEAAoE;AACpE,wEAAwE;;;;;;AAGxE,kDAAuB;AAGvB,wDAAqD;AAErD,MAAa,0BAA2B,SAAQ,iCAAe;IAC9D;;;;;OAKG;IACI,KAAK,CAAC,oBAAoB,CAChC,UAAmB;QAEnB,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;QACrB,MAAM,UAAU,GAAG,MAAM,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAC;QAE5D,IAAI,UAAU,EAAE;YACf,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,GAAG,CAC7B,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC,CACvD,CAAC;YAEF,OAAO;gBACN,IAAI;aACJ,CAAC;SACF;aAAM;YACN,OAAO;gBACN,IAAI,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;oBAC5B,OAAO;wBACN,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE;wBACtB,gBAAgB,EAAE,GAAG,CAA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AAtKD,gEAsKC"}
|
|
@@ -47,8 +47,8 @@ describe('NodeTransactionPoolService', () => {
|
|
|
47
47
|
it('works when query param `includeFee` is set to true for normal extrinsics', async () => {
|
|
48
48
|
// This test does not use the same metadata in defaultMockApi. It changes it to v9190,
|
|
49
49
|
// and sets it back to the default value after.
|
|
50
|
-
const normalExt = registries_1.
|
|
51
|
-
const pool = registries_1.
|
|
50
|
+
const normalExt = registries_1.polkadotRegistryV9300.createType('Extrinsic', '0x4d028400d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d0196a6cd1652fc83c449884f67e8f444587b69c5874512f1d746ff6f062a097b2acedfe8d2e07915b4c93cc1c3b48a16ebccc1db8eb810146373ba53c9f42ab48e4500000284d717050300e281b7ec09fb8420ca7ba3fbd627fbe203ff04b2ba0777ae1d8a6942257af0230700e8764817');
|
|
51
|
+
const pool = registries_1.polkadotRegistryV9300.createType('Vec<Extrinsic>', [
|
|
52
52
|
normalExt,
|
|
53
53
|
]);
|
|
54
54
|
mock_1.defaultMockApi.rpc.author.pendingExtrinsics = () => Promise.resolve().then(() => pool);
|
|
@@ -56,8 +56,8 @@ describe('NodeTransactionPoolService', () => {
|
|
|
56
56
|
mock_1.defaultMockApi.rpc.author.pendingExtrinsics = mock_1.pendingExtrinsics;
|
|
57
57
|
});
|
|
58
58
|
it('works when query param `includeFee` is set to true for operational extrinsics', async () => {
|
|
59
|
-
const operationalExt = registries_1.
|
|
60
|
-
const pool = registries_1.
|
|
59
|
+
const operationalExt = registries_1.polkadotRegistryV9300.createType('Extrinsic', '0x350284004adf51a47b72795366d52285e329229c836ea7bbfe139dbe8fa0700c4f86fc5601fc44dcd1994c111671b3577b02e391be8aff10f7ccf766f3189859ea343db041779a67f9357cba0ba051f83d63e45e7a88b5e2ca642181592052acd9f4ccc8821501c107000f03f2af187bbc8a4a2b5a28c2a3c2d85bf7e5b1700cbf1207a8e4c1eb7d8e7e4037350301');
|
|
60
|
+
const pool = registries_1.polkadotRegistryV9300.createType('Vec<Extrinsic>', [
|
|
61
61
|
operationalExt,
|
|
62
62
|
]);
|
|
63
63
|
mock_1.defaultMockApi.rpc.author.pendingExtrinsics = () => Promise.resolve().then(() => pool);
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "14.0.
|
|
2
|
+
"version": "14.0.1",
|
|
3
3
|
"name": "@substrate/api-sidecar",
|
|
4
4
|
"description": "REST service that makes it easy to interact with blockchain nodes built using Substrate's FRAME framework.",
|
|
5
5
|
"homepage": "https://github.com/paritytech/substrate-api-sidecar#readme",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"update-pjs-deps": "substrate-update-pjs-deps && yarn"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@polkadot/api": "^9.
|
|
57
|
-
"@polkadot/util-crypto": "^10.1.
|
|
56
|
+
"@polkadot/api": "^9.5.2",
|
|
57
|
+
"@polkadot/util-crypto": "^10.1.11",
|
|
58
58
|
"@substrate/calc": "^0.3.0",
|
|
59
59
|
"argparse": "^2.0.1",
|
|
60
60
|
"confmgr": "1.0.9",
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"polkadot",
|
|
87
87
|
"kusama"
|
|
88
88
|
],
|
|
89
|
-
"packageManager": "yarn@3.2.
|
|
89
|
+
"packageManager": "yarn@3.2.4"
|
|
90
90
|
}
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PalletsNominationPoolsController.js","sourceRoot":"","sources":["../../../../src/controllers/pallets/PalletsNominationPoolsController.ts"],"names":[],"mappings":""}
|