Skip to content

Commit

Permalink
fix test compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
clangenb committed Aug 26, 2023
1 parent 62baa76 commit b6214be
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
10 changes: 5 additions & 5 deletions service/src/tests/mocks/enclave_api_mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use core::fmt::Debug;
use enclave_bridge_primitives::EnclaveFingerprint;
use frame_support::sp_runtime::traits::Block as ParentchainBlockTrait;
use itc_parentchain::primitives::{
ParentchainInitParams,
ParentchainId, ParentchainInitParams,
ParentchainInitParams::{Parachain, Solochain},
};
use itp_enclave_api::{enclave_base::EnclaveBase, sidechain::Sidechain, EnclaveResult};
Expand Down Expand Up @@ -50,8 +50,8 @@ impl EnclaveBase for EnclaveMock {
params: ParentchainInitParams,
) -> EnclaveResult<Header> {
let genesis_header_encoded = match params {
Solochain { params } => params.genesis_header.encode(),
Parachain { params } => params.genesis_header.encode(),
Solochain { params, .. } => params.genesis_header.encode(),
Parachain { params, .. } => params.genesis_header.encode(),
};
let header = Header::decode(&mut genesis_header_encoded.as_slice())?;
Ok(header)
Expand All @@ -65,11 +65,11 @@ impl EnclaveBase for EnclaveMock {
unimplemented!()
}

fn set_nonce(&self, _: u32) -> EnclaveResult<()> {
fn set_nonce(&self, _: u32, _: ParentchainId) -> EnclaveResult<()> {
unimplemented!()
}

fn set_node_metadata(&self, _metadata: Vec<u8>) -> EnclaveResult<()> {
fn set_node_metadata(&self, _metadata: Vec<u8>, _: ParentchainId) -> EnclaveResult<()> {
todo!()
}

Expand Down
6 changes: 4 additions & 2 deletions service/src/tests/parentchain_handler_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ use crate::{
tests::mocks::{enclave_api_mock::EnclaveMock, parentchain_api_mock::ParentchainApiMock},
};
use itc_parentchain::{
light_client::light_client_init_params::SimpleParams, primitives::ParentchainInitParams,
light_client::light_client_init_params::SimpleParams,
primitives::{ParentchainId, ParentchainInitParams},
};
use itc_parentchain_test::ParentchainHeaderBuilder;
use itp_node_api::api_client::ChainApi;
Expand All @@ -36,7 +37,8 @@ fn test_number_of_synced_blocks() {

let enclave_api_mock = EnclaveMock;
let parentchain_params: ParentchainInitParams =
SimpleParams { genesis_header: ParentchainHeaderBuilder::default().build() }.into();
(ParentchainId::Teerex, SimpleParams::new(ParentchainHeaderBuilder::default().build()))
.into();

let parentchain_handler = ParentchainHandler::new(
parentchain_api_mock,
Expand Down

0 comments on commit b6214be

Please sign in to comment.