Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
6fcc3f1
Substrate monthly update.
Neopallium Nov 21, 2022
e1c0386
Apply substrate monthly 2022-11 changes.
Neopallium Nov 21, 2022
f57c4bb
Apply more monthly 2022-11 changes.
Neopallium Nov 22, 2022
d78a398
cargo fmt and update `clap`
Neopallium Nov 23, 2022
2b58c6e
Fix no_std build errors.
Neopallium Nov 23, 2022
35aaf3a
Fix benchmarks.
Neopallium Nov 23, 2022
8b54cb7
Fix compiling of tests.
Neopallium Nov 29, 2022
3255660
Fix staking & transaction-payment tests.
Neopallium Nov 29, 2022
cdb39a3
Allow use of deprecated remove_prefix.
Neopallium Nov 29, 2022
e2722ee
Fix benchmarks.
Neopallium Nov 30, 2022
0e0fca5
Cargo fmt
Neopallium Dec 12, 2022
2e98fbc
Fixup.
Neopallium Dec 12, 2022
933d77f
Allow use of kill_prefix
Neopallium Dec 21, 2022
26f307d
FIXUP: Settlement weights.
Neopallium Dec 21, 2022
928c6a9
Fix issue with schedule weight limit.
Neopallium Dec 22, 2022
243aa3b
Fix contracts GAS_LIMIT to include a proof_size.
Neopallium Dec 22, 2022
2a8d026
Fix expected bridge weights in tests.
Neopallium Dec 22, 2022
dd37154
Add missing migrations.
Neopallium Jan 13, 2023
caa2f9c
Fixup: transaction payment RPC endpoints.
Neopallium Jan 16, 2023
5b57917
Cargo lock updates.
Neopallium Jan 16, 2023
3b5e536
Apply commit
Neopallium Jan 17, 2023
122cc19
Add more changes from Substrate balances pallet.
Neopallium Jan 17, 2023
72cbfa7
Update benchmark weights template.
Neopallium Jan 18, 2023
4ee04ec
Update weights type name.
Neopallium Jan 18, 2023
dc2a9f7
Charge minimal fee if the caller is not authorized.
Neopallium Jan 18, 2023
5c2c6f2
Update weights.
Neopallium Jan 19, 2023
d75689a
Update weights in bridge tests.
Neopallium Jan 19, 2023
ec9316b
Update Substrate crates.
Neopallium Jan 19, 2023
e20c6eb
Code cleanup in transaction-payment.
Neopallium Jan 20, 2023
85d9071
Fix issue with events in transaction-payment.
Neopallium Jan 20, 2023
674cffa
Update Substrate again.
Neopallium Jan 20, 2023
d8fd0cb
Add missing RuntimeEvent.
Neopallium Jan 20, 2023
18dd63e
Apply commit https://github.com/paritytech/substrate/pull/12633
Neopallium Jan 20, 2023
7557a0a
Allow use of remove_prefix.
Neopallium Jan 20, 2023
28244f9
Cargo fmt
Neopallium Jan 20, 2023
db8bcb3
Fix event count in tests.
Neopallium Jan 20, 2023
4ea375e
Update Substrate again.
Neopallium Jan 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
cargo fmt and update clap
  • Loading branch information
Neopallium committed Jan 20, 2023
commit d78a3989ab7b24c994cb10074ed145e5156dd24c
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ jsonrpsee = { version = "0.15.1", features = ["server"] }
log = "0.4.17"
serde = { version = "1.0.136", default-features = false }
serde_json = { version = "1.0", features = ["arbitrary_precision"] }
clap = { version = "3.1.6", features = ["derive"] }
clap = { version = "4.0.9", features = ["derive"] }
rustc-hex = "2.1.0"

# Pin version to work around substrate logging issue.
Expand Down
29 changes: 16 additions & 13 deletions node-rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@
use std::sync::Arc;

