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.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-rpc.ts
+++ b/tests/src/interfaces/augment-api-rpc.ts
@@ -436,6 +436,12 @@
**/
queryInfo: AugmentedRpc<(extrinsic: Bytes | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<RuntimeDispatchInfoV1>>;
};
+ povinfo: {
+ /**
+ * Estimate PoV size of encoded signed extrinsics
+ **/
+ estimateExtrinsicPoV: AugmentedRpc<(encodedXt: Vec<Bytes> | (Bytes | string | Uint8Array)[], at?: Hash | string | Uint8Array) => Observable<UpPovEstimateRpcPovInfo>>;
+ };
rmrk: {
/**
* Get tokens owned by an account in a collection
@@ -725,10 +731,6 @@
* Get effective collection limits
**/
effectiveCollectionLimits: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<UpDataStructsCollectionLimits>>>;
- /**
- * Estimate PoV size of an encoded extrinsic
- **/
- estimateExtrinsicPoV: AugmentedRpc<(encodedXt: Vec<Bytes> | (Bytes | string | Uint8Array)[], at?: Hash | string | Uint8Array) => Observable<UpPovEstimateRpcPovInfo>>;
/**
* Get the last token ID created in a collection
**/
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.tsdiffbeforeafterbothno changes
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(),