difftreelog
fix separate povinfo RPC
in: master
8 files changed
client/rpc/src/pov_estimate.rsdiffbeforeafterboth--- a/client/rpc/src/pov_estimate.rs
+++ b/client/rpc/src/pov_estimate.rs
@@ -122,7 +122,7 @@
#[rpc(server)]
#[async_trait]
pub trait PovEstimateApi<BlockHash> {
- #[method(name = "unique_estimateExtrinsicPoV")]
+ #[method(name = "povinfo_estimateExtrinsicPoV")]
fn estimate_extrinsic_pov(
&self,
encoded_xts: Vec<Bytes>,
tests/src/interfaces/augment-api-rpc.tsdiffbeforeafterboth436 **/436 **/437 queryInfo: AugmentedRpc<(extrinsic: Bytes | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<RuntimeDispatchInfoV1>>;437 queryInfo: AugmentedRpc<(extrinsic: Bytes | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<RuntimeDispatchInfoV1>>;438 };438 };439 povinfo: {440 /**441 * Estimate PoV size of encoded signed extrinsics442 **/443 estimateExtrinsicPoV: AugmentedRpc<(encodedXt: Vec<Bytes> | (Bytes | string | Uint8Array)[], at?: Hash | string | Uint8Array) => Observable<UpPovEstimateRpcPovInfo>>;444 };439 rmrk: {445 rmrk: {440 /**446 /**441 * Get tokens owned by an account in a collection447 * Get tokens owned by an account in a collection725 * Get effective collection limits731 * Get effective collection limits726 **/732 **/727 effectiveCollectionLimits: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<UpDataStructsCollectionLimits>>>;733 effectiveCollectionLimits: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<UpDataStructsCollectionLimits>>>;728 /**729 * Estimate PoV size of an encoded extrinsic730 **/731 estimateExtrinsicPoV: AugmentedRpc<(encodedXt: Vec<Bytes> | (Bytes | string | Uint8Array)[], at?: Hash | string | Uint8Array) => Observable<UpPovEstimateRpcPovInfo>>;732 /**734 /**733 * Get the last token ID created in a collection735 * Get the last token ID created in a collection734 **/736 **/tests/src/interfaces/definitions.tsdiffbeforeafterboth--- a/tests/src/interfaces/definitions.ts
+++ b/tests/src/interfaces/definitions.ts
@@ -17,4 +17,5 @@
export {default as unique} from './unique/definitions';
export {default as appPromotion} from './appPromotion/definitions';
export {default as rmrk} from './rmrk/definitions';
-export {default as default} from './default/definitions';
\ No newline at end of file
+export {default as povinfo} from './povinfo/definitions';
+export {default as default} from './default/definitions';
tests/src/interfaces/povinfo/definitions.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/interfaces/povinfo/definitions.ts
@@ -0,0 +1,40 @@
+// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
+// This file is part of Unique Network.
+
+// Unique Network is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Unique Network is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
+
+type RpcParam = {
+ name: string;
+ type: string;
+ isOptional?: true;
+};
+
+const atParam = {name: 'at', type: 'Hash', isOptional: true};
+
+const fun = (description: string, params: RpcParam[], type: string) => ({
+ description,
+ params: [...params, atParam],
+ type,
+});
+
+export default {
+ types: {},
+ rpc: {
+ estimateExtrinsicPoV: fun(
+ 'Estimate PoV size of encoded signed extrinsics',
+ [{name: 'encodedXt', type: 'Vec<Bytes>'}],
+ 'UpPovEstimateRpcPovInfo',
+ ),
+ },
+};
tests/src/interfaces/povinfo/index.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/interfaces/povinfo/index.ts
@@ -0,0 +1,4 @@
+// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
+/* eslint-disable */
+
+export * from './types';
tests/src/interfaces/povinfo/types.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/interfaces/povinfo/types.ts
@@ -0,0 +1,4 @@
+// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
+/* eslint-disable */
+
+export type PHANTOM_POVINFO = 'povinfo';
tests/src/interfaces/types.tsdiffbeforeafterboth--- a/tests/src/interfaces/types.ts
+++ b/tests/src/interfaces/types.ts
@@ -4,4 +4,5 @@
export * from './unique/types';
export * from './appPromotion/types';
export * from './rmrk/types';
+export * from './povinfo/types';
export * from './default/types';
tests/src/util/playgrounds/unique.dev.tsdiffbeforeafterboth--- a/tests/src/util/playgrounds/unique.dev.ts
+++ b/tests/src/util/playgrounds/unique.dev.ts
@@ -99,6 +99,7 @@
rpc: {
unique: defs.unique.rpc,
appPromotion: defs.appPromotion.rpc,
+ povinfo: defs.povinfo.rpc,
rmrk: defs.rmrk.rpc,
eth: {
feeHistory: {
@@ -324,7 +325,7 @@
}
async calculatePoVInfo(txs: any[]): Promise<IPovInfo> {
- const rawPovInfo = await this.helper.callRpc('api.rpc.unique.estimateExtrinsicPoV', [txs]);
+ const rawPovInfo = await this.helper.callRpc('api.rpc.povinfo.estimateExtrinsicPoV', [txs]);
const kvJson: {[key: string]: string} = {};
@@ -342,6 +343,10 @@
],
);
+ if (!chainql.stdout) {
+ throw Error('unable to get an output from the `chainql`');
+ }
+
return {
proofSize: rawPovInfo.proofSize.toNumber(),
compactProofSize: rawPovInfo.compactProofSize.toNumber(),