Skip to content

Commit

Permalink
get signers direct rpc call (#2769)
Browse files Browse the repository at this point in the history
  • Loading branch information
kziemianek authored May 29, 2024
1 parent 5972a29 commit 7e45fbd
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions bitacross-worker/enclave-runtime/src/rpc/worker_api_direct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ where
{
let mut io = IoHandler::new();

let signer_lookup_cloned = signer_lookup.clone();
let shielding_key_cloned = shielding_key.clone();
io.add_sync_method("author_getShieldingKey", move |_: Params| {
debug!("worker_api_direct rpc was called: author_getShieldingKey");
Expand Down Expand Up @@ -204,6 +205,22 @@ where
}))
});

io.add_sync_method("bitacross_getSealedSigners", move |_: Params| {
debug!("worker_api_direct rpc was called: bitacross_getSealedSigners");

let keys: Vec<Value> = signer_lookup_cloned
.get_all()
.iter()
.map(|(signer, pub_key)| {
json!({
"signer": signer.as_ref().to_vec(),
"key": pub_key.to_vec()
})
})
.collect();
Ok(json!(keys))
});

io.add_sync_method("state_getScheduledEnclave", move |_: Params| {
debug!("worker_api_direct rpc was called: state_getScheduledEnclave");
let json_value = match GLOBAL_SCHEDULED_ENCLAVE.registry.read() {
Expand Down

0 comments on commit 7e45fbd

Please sign in to comment.