sp-api: Move macro related re-exports to __private (#2446)

This moves the macro related re-exports to `__private` to make it more
obvious for downstream users that they are using an internal api.

---------

Co-authored-by: command-bot <>
This commit is contained in:
Bastian Köcher
2023-11-23 14:52:46 +01:00
committed by GitHub
parent 12062f6a3a
commit 21f1811c66
30 changed files with 124 additions and 99 deletions
+2 -1
View File
@@ -36,6 +36,7 @@
use sp_runtime::traits::{Convert, Member};
use sp_std::prelude::*;
use codec::Decode;
use pallet_mmr::{LeafDataProvider, ParentNumberAndHash};
use sp_consensus_beefy::{
mmr::{BeefyAuthoritySet, BeefyDataProvider, BeefyNextAuthoritySet, MmrLeaf, MmrLeafVersion},
@@ -226,7 +227,7 @@ sp_api::decl_runtime_apis! {
/// API useful for BEEFY light clients.
pub trait BeefyMmrApi<H>
where
BeefyAuthoritySet<H>: sp_api::Decode,
BeefyAuthoritySet<H>: Decode,
{
/// Return the currently active BEEFY authority set proof.
fn authority_set_proof() -> BeefyAuthoritySet<H>;
@@ -33,9 +33,8 @@ use frame_support::{
},
DefaultNoBound, RuntimeDebugNoBound,
};
use sp_api::HashT;
use sp_runtime::{
traits::{Saturating, Zero},
traits::{Hash as HashT, Saturating, Zero},
DispatchError, FixedPointNumber, FixedU128,
};
use sp_std::{fmt::Debug, marker::PhantomData, vec, vec::Vec};
+4 -3
View File
@@ -14,9 +14,10 @@ targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive"] }
pallet-nfts = { path = "..", default-features = false}
sp-api = { path = "../../../primitives/api", default-features = false}
pallet-nfts = { path = "..", default-features = false }
sp-api = { path = "../../../primitives/api", default-features = false }
sp-std = { path = "../../../primitives/std", default-features = false }
[features]
default = [ "std" ]
std = [ "codec/std", "pallet-nfts/std", "sp-api/std" ]
std = [ "codec/std", "pallet-nfts/std", "sp-api/std", "sp-std/std" ]
+1 -1
View File
@@ -20,7 +20,7 @@
#![cfg_attr(not(feature = "std"), no_std)]
use codec::{Decode, Encode};
use sp_api::vec::Vec;
use sp_std::vec::Vec;
sp_api::decl_runtime_apis! {
pub trait NftsApi<AccountId, CollectionId, ItemId>
@@ -27,13 +27,13 @@ use frame_support::{
};
use frame_system::limits::{BlockLength, BlockWeights};
use scale_info::TypeInfo;
use sp_api::RuntimeVersion;
use sp_core::{sr25519, ConstU64};
use sp_runtime::{
generic,
traits::{BlakeTwo256, Verify},
DispatchError, ModuleError,
};
use sp_version::RuntimeVersion;
parameter_types! {
pub static IntegrityTestExec: u32 = 0;