use jsonrpsee::RpcModule;
use polymesh_primitives::{
AccountId, Block, BlockNumber, Hash, IdentityId, Index, Moment, Ticker,
};
use polymesh_primitives::{AccountId, Block, BlockNumber, Hash, IdentityId, Index, Moment, Ticker};
use sc_client_api::AuxStore;
use sc_consensus_babe::{BabeConfiguration, Epoch};
use sc_consensus_epochs::SharedEpochChanges;
Expand Down Expand Up @@ -101,7 +99,7 @@ pub fn create_full<C, P, SC, B>(
) -> Result<RpcModule<()>, Box<dyn std::error::Error + Send + Sync>>
where
C: ProvideRuntimeApi<Block>
+ sc_client_api::BlockBackend<Block>
+ sc_client_api::BlockBackend<Block>
+ HeaderBackend<Block>
+ AuxStore
+ HeaderMetadata<Block, Error = BlockChainError>
Expand Down Expand Up @@ -167,7 +165,11 @@ where
} = grandpa;

let chain_name = chain_spec.name().to_string();
let genesis_hash = client.block_hash(0).ok().flatten().expect("Genesis block exists; qed");
let genesis_hash = client
.block_hash(0)
.ok()
.flatten()
.expect("Genesis block exists; qed");
let properties = chain_spec.properties();
io.merge(ChainSpec::new(chain_name, genesis_hash, properties).into_rpc())?;

Expand Down Expand Up @@ -199,8 +201,13 @@ where
)?;

io.merge(
SyncState::new(chain_spec, client.clone(), shared_authority_set, shared_epoch_changes)?
.into_rpc(),
SyncState::new(
chain_spec,
client.clone(),
shared_authority_set,
shared_epoch_changes,
)?
.into_rpc(),
)?;

io.merge(StateMigration::new(client.clone(), backend, deny_unsafe).into_rpc())?;
Expand All @@ -209,14 +216,10 @@ where
io.merge(Staking::new(client.clone()).into_rpc())?;
io.merge(Pips::new(client.clone()).into_rpc())?;
io.merge(Identity::new(client.clone()).into_rpc())?;
io.merge(ProtocolFee::new(
client.clone(),
).into_rpc())?;
io.merge(ProtocolFee::new(client.clone()).into_rpc())?;
io.merge(Asset::new(client.clone()).into_rpc())?;
io.merge(Group::from(client.clone()).into_rpc())?;
io.merge(ComplianceManager::new(
client,
).into_rpc())?;
io.merge(ComplianceManager::new(client).into_rpc())?;

Ok(io)
}
2 changes: 1 addition & 1 deletion pallets/group/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ use serde::{Deserialize, Serialize};

use std::{marker::PhantomData, sync::Arc};

use node_rpc::Error;
use jsonrpsee::{
core::RpcResult,
proc_macros::rpc,
types::error::{CallError, ErrorObject},
};
use node_rpc::Error;
use sp_api::ProvideRuntimeApi;
use sp_blockchain::HeaderBackend;
use sp_runtime::{generic::BlockId, traits::Block as BlockT};
Expand Down
2 changes: 1 addition & 1 deletion pallets/protocol-fee/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

