Skip to content

Commit 9600540

Browse files
committed
chore: remove futures dependency and update GcpSigner to use Tokio runtime for blocking execution
1 parent d59ad9e commit 9600540

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Cargo.lock

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ tracing = "0.1"
1515
tokio = { version = "1.0", features = ["full"] }
1616
pem = "3.0.4"
1717
hex = "0.4.3"
18-
futures = "0.3.31"
1918

2019
[dev-dependencies]
2120
tokio = { version = "1.0", features = ["full"] }

src/signer.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![cfg_attr(debug_assertions, allow(dead_code, unused_imports))]
22
use core::fmt;
3-
use futures::executor::block_on;
43
use std::{cell::OnceCell, sync::Arc};
54

65
use gcloud_sdk::{
@@ -152,7 +151,10 @@ impl Signer for GcpSigner {
152151
&self,
153152
message: &[u8],
154153
) -> Result<solana_sdk::signature::Signature, SignerError> {
155-
block_on(request_sign_data(&self.client, &self.key_name, message))
154+
let rt = tokio::runtime::Runtime::new()
155+
.map_err(|e| SignerError::Custom(format!("Failed to create tokio runtime: {:?}", e)))?;
156+
157+
rt.block_on(request_sign_data(&self.client, &self.key_name, message))
156158
.and_then(decode_signature)
157159
.map_err(Into::into)
158160
}

0 commit comments

Comments
 (0)