Skip to content

Commit 78a8b24

Browse files
prestwichclaude
andauthored
chore(deps): bump SDK dependencies to 0.16.0-rc.11 (#122)
* chore(deps): bump SDK dependencies to 0.16.0-rc.11 Updates signet-constants and signet-tx-cache from 0.16.0-rc.7 to 0.16.0-rc.11 and adapts to the refactored tx-cache API. Changes: - Bump signet-constants to 0.16.0-rc.11 - Bump signet-tx-cache to 0.16.0-rc.11 - Update tx_cache.rs to use new type names (CachedBundle, BundleList, CacheResponse) - Update get_bundles() to return CacheResponse<BundleList> for pagination support - Update get_bundle() to directly deserialize CachedBundle since TxCacheBundleResponse wrapper was removed in SDK The SDK refactored tx-cache types for clarity and better pagination support. All deprecated type aliases are supported for backward compatibility, but we've migrated to the new canonical names. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * chore: bump version to 0.18.0-rc.10 --------- Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 85a75c5 commit 78a8b24

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "init4-bin-base"
33

44
description = "Internal utilities for binaries produced by the init4 team"
55
keywords = ["init4", "bin", "base"]
6-
version = "0.18.0-rc.9"
6+
version = "0.18.0-rc.10"
77
edition = "2021"
88
rust-version = "1.85"
99
authors = ["init4", "James Prestwich", "evalir"]
@@ -15,8 +15,8 @@ repository = "https://github.com/init4tech/bin-base"
1515
init4-from-env-derive = { version = "0.2.0", path = "from-env-derive" }
1616

1717
# Signet
18-
signet-constants = { version = "0.16.0-rc.7" }
19-
signet-tx-cache = { version = "0.16.0-rc.7", optional = true }
18+
signet-constants = { version = "0.16.0-rc.11" }
19+
signet-tx-cache = { version = "0.16.0-rc.11", optional = true }
2020

2121
# alloy
2222
alloy = { version = "1.0.35", optional = true, default-features = false, features = ["std", "signer-local", "consensus", "network"] }

src/perms/tx_cache.rs

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::perms::oauth::SharedToken;
22
use serde::de::DeserializeOwned;
33
use signet_tx_cache::{
44
error::TxCacheError,
5-
types::{BundleKey, CacheObject, TxCacheBundle, TxCacheBundleResponse, TxCacheBundlesResponse},
5+
types::{BundleKey, BundleList, CacheObject, CacheResponse, CachedBundle},
66
TxCache,
77
};
88
use thiserror::Error;
@@ -139,8 +139,8 @@ impl BuilderTxCache {
139139
/// Returns an error if the request fails or the builder is not permissioned
140140
/// for the current slot.
141141
#[instrument(skip_all)]
142-
pub async fn get_bundles(&self, query: Option<BundleKey>) -> Result<TxCacheBundlesResponse> {
143-
self.get_inner_with_token::<TxCacheBundlesResponse>(BUNDLES, query)
142+
pub async fn get_bundles(&self, query: Option<BundleKey>) -> Result<CacheResponse<BundleList>> {
143+
self.get_inner_with_token::<CacheResponse<BundleList>>(BUNDLES, query)
144144
.await
145145
}
146146

@@ -151,10 +151,20 @@ impl BuilderTxCache {
151151
/// Get a bundle from the cache by its UUID. For convenience, this method
152152
/// takes a string reference, which is expected to be a valid UUID.
153153
#[instrument(skip_all)]
154-
pub async fn get_bundle(&self, bundle_id: &str) -> Result<TxCacheBundle> {
155-
let url = self.get_bundle_url_path(bundle_id);
156-
self.get_inner_with_token::<TxCacheBundleResponse>(&url, None)
154+
pub async fn get_bundle(&self, bundle_id: &str) -> Result<CachedBundle> {
155+
let url_path = self.get_bundle_url_path(bundle_id);
156+
let url = self.tx_cache.url().join(&url_path)?;
157+
let secret = self.token.secret().await?;
158+
159+
self.tx_cache
160+
.client()
161+
.get(url)
162+
.bearer_auth(secret)
163+
.send()
164+
.await?
165+
.error_for_status()?
166+
.json::<CachedBundle>()
157167
.await
158-
.map(|response| response.bundle)
168+
.map_err(Into::into)
159169
}
160170
}

0 commit comments

Comments
 (0)