Skip to content

Commit f647ec2

Browse files
committed
add to MyFallbackProvider
1 parent 3bebf5c commit f647ec2

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

packages/rs-sdk-trusted-context-provider/examples/with_fallback.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,23 @@ use std::sync::Arc;
1313
struct MyFallbackProvider;
1414

1515
impl ContextProvider for MyFallbackProvider {
16+
fn get_quorum_public_key_async(
17+
&self,
18+
quorum_type: u32,
19+
quorum_hash: [u8; 32],
20+
core_chain_locked_height: u32,
21+
) -> std::pin::Pin<
22+
Box<
23+
dyn std::future::Future<Output = Result<[u8; 48], ContextProviderError>>
24+
+ Send
25+
+ 'static,
26+
>,
27+
> {
28+
// Wrap the sync version in an async block
29+
let result = self.get_quorum_public_key(quorum_type, quorum_hash, core_chain_locked_height);
30+
Box::pin(async move { result })
31+
}
32+
1633
fn get_quorum_public_key(
1734
&self,
1835
_quorum_type: u32,

0 commit comments

Comments
 (0)