Skip to content

Commit b8ba0fe

Browse files
authored
chore(deps): bump bin-base (#122)
Accomodates the new shared token changes.
1 parent f9e76aa commit b8ba0fe

File tree

4 files changed

+74
-17
lines changed

4 files changed

+74
-17
lines changed

Cargo.lock

Lines changed: 67 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ path = "bin/submit_transaction.rs"
2525
integration = []
2626

2727
[dependencies]
28-
init4-bin-base = { version = "0.4.3", features = ["perms"] }
28+
init4-bin-base = { version = "0.5.0", features = ["perms"] }
2929

3030
signet-constants = { version = "0.4.2" }
3131
signet-sim = { version = "0.4.2" }
@@ -55,7 +55,6 @@ reqwest = { version = "0.11.24", features = ["blocking", "json"] }
5555
serde_json = "1.0"
5656
tokio = { version = "1.36.0", features = ["full", "macros", "rt-multi-thread"] }
5757

58-
oauth2 = "5"
5958
tokio-stream = "0.1.17"
6059
url = "2.5.4"
6160
tracing = "0.1.41"

src/quincey.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use init4_bin_base::{
55
perms::SharedToken,
66
utils::signer::LocalOrAws,
77
};
8-
use oauth2::TokenResponse;
98
use reqwest::Client;
109
use signet_types::{SignRequest, SignResponse};
1110

@@ -53,12 +52,13 @@ impl Quincey {
5352
async fn sup_remote(&self, sig_request: &SignRequest) -> eyre::Result<SignResponse> {
5453
let Self::Remote { client, url, token } = &self else { bail!("not a remote client") };
5554

56-
let Some(token) = token.read() else { bail!("no token available") };
55+
let token =
56+
token.secret().await.map_err(|e| eyre::eyre!("failed to retrieve token: {e}"))?;
5757

5858
let resp: reqwest::Response = client
5959
.post(url.clone())
6060
.json(sig_request)
61-
.bearer_auth(token.access_token().secret())
61+
.bearer_auth(token)
6262
.send()
6363
.await?
6464
.error_for_status()?;

src/tasks/cache/bundle.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
//! Bundler service responsible for fetching bundles and sending them to the simulator.
22
use crate::config::BuilderConfig;
3-
use eyre::bail;
43
use init4_bin_base::{
54
deps::tracing::{Instrument, debug, debug_span, error, trace},
65
perms::SharedToken,
76
};
8-
use oauth2::TokenResponse;
97
use reqwest::{Client, Url};
108
use signet_tx_cache::types::{TxCacheBundle, TxCacheBundlesResponse};
119
use tokio::{
@@ -46,13 +44,12 @@ impl BundlePoller {
4644
/// Fetches bundles from the transaction cache and returns them.
4745
pub async fn check_bundle_cache(&mut self) -> eyre::Result<Vec<TxCacheBundle>> {
4846
let bundle_url: Url = Url::parse(&self.config.tx_pool_url)?.join("bundles")?;
49-
let Some(token) = self.token.read() else {
50-
bail!("No token available, skipping bundle fetch");
51-
};
47+
let token =
48+
self.token.secret().await.map_err(|e| eyre::eyre!("Failed to read token: {e}"))?;
5249

5350
self.client
5451
.get(bundle_url)
55-
.bearer_auth(token.access_token().secret())
52+
.bearer_auth(token)
5653
.send()
5754
.await?
5855
.error_for_status()?

0 commit comments

Comments
 (0)