88
99extern crate alloc;
1010
11- use alloc:: vec:: Vec ;
1211use crate :: {
1312 authorization:: AuthorizationManager ,
1413 chunker:: { Chunker , FixedSizeChunker } ,
1514 dag:: { DagBuilder , UnixFsDagBuilder } ,
1615 storage:: { BatchStorageOperation , StorageOperation } ,
17- types:: {
18- ChunkerConfig , Error , ProgressCallback , ProgressEvent , Result ,
19- StoreOptions ,
20- } ,
16+ types:: { ChunkerConfig , Error , ProgressCallback , ProgressEvent , Result , StoreOptions } ,
2117} ;
18+ use alloc:: vec:: Vec ;
2219
2320/// Configuration for the Bulletin client.
2421#[ derive( Debug , Clone ) ]
@@ -58,18 +55,12 @@ pub struct BulletinClient {
5855impl BulletinClient {
5956 /// Create a new Bulletin client with default configuration.
6057 pub fn new ( ) -> Self {
61- Self {
62- config : ClientConfig :: default ( ) ,
63- auth_manager : AuthorizationManager :: new ( ) ,
64- }
58+ Self { config : ClientConfig :: default ( ) , auth_manager : AuthorizationManager :: new ( ) }
6559 }
6660
6761 /// Create a client with custom configuration.
6862 pub fn with_config ( config : ClientConfig ) -> Self {
69- Self {
70- config,
71- auth_manager : AuthorizationManager :: new ( ) ,
72- }
63+ Self { config, auth_manager : AuthorizationManager :: new ( ) }
7364 }
7465
7566 /// Set the authorization manager.
@@ -175,9 +166,7 @@ pub mod async_client {
175166 impl AsyncBulletinClient {
176167 /// Create a new async client.
177168 pub fn new ( config : ClientConfig ) -> Self {
178- Self {
179- client : BulletinClient :: with_config ( config) ,
180- }
169+ Self { client : BulletinClient :: with_config ( config) }
181170 }
182171
183172 /// Store data (placeholder - requires subxt integration).
@@ -196,7 +185,11 @@ pub mod async_client {
196185 /// // Process result and return StoreResult
197186 /// }
198187 /// ```
199- pub async fn store_placeholder ( & self , _data : Vec < u8 > , _options : StoreOptions ) -> Result < ( ) > {
188+ pub async fn store_placeholder (
189+ & self ,
190+ _data : Vec < u8 > ,
191+ _options : StoreOptions ,
192+ ) -> Result < ( ) > {
200193 // Placeholder - users should implement with their subxt setup
201194 Err ( Error :: StorageFailed (
202195 "This is a placeholder. Implement with subxt integration." . into ( ) ,
@@ -241,11 +234,8 @@ mod tests {
241234 fn test_prepare_store_chunked ( ) {
242235 let client = BulletinClient :: new ( ) ;
243236 let data = vec ! [ 1u8 ; 5000 ] ;
244- let config = Some ( ChunkerConfig {
245- chunk_size : 2000 ,
246- max_parallel : 8 ,
247- create_manifest : true ,
248- } ) ;
237+ let config =
238+ Some ( ChunkerConfig { chunk_size : 2000 , max_parallel : 8 , create_manifest : true } ) ;
249239 let options = StoreOptions :: default ( ) ;
250240
251241 let result = client. prepare_store_chunked ( & data, config, options, None ) ;
@@ -260,11 +250,8 @@ mod tests {
260250 fn test_prepare_store_chunked_no_manifest ( ) {
261251 let client = BulletinClient :: new ( ) ;
262252 let data = vec ! [ 1u8 ; 5000 ] ;
263- let config = Some ( ChunkerConfig {
264- chunk_size : 2000 ,
265- max_parallel : 8 ,
266- create_manifest : false ,
267- } ) ;
253+ let config =
254+ Some ( ChunkerConfig { chunk_size : 2000 , max_parallel : 8 , create_manifest : false } ) ;
268255 let options = StoreOptions :: default ( ) ;
269256
270257 let result = client. prepare_store_chunked ( & data, config, options, None ) ;
0 commit comments