git.delta.rocks / unique-network / refs/commits / c0e5e7725f2a

difftreelog

fix separate povinfo RPC

Daniel Shiposha2022-11-25parent: #52ec20b.patch.diff
in: master

8 files changed

modifiedclient/rpc/src/pov_estimate.rsdiffbeforeafterboth
122#[rpc(server)]122#[rpc(server)]
123#[async_trait]123#[async_trait]
124pub trait PovEstimateApi<BlockHash> {124pub trait PovEstimateApi<BlockHash> {
125 #[method(name = "unique_estimateExtrinsicPoV")]125 #[method(name = "povinfo_estimateExtrinsicPoV")]
126 fn estimate_extrinsic_pov(126 fn estimate_extrinsic_pov(
127 &self,127 &self,
128 encoded_xts: Vec<Bytes>,128 encoded_xts: Vec<Bytes>,
modifiedtests/src/interfaces/augment-api-rpc.tsdiffbeforeafterboth
436 **/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 extrinsics
442 **/
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 collection
725 * Get effective collection limits731 * Get effective collection limits
726 **/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 extrinsic
730 **/
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 collection
734 **/736 **/
modifiedtests/src/interfaces/definitions.tsdiffbeforeafterboth
17export {default as unique} from './unique/definitions';17export {default as unique} from './unique/definitions';
18export {default as appPromotion} from './appPromotion/definitions';18export {default as appPromotion} from './appPromotion/definitions';
19export {default as rmrk} from './rmrk/definitions';19export {default as rmrk} from './rmrk/definitions';
20export {default as povinfo} from './povinfo/definitions';
20export {default as default} from './default/definitions';21export {default as default} from './default/definitions';
22
addedtests/src/interfaces/povinfo/definitions.tsdiffbeforeafterboth

no changes

addedtests/src/interfaces/povinfo/index.tsdiffbeforeafterboth

no changes

addedtests/src/interfaces/povinfo/types.tsdiffbeforeafterboth

no changes

modifiedtests/src/interfaces/types.tsdiffbeforeafterboth
4export * from './unique/types';4export * from './unique/types';
5export * from './appPromotion/types';5export * from './appPromotion/types';
6export * from './rmrk/types';6export * from './rmrk/types';
7export * from './povinfo/types';
7export * from './default/types';8export * from './default/types';
89
modifiedtests/src/util/playgrounds/unique.dev.tsdiffbeforeafterboth
99 rpc: {99 rpc: {
100 unique: defs.unique.rpc,100 unique: defs.unique.rpc,
101 appPromotion: defs.appPromotion.rpc,101 appPromotion: defs.appPromotion.rpc,
102 povinfo: defs.povinfo.rpc,
102 rmrk: defs.rmrk.rpc,103 rmrk: defs.rmrk.rpc,
103 eth: {104 eth: {
104 feeHistory: {105 feeHistory: {
324 }325 }
325326
326 async calculatePoVInfo(txs: any[]): Promise<IPovInfo> {327 async calculatePoVInfo(txs: any[]): Promise<IPovInfo> {
327 const rawPovInfo = await this.helper.callRpc('api.rpc.unique.estimateExtrinsicPoV', [txs]);328 const rawPovInfo = await this.helper.callRpc('api.rpc.povinfo.estimateExtrinsicPoV', [txs]);
328329
329 const kvJson: {[key: string]: string} = {};330 const kvJson: {[key: string]: string} = {};
330331
342 ],343 ],
343 );344 );
345
346 if (!chainql.stdout) {
347 throw Error('unable to get an output from the `chainql`');
348 }
344349
345 return {350 return {
346 proofSize: rawPovInfo.proofSize.toNumber(),351 proofSize: rawPovInfo.proofSize.toNumber(),