Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
brenzi committed Feb 19, 2024
1 parent bc48c72 commit af41214
Show file tree
Hide file tree
Showing 16 changed files with 35 additions and 19 deletions.
6 changes: 6 additions & 0 deletions 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 balances-tx-payment/rpc/runtime-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

use core::fmt;
use frame_support::pallet_prelude::TypeInfo;
use sp_api::{Decode, Encode};
use parity_scale_codec::{Decode, Encode};
#[cfg(not(feature = "std"))]
use sp_std::vec::Vec;

Expand Down
3 changes: 2 additions & 1 deletion balances-tx-payment/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ pub use pallet_transaction_payment::RuntimeDispatchInfo;
use pallet_transaction_payment::{FeeDetails, InclusionFee};
use pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi;
use parity_scale_codec::Codec;
use sp_api::{Decode, Encode, ProvideRuntimeApi};
use parity_scale_codec::{Decode, Encode};
use sp_api::ProvideRuntimeApi;
use sp_blockchain::HeaderBackend;
use sp_core::Bytes;
use sp_rpc::number::NumberOrHex;
Expand Down
1 change: 1 addition & 0 deletions bazaar/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ license = "GPL-3.0-or-later"
[dependencies]
jsonrpsee = { workspace = true }
log = { workspace = true, features = ["std"] }
parity-scale-codec = { workspace = true }
parking_lot = { workspace = true }
thiserror = { workspace = true }

Expand Down
1 change: 1 addition & 0 deletions bazaar/rpc/runtime-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ encointer-primitives = { workspace = true }

# substrate deps
frame-support = { workspace = true }
parity-scale-codec = { workspace = true }
sp-api = { workspace = true }
sp-std = { workspace = true }

Expand Down
2 changes: 1 addition & 1 deletion bazaar/rpc/runtime-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use encointer_primitives::{
bazaar::{BusinessData, BusinessIdentifier, OfferingData},
communities::CommunityIdentifier,
};
use sp_api::{Decode, Encode};
use parity_scale_codec::{Decode, Encode};

sp_api::decl_runtime_apis! {
pub trait BazaarApi<AccountId>
Expand Down
3 changes: 2 additions & 1 deletion bazaar/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@

use encointer_rpc::Error;
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
use sp_api::{Decode, Encode, ProvideRuntimeApi};
use parity_scale_codec::{Decode, Encode};
use sp_api::ProvideRuntimeApi;
use sp_blockchain::HeaderBackend;
use sp_runtime::traits::Block as BlockT;
use std::sync::Arc;
Expand Down
1 change: 1 addition & 0 deletions ceremonies/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ license = "GPL-3.0-or-later"
[dependencies]
jsonrpsee = { workspace = true }
log = { workspace = true, features = ["std"] }
parity-scale-codec = { workspace = true }
parking_lot = { workspace = true }
thiserror = { workspace = true }

Expand Down
1 change: 1 addition & 0 deletions ceremonies/rpc/runtime-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ encointer-primitives = { workspace = true }

# substrate deps
frame-support = { workspace = true }
parity-scale-codec = { workspace = true }
sp-api = { workspace = true }
sp-std = { workspace = true }

Expand Down
2 changes: 1 addition & 1 deletion ceremonies/rpc/runtime-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use encointer_primitives::{
ceremonies::{AggregatedAccountData, CeremonyIndexType, CeremonyInfo, CommunityReputation},
communities::CommunityIdentifier,
};
use sp_api::{Decode, Encode};
use parity_scale_codec::{Decode, Encode};

sp_api::decl_runtime_apis! {
pub trait CeremoniesApi<AccountId, Moment>
Expand Down
10 changes: 5 additions & 5 deletions ceremonies/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@

use encointer_rpc::Error;
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
use parity_scale_codec::{Decode, Encode};
use parking_lot::RwLock;
use sp_api::{
offchain::{OffchainStorage, STORAGE_PREFIX},
Decode, Encode, ProvideRuntimeApi,
};
use sp_api::ProvideRuntimeApi;
use sp_blockchain::HeaderBackend;
use sp_core::offchain::{OffchainStorage, STORAGE_PREFIX};
use sp_runtime::app_crypto::sp_core;
use sp_runtime::traits::Block as BlockT;
use std::sync::Arc;

Expand Down Expand Up @@ -71,7 +71,7 @@ pub struct CeremoniesRpc<Client, Block, AccountId, Moment, S> {
impl<Client, Block, AccountId, Moment, S> CeremoniesRpc<Client, Block, AccountId, Moment, S>
where
S: 'static + OffchainStorage,
Block: sp_api::BlockT,
Block: BlockT,
AccountId: 'static + Encode + Decode + Send + Sync,
Moment: 'static + Encode + Decode + Send + Sync,
Client: Send + Sync + 'static + ProvideRuntimeApi<Block> + HeaderBackend<Block>,
Expand Down
2 changes: 2 additions & 0 deletions communities/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ license = "GPL-3.0-or-later"
[dependencies]
jsonrpsee = { workspace = true }
log = { workspace = true, features = ["std"] }
parity-scale-codec = { workspace = true }
parking_lot = { workspace = true }
thiserror = { workspace = true }

Expand All @@ -24,6 +25,7 @@ sc-rpc = { workspace = true }
sc-rpc-api = { workspace = true }
sp-api = { workspace = true, features = ["std"] }
sp-blockchain = { workspace = true }
sp-core = { workspace = true, features = ["std"] }
sp-runtime = { workspace = true, features = ["std"] }

[dev-dependencies]
Expand Down
1 change: 1 addition & 0 deletions communities/rpc/runtime-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ license = "GPL-3.0-or-later"
encointer-primitives = { workspace = true }

# substrate deps
parity-scale-codec = { workspace = true }
sp-api = { workspace = true }
sp-std = { workspace = true }

Expand Down
2 changes: 1 addition & 1 deletion communities/rpc/runtime-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use encointer_primitives::{
common::PalletString,
communities::{CommunityIdentifier, Location},
};
use sp_api::{Decode, Encode};
use parity_scale_codec::{Decode, Encode};

sp_api::decl_runtime_apis! {

Expand Down
16 changes: 8 additions & 8 deletions communities/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@
#[cfg(test)]
mod tests;

use encointer_rpc::Error;
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
use sp_api::{Decode, Encode, HeaderT, ProvideRuntimeApi};
use sp_blockchain::HeaderBackend;
use sp_runtime::traits::Block as BlockT;
use std::sync::Arc;

use encointer_primitives::{
balances::BalanceEntry,
communities::{consts::CACHE_DIRTY_KEY, CidName, CommunityIdentifier, Location},
};
use encointer_rpc::Error;
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
use pallet_encointer_communities_rpc_runtime_api::CommunitiesApi as CommunitiesRuntimeApi;
use parity_scale_codec::{Decode, Encode};
use parking_lot::RwLock;
use sp_api::offchain::{OffchainStorage, STORAGE_PREFIX};
use sp_api::ProvideRuntimeApi;
use sp_blockchain::HeaderBackend;
use sp_core::offchain::{OffchainStorage, STORAGE_PREFIX};
use sp_runtime::traits::{Block as BlockT, Header as HeaderT};
use std::sync::Arc;

const CIDS_KEY: &[u8; 4] = b"cids";

Expand Down
1 change: 1 addition & 0 deletions test-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ macro_rules! impl_frame_system {
type RuntimeOrigin = RuntimeOrigin;
type Nonce = u64;
type RuntimeCall = RuntimeCall;
type RuntimeTask = RuntimeTask;
type Hash = H256;
type Hashing = BlakeTwo256;
type AccountId = AccountId;
Expand Down

0 comments on commit af41214

Please sign in to comment.