use node_rpc::Error;
use jsonrpsee::{
core::RpcResult,
proc_macros::rpc,
types::error::{CallError, ErrorObject},
};
use node_rpc::Error;
pub use pallet_protocol_fee_rpc_runtime_api::{CappedFee, ProtocolFeeApi as ProtocolFeeRuntimeApi};
use polymesh_common_utilities::protocol_fee::ProtocolOp;
use sp_api::ProvideRuntimeApi;
Expand Down
2 changes: 1 addition & 1 deletion pallets/staking/rpc/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use node_rpc::Error;
use jsonrpsee::{
core::RpcResult,
proc_macros::rpc,
types::error::{CallError, ErrorObject},
};
use node_rpc::Error;
pub use pallet_staking_rpc_runtime_api::StakingApi as StakingRuntimeApi;
use sp_api::ProvideRuntimeApi;
use sp_blockchain::HeaderBackend;
Expand Down
10 changes: 4 additions & 6 deletions src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,10 @@ pub fn run() -> Result<()> {
cmd.run::<Block, service::GeneralExecutor>(config)
}
(BenchmarkCmd::Block(cmd), Network::Other) => {
let FullServiceComponents { client, .. } = new_partial::<
polymesh_runtime_develop::RuntimeApi,
GeneralExecutor,
>(
&mut config
)?;
let FullServiceComponents { client, .. } =
new_partial::<polymesh_runtime_develop::RuntimeApi, GeneralExecutor>(
&mut config,
)?;
cmd.run(client)
}
#[cfg(not(feature = "runtime-benchmarks"))]
Expand Down
31 changes: 17 additions & 14 deletions src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ use sc_network_common::{protocol::event::Event, service::NetworkEventStream};
use sc_service::{config::Configuration, error::Error as ServiceError, RpcHandlers, TaskManager};
pub use sc_service::{
config::{PrometheusConfig, Role},
ChainSpec, Error, PruningMode, RuntimeGenesis, TFullBackend, TFullCallExecutor,
TFullClient, TransactionPoolOptions,
ChainSpec, Error, PruningMode, RuntimeGenesis, TFullBackend, TFullCallExecutor, TFullClient,
TransactionPoolOptions,
};
use sc_telemetry::{Telemetry, TelemetryWorker};
pub use sp_api::{ConstructRuntimeApi, Core as CoreApi, ProvideRuntimeApi, StateBackend};
Expand Down Expand Up @@ -180,7 +180,10 @@ pub fn new_partial<R, D>(
FullServiceComponents<
R,
D,
impl Fn(sc_rpc::DenyUnsafe, sc_rpc::SubscriptionTaskExecutor) -> Result<jsonrpsee::RpcModule<()>, Error>,
impl Fn(
sc_rpc::DenyUnsafe,
sc_rpc::SubscriptionTaskExecutor,
) -> Result<jsonrpsee::RpcModule<()>, Error>,
>,
Error,
>
Expand Down Expand Up @@ -243,7 +246,7 @@ where
let justification_import = grandpa_block_import.clone();

let (block_import, babe_link) = sc_consensus_babe::block_import(
sc_consensus_babe::configuration(&*client)?,
sc_consensus_babe::configuration(&*client)?,
grandpa_block_import,
client.clone(),
)?;
Expand Down Expand Up @@ -298,7 +301,7 @@ where
let keystore = keystore_container.sync_keystore();
let chain_spec = config.chain_spec.cloned_box();

let rpc_backend = backend.clone();
let rpc_backend = backend.clone();
let rpc_extensions_builder = move |deny_unsafe, subscription_executor| {
let deps = node_rpc::FullDeps {
client: client.clone(),
Expand Down Expand Up @@ -344,16 +347,16 @@ where
R::RuntimeApi: RuntimeApiCollection<StateBackend = FullStateBackend>,
D: NativeExecutionDispatch + 'static,
{
/// The task manager of the node.
/// The task manager of the node.
pub task_manager: TaskManager,
/// The client instance of the node.
/// The client instance of the node.
pub client: Arc<FullClient<R, D>>,
/// The networking service of the node.
/// The networking service of the node.
pub network: Arc<NetworkService<Block, <Block as BlockT>::Hash>>,
/// The transaction pool of the node.
/// The transaction pool of the node.
pub transaction_pool: Arc<FullPool<R, D>>,
/// The rpc handlers of the node.
pub rpc_handlers: RpcHandlers,
/// The rpc handlers of the node.
pub rpc_handlers: RpcHandlers,
}

/// Creates a full service from the configuration.
Expand Down Expand Up @@ -610,19 +613,19 @@ type TaskResult = Result<TaskManager, ServiceError>;
/// Create a new Testnet service for a full node.
pub fn testnet_new_full(config: Configuration) -> TaskResult {
new_full_base::<polymesh_runtime_testnet::RuntimeApi, TestnetExecutor, _>(config, |_, _| ())
.map(|data| data.task_manager)
.map(|data| data.task_manager)
}

/// Create a new General node service for a full node.
pub fn general_new_full(config: Configuration) -> TaskResult {
new_full_base::<polymesh_runtime_develop::RuntimeApi, GeneralExecutor, _>(config, |_, _| ())
.map(|data| data.task_manager)
.map(|data| data.task_manager)
}

/// Create a new Mainnet service for a full node.
pub fn mainnet_new_full(config: Configuration) -> TaskResult {
new_full_base::<polymesh_runtime_mainnet::RuntimeApi, MainnetExecutor, _>(config, |_, _| ())
.map(|data| data.task_manager)
.map(|data| data.task_manager)
}

pub type NewChainOps<R, D> = (
Expand Down