Skip to content

Commit

Permalink
encointer_utils: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
OverOrion committed Jul 31, 2023
1 parent 4f3f802 commit c438ade
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions enclave-runtime/src/rpc/encointer_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,12 @@ use codec::Decode;
use encointer_primitives::{
ceremonies::Reputation, communities::CommunityIdentifier, scheduler::CeremonyIndexType,
};
use ita_stf::helpers::get_storage_by_key_hash;
use itc_parentchain::light_client::{concurrent_access::ValidatorAccess, LightClientState};
use itp_component_container::ComponentGetter;
use itp_ocall_api::EnclaveOnChainOCallApi;
use itp_stf_primitives::types::AccountId;
use itp_storage::{storage_double_map_key, StorageHasher, VerifyStorageProof};
use itp_types::{
storage::{StorageEntry, StorageEntryVerified},
WorkerRequest, WorkerResponse,
};
use itp_storage::{storage_double_map_key, StorageHasher};
use itp_types::{WorkerRequest, WorkerResponse};
use log::error;

pub fn fetch_reputation(
Expand Down Expand Up @@ -75,16 +71,6 @@ fn get_reputation_ocall_api(
cindex: CeremonyIndexType,
) -> Reputation {
println!("cid is :{}, cindex is: {}", cid, cindex.clone());
let validator_access =
get_validator_accessor_from_solo_or_parachain().expect("Failed to get validator access");
let current_parentchain_header = validator_access
.execute_on_validator(|v| {
let latest_parentchain_header = v
.latest_finalized_header()
.expect("Failed to get latest finalized block header");
Ok(latest_parentchain_header)
})
.expect("Failed to get current_parentchain_header");

let ocall_api = GLOBAL_OCALL_API_COMPONENT.get().expect("Failed to get OCALL API");
let storage_hash = storage_double_map_key(
Expand Down

0 comments on commit c438ade

Please sign in to comment.