Skip to content

Commit

Permalink
update resolving conflcits
Browse files Browse the repository at this point in the history
  • Loading branch information
devdanco committed Jan 3, 2023
1 parent ea31545 commit 246d103
Show file tree
Hide file tree
Showing 22 changed files with 48 additions and 46 deletions.
6 changes: 3 additions & 3 deletions bin/node-template/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ substrate-wasm-builder = { version = "5.0.0-dev", path = "../../../utils/wasm-bu
[features]
default = ["std"]
std = [
"frame-try-runtime?/std",
"frame-system-benchmarking?/std",
"frame-benchmarking?/std",
"frame-try-runtime/std",
"frame-system-benchmarking/std",
"frame-benchmarking/std",
"codec/std",
"scale-info/std",
"frame-executive/std",
Expand Down
4 changes: 2 additions & 2 deletions client/beefy/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ mod tests {
communication::notification::BeefyVersionedFinalityProofSender,
justification::BeefyVersionedFinalityProof,
};
use beefy_primitives::{known_payloads, Payload, SignedCommitment};
use sp_beefy::{known_payloads, Payload, SignedCommitment};
use codec::{Decode, Encode};
use jsonrpsee::{types::EmptyServerParams as EmptyParams, RpcModule};
use sp_runtime::traits::{BlakeTwo256, Hash};
Expand Down Expand Up @@ -269,7 +269,7 @@ mod tests {
let payload =
Payload::from_single_entry(known_payloads::MMR_ROOT_ID, "Hello World!".encode());
BeefyVersionedFinalityProof::<Block>::V1(SignedCommitment {
commitment: beefy_primitives::Commitment {
commitment: sp_beefy::Commitment {
payload,
block_number: 5,
validator_set_id: 0,
Expand Down
2 changes: 1 addition & 1 deletion client/beefy/rpc/src/notification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use sp_runtime::traits::Block as BlockT;

/// An encoded finality proof proving that the given header has been finalized.
/// The given bytes should be the SCALE-encoded representation of a
/// `beefy_primitives::VersionedFinalityProof`.
/// `sp_beefy::VersionedFinalityProof`.
#[derive(Clone, Serialize, Deserialize)]
pub struct EncodedVersionedFinalityProof(sp_core::Bytes);

Expand Down
4 changes: 2 additions & 2 deletions client/beefy/src/communication/gossip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use parking_lot::{Mutex, RwLock};
use wasm_timer::Instant;

use crate::{communication::peers::KnownPeers, keystore::BeefyKeystore};
use beefy_primitives::{
use sp_beefy::{
crypto::{Public, Signature},
VoteMessage,
};
Expand Down Expand Up @@ -240,7 +240,7 @@ mod tests {
use sp_keystore::{SyncCryptoStore, SyncCryptoStorePtr};

use crate::keystore::{tests::Keyring, BeefyKeystore};
use beefy_primitives::{
use sp_beefy::{
crypto::Signature, known_payloads, Commitment, MmrRootHash, Payload, VoteMessage, KEY_TYPE,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

//! Helper for handling (i.e. answering) BEEFY justifications requests from a remote peer.
use beefy_primitives::BEEFY_ENGINE_ID;
use sp_beefy::BEEFY_ENGINE_ID;
use codec::Decode;
use futures::{
channel::{mpsc, oneshot},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

//! Generating request logic for request/response protocol for syncing BEEFY justifications.
use beefy_primitives::{crypto::AuthorityId, ValidatorSet};
use sp_beefy::{crypto::AuthorityId, ValidatorSet};
use codec::Encode;
use futures::channel::{oneshot, oneshot::Canceled};
use log::{debug, warn};
Expand Down
2 changes: 1 addition & 1 deletion client/beefy/src/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

use beefy_primitives::{BeefyApi, BEEFY_ENGINE_ID};
use sp_beefy::{BeefyApi, BEEFY_ENGINE_ID};
use log::debug;
use std::{collections::HashMap, sync::Arc};

Expand Down
6 changes: 3 additions & 3 deletions client/beefy/src/justification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.

use crate::keystore::BeefyKeystore;
use beefy_primitives::{
use sp_beefy::{
crypto::{AuthorityId, Signature},
ValidatorSet, VersionedFinalityProof,
};
Expand All @@ -27,7 +27,7 @@ use sp_runtime::traits::{Block as BlockT, NumberFor};

/// A finality proof with matching BEEFY authorities' signatures.
pub type BeefyVersionedFinalityProof<Block> =
beefy_primitives::VersionedFinalityProof<NumberFor<Block>, Signature>;
sp_beefy::VersionedFinalityProof<NumberFor<Block>, Signature>;

/// Decode and verify a Beefy FinalityProof.
pub(crate) fn decode_and_verify_finality_proof<Block: BlockT>(
Expand Down Expand Up @@ -80,7 +80,7 @@ fn verify_with_validator_set<Block: BlockT>(

#[cfg(test)]
pub(crate) mod tests {
use beefy_primitives::{
use sp_beefy::{
known_payloads, Commitment, Payload, SignedCommitment, VersionedFinalityProof,
};
use substrate_test_runtime_client::runtime::Block;
Expand Down
4 changes: 2 additions & 2 deletions client/beefy/src/keystore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use sp_runtime::traits::Keccak256;

use log::warn;

use beefy_primitives::{
use sp_beefy::{
crypto::{Public, Signature},
BeefyVerify, KEY_TYPE,
};
Expand Down Expand Up @@ -117,7 +117,7 @@ pub mod tests {
use sp_core::{ecdsa, keccak_256, Pair};
use sp_keystore::{SyncCryptoStore, SyncCryptoStorePtr};

use beefy_primitives::{crypto, KEY_TYPE};
use sp_beefy::{crypto, KEY_TYPE};

use super::BeefyKeystore;
use crate::error::Error;
Expand Down
2 changes: 1 addition & 1 deletion client/beefy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use crate::{
round::Rounds,
worker::PersistedState,
};
use beefy_primitives::{
use sp_beefy::{
crypto::AuthorityId, BeefyApi, MmrRootHash, PayloadProvider, ValidatorSet, BEEFY_ENGINE_ID,
GENESIS_AUTHORITY_SET_ID,
};
Expand Down
4 changes: 2 additions & 2 deletions client/beefy/src/round.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

use beefy_primitives::{
use sp_beefy::{
crypto::{Public, Signature},
ValidatorSet, ValidatorSetId,
};
Expand Down Expand Up @@ -174,7 +174,7 @@ mod tests {
use sc_network_test::Block;
use sp_core::H256;

use beefy_primitives::{crypto::Public, ValidatorSet};
use sp_beefy::{crypto::Public, ValidatorSet};

use super::{threshold, Block as BlockT, Hash, RoundTracker, Rounds};
use crate::keystore::tests::Keyring;
Expand Down
4 changes: 2 additions & 2 deletions client/beefy/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use crate::{
load_or_init_voter_state, wait_for_runtime_pallet, BeefyRPCLinks, BeefyVoterLinks, KnownPeers,
PersistedState,
};
use beefy_primitives::{
use sp_beefy::{
crypto::{AuthorityId, Signature},
known_payloads,
mmr::MmrRootProvider,
Expand Down Expand Up @@ -475,7 +475,7 @@ fn wait_for_beefy_signed_commitments(
let expected = expected.next();
async move {
let signed_commitment = match versioned_finality_proof {
beefy_primitives::VersionedFinalityProof::V1(sc) => sc,
sp_beefy::VersionedFinalityProof::V1(sc) => sc,
};
let commitment_block_num = signed_commitment.commitment.block_number;
assert_eq!(expected, Some(commitment_block_num).as_ref());
Expand Down
4 changes: 2 additions & 2 deletions client/beefy/src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use crate::{
round::Rounds,
BeefyVoterLinks,
};
use beefy_primitives::{
use sp_beefy::{
crypto::{AuthorityId, Signature},
Commitment, ConsensusLog, Payload, PayloadProvider, SignedCommitment, ValidatorSet,
VersionedFinalityProof, VoteMessage, BEEFY_ENGINE_ID,
Expand Down Expand Up @@ -970,7 +970,7 @@ pub(crate) mod tests {
},
BeefyRPCLinks, KnownPeers,
};
use beefy_primitives::{known_payloads, mmr::MmrRootProvider};
use sp_beefy::{known_payloads, mmr::MmrRootProvider};
use futures::{future::poll_fn, task::Poll};
use parking_lot::Mutex;
use sc_client_api::{Backend as BackendT, HeaderBackend};
Expand Down
2 changes: 1 addition & 1 deletion client/merkle-mountain-range/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ mod offchain_mmr;
pub mod test_utils;

use crate::offchain_mmr::OffchainMmr;
use beefy_primitives::MmrRootHash;
use sp_beefy::MmrRootHash;
use futures::StreamExt;
use log::{debug, error, trace, warn};
use sc_client_api::{Backend, BlockchainEvents, FinalityNotifications};
Expand Down
16 changes: 8 additions & 8 deletions frame/beefy-mmr/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
use sp_runtime::traits::{Convert, Member};
use sp_std::prelude::*;

use beefy_primitives::{
use sp_beefy::{
mmr::{BeefyAuthoritySet, BeefyDataProvider, BeefyNextAuthoritySet, MmrLeaf, MmrLeafVersion},
ValidatorSet as BeefyValidatorSet,
};
Expand All @@ -54,15 +54,15 @@ mod tests;
/// A BEEFY consensus digest item with MMR root hash.
pub struct DepositBeefyDigest<T>(sp_std::marker::PhantomData<T>);

impl<T> pallet_mmr::primitives::OnNewRoot<beefy_primitives::MmrRootHash> for DepositBeefyDigest<T>
impl<T> pallet_mmr::primitives::OnNewRoot<sp_beefy::MmrRootHash> for DepositBeefyDigest<T>
where
T: pallet_mmr::Config<Hash = beefy_primitives::MmrRootHash>,
T: pallet_mmr::Config<Hash = sp_beefy::MmrRootHash>,
T: pallet_beefy::Config,
{
fn on_new_root(root: &<T as pallet_mmr::Config>::Hash) {
let digest = sp_runtime::generic::DigestItem::Consensus(
beefy_primitives::BEEFY_ENGINE_ID,
codec::Encode::encode(&beefy_primitives::ConsensusLog::<
sp_beefy::BEEFY_ENGINE_ID,
codec::Encode::encode(&sp_beefy::ConsensusLog::<
<T as pallet_beefy::Config>::BeefyId,
>::MmrRoot(*root)),
);
Expand All @@ -72,8 +72,8 @@ where

/// Convert BEEFY secp256k1 public keys into Ethereum addresses
pub struct BeefyEcdsaToEthereum;
impl Convert<beefy_primitives::crypto::AuthorityId, Vec<u8>> for BeefyEcdsaToEthereum {
fn convert(beefy_id: beefy_primitives::crypto::AuthorityId) -> Vec<u8> {
impl Convert<sp_beefy::crypto::AuthorityId, Vec<u8>> for BeefyEcdsaToEthereum {
fn convert(beefy_id: sp_beefy::crypto::AuthorityId) -> Vec<u8> {
sp_core::ecdsa::Public::from(beefy_id)
.to_eth_address()
.map(|v| v.to_vec())
Expand Down Expand Up @@ -156,7 +156,7 @@ impl<T: Config> LeafDataProvider for Pallet<T> {
}
}

impl<T> beefy_primitives::OnNewValidatorSet<<T as pallet_beefy::Config>::BeefyId> for Pallet<T>
impl<T> sp_beefy::OnNewValidatorSet<<T as pallet_beefy::Config>::BeefyId> for Pallet<T>
where
T: pallet::Config,
{
Expand Down
6 changes: 3 additions & 3 deletions frame/beefy-mmr/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

use std::vec;

use beefy_primitives::mmr::MmrLeafVersion;
use sp_beefy::mmr::MmrLeafVersion;
use codec::Encode;
use frame_support::{
construct_runtime, parameter_types,
Expand All @@ -35,7 +35,7 @@ use sp_runtime::{

use crate as pallet_beefy_mmr;

pub use beefy_primitives::{
pub use sp_beefy::{
crypto::AuthorityId as BeefyId, mmr::BeefyDataProvider, ConsensusLog, BEEFY_ENGINE_ID,
};

Expand Down Expand Up @@ -101,7 +101,7 @@ impl pallet_session::Config for Test {
type WeightInfo = ();
}

pub type MmrLeaf = beefy_primitives::mmr::MmrLeaf<
pub type MmrLeaf = sp_beefy::mmr::MmrLeaf<
<Test as frame_system::Config>::BlockNumber,
<Test as frame_system::Config>::Hash,
<Test as pallet_mmr::Config>::Hash,
Expand Down
2 changes: 1 addition & 1 deletion frame/beefy-mmr/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

use std::vec;

use beefy_primitives::{
use sp_beefy::{
mmr::{BeefyNextAuthoritySet, MmrLeafVersion},
ValidatorSet,
};
Expand Down
6 changes: 3 additions & 3 deletions frame/beefy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use sp_runtime::{
};
use sp_std::prelude::*;

use beefy_primitives::{
use sp_beefy::{
AuthorityIndex, ConsensusLog, OnNewValidatorSet, ValidatorSet, BEEFY_ENGINE_ID,
GENESIS_AUTHORITY_SET_ID,
};
Expand Down Expand Up @@ -83,7 +83,7 @@ pub mod pallet {
#[pallet::storage]
#[pallet::getter(fn validator_set_id)]
pub(super) type ValidatorSetId<T: Config> =
StorageValue<_, beefy_primitives::ValidatorSetId, ValueQuery>;
StorageValue<_, sp_beefy::ValidatorSetId, ValueQuery>;

/// Authorities set scheduled to be used with the next session
#[pallet::storage]
Expand Down Expand Up @@ -118,7 +118,7 @@ impl<T: Config> Pallet<T> {
/// Return the current active BEEFY validator set.
pub fn validator_set() -> Option<ValidatorSet<T::BeefyId>> {
let validators: BoundedVec<T::BeefyId, T::MaxAuthorities> = Self::authorities();
let id: beefy_primitives::ValidatorSetId = Self::validator_set_id();
let id: sp_beefy::ValidatorSetId = Self::validator_set_id();
ValidatorSet::<T::BeefyId>::new(validators, id)
}

Expand Down
2 changes: 1 addition & 1 deletion frame/beefy/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ use sp_runtime::{

use crate as pallet_beefy;

pub use beefy_primitives::{crypto::AuthorityId as BeefyId, ConsensusLog, BEEFY_ENGINE_ID};
pub use sp_beefy::{crypto::AuthorityId as BeefyId, ConsensusLog, BEEFY_ENGINE_ID};

impl_opaque_keys! {
pub struct MockSessionKeys {
Expand Down
2 changes: 1 addition & 1 deletion frame/beefy/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

use std::vec;

use beefy_primitives::ValidatorSet;
use sp_beefy::ValidatorSet;
use codec::Encode;

use sp_runtime::DigestItem;
Expand Down
2 changes: 2 additions & 0 deletions primitives/consensus/aura/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ use codec::{Codec, Decode, Encode};
use sp_runtime::ConsensusEngineId;
use sp_std::vec::Vec;

use scale_info::prelude::format;

pub mod digests;
pub mod inherents;

Expand Down
10 changes: 5 additions & 5 deletions test-utils/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1002,18 +1002,18 @@ cfg_if! {
}
}

impl beefy_primitives::BeefyApi<Block> for Runtime {
fn validator_set() -> Option<beefy_primitives::ValidatorSet<beefy_primitives::crypto::AuthorityId>> {
impl sp_beefy::BeefyApi<Block> for Runtime {
fn validator_set() -> Option<sp_beefy::ValidatorSet<sp_beefy::crypto::AuthorityId>> {
None
}
}

impl beefy_merkle_tree::BeefyMmrApi<Block, beefy_primitives::MmrRootHash> for Runtime {
fn authority_set_proof() -> beefy_primitives::mmr::BeefyAuthoritySet<beefy_primitives::MmrRootHash> {
impl beefy_merkle_tree::BeefyMmrApi<Block, sp_beefy::MmrRootHash> for Runtime {
fn authority_set_proof() -> sp_beefy::mmr::BeefyAuthoritySet<sp_beefy::MmrRootHash> {
Default::default()
}

fn next_authority_set_proof() -> beefy_primitives::mmr::BeefyNextAuthoritySet<beefy_primitives::MmrRootHash> {
fn next_authority_set_proof() -> sp_beefy::mmr::BeefyNextAuthoritySet<sp_beefy::MmrRootHash> {
Default::default()
}
}
Expand Down

0 comments on commit 246d103

Please sign in to comment.