14
14
15
15
use alloy:: network:: Ethereum ;
16
16
use alloy:: providers:: Provider ;
17
- use alloy:: transports:: http:: Http ;
18
17
use alloy:: {
19
18
network:: EthereumWallet ,
20
19
node_bindings:: { Anvil , AnvilInstance } ,
@@ -67,11 +66,7 @@ struct DataRootInclusionResponse {
67
66
68
67
async fn setup_test_environment ( ) -> anyhow:: Result < (
69
68
AnvilInstance ,
70
- IBlobstreamInstance <
71
- Http < reqwest:: Client > ,
72
- impl Provider < Http < reqwest:: Client > , Ethereum > ,
73
- Ethereum ,
74
- > ,
69
+ IBlobstreamInstance < impl Provider < Ethereum > , Ethereum > ,
75
70
) > {
76
71
// Set dev mode for test.
77
72
std:: env:: set_var ( "RISC0_DEV_MODE" , "true" ) ;
@@ -85,10 +80,7 @@ async fn setup_test_environment() -> anyhow::Result<(
85
80
86
81
// Create a provider with the wallet.
87
82
let rpc_url = anvil. endpoint ( ) . parse ( ) ?;
88
- let provider = ProviderBuilder :: new ( )
89
- . with_recommended_fillers ( )
90
- . wallet ( wallet)
91
- . on_http ( rpc_url) ;
83
+ let provider = ProviderBuilder :: new ( ) . wallet ( wallet) . connect_http ( rpc_url) ;
92
84
93
85
let verifier = MockVerifier :: deploy ( & provider, [ 0 , 0 , 0 , 0 ] . into ( ) ) . await ?;
94
86
@@ -137,7 +129,7 @@ async fn e2e_basic_range() -> anyhow::Result<()> {
137
129
post_batch ( & contract, & receipt) . await ?;
138
130
139
131
let height = contract. latestHeight ( ) . call ( ) . await ?;
140
- assert_eq ! ( height. _0 , BATCH_END as u64 - 1 ) ;
132
+ assert_eq ! ( height, BATCH_END as u64 - 1 ) ;
141
133
142
134
// Somewhat hacky to do this manually, seems no Rust tooling for this endpoint.
143
135
let http_client = reqwest:: Client :: new ( ) ;
@@ -184,7 +176,7 @@ async fn e2e_basic_range() -> anyhow::Result<()> {
184
176
)
185
177
. call ( )
186
178
. await ?;
187
- assert ! ( is_valid. _0 ) ;
179
+ assert ! ( is_valid) ;
188
180
189
181
Ok ( ( ) )
190
182
}
@@ -202,7 +194,7 @@ async fn test_admin_functions() -> anyhow::Result<()> {
202
194
. watch ( )
203
195
. await ?;
204
196
let current_image_id = contract. imageId ( ) . call ( ) . await ?;
205
- assert_eq ! ( current_image_id. _0 , new_image_id) ;
197
+ assert_eq ! ( current_image_id, new_image_id) ;
206
198
207
199
// Test adminSetVerifier
208
200
let new_verifier = MockVerifier :: deploy ( contract. provider ( ) , [ 1 , 1 , 1 , 1 ] . into ( ) ) . await ?;
@@ -213,7 +205,7 @@ async fn test_admin_functions() -> anyhow::Result<()> {
213
205
. watch ( )
214
206
. await ?;
215
207
let current_verifier = contract. verifier ( ) . call ( ) . await ?;
216
- assert_eq ! ( current_verifier. _0 , * new_verifier. address( ) ) ;
208
+ assert_eq ! ( current_verifier, * new_verifier. address( ) ) ;
217
209
218
210
// Test adminSetTrustedState
219
211
let new_trusted_hash = [ 2u8 ; 32 ] ;
@@ -226,8 +218,8 @@ async fn test_admin_functions() -> anyhow::Result<()> {
226
218
. await ?;
227
219
let current_trusted_hash = contract. latestBlockHash ( ) . call ( ) . await ?;
228
220
let current_trusted_height = contract. latestHeight ( ) . call ( ) . await ?;
229
- assert_eq ! ( current_trusted_hash. _0 , new_trusted_hash) ;
230
- assert_eq ! ( current_trusted_height. _0 , new_trusted_height) ;
221
+ assert_eq ! ( current_trusted_hash, new_trusted_hash) ;
222
+ assert_eq ! ( current_trusted_height, new_trusted_height) ;
231
223
232
224
Ok ( ( ) )
233
225
}
@@ -270,7 +262,7 @@ async fn test_contract_upgrade() -> anyhow::Result<()> {
270
262
post_batch ( & contract, & receipt) . await ?;
271
263
272
264
let height = contract. latestHeight ( ) . call ( ) . await ?;
273
- assert_eq ! ( height. _0 , BATCH_END as u64 - 1 ) ;
265
+ assert_eq ! ( height, BATCH_END as u64 - 1 ) ;
274
266
275
267
Ok ( ( ) )
276
268
}
@@ -281,7 +273,7 @@ async fn test_ownership_transfer() -> anyhow::Result<()> {
281
273
282
274
// Get the initial owner
283
275
let initial_owner = contract. owner ( ) . call ( ) . await ?;
284
- assert_eq ! ( initial_owner. _0 , anvil. addresses( ) [ 0 ] ) ;
276
+ assert_eq ! ( initial_owner, anvil. addresses( ) [ 0 ] ) ;
285
277
286
278
// Transfer ownership
287
279
let new_owner = anvil. addresses ( ) [ 1 ] ;
@@ -296,9 +288,8 @@ async fn test_ownership_transfer() -> anyhow::Result<()> {
296
288
let new_owner_signer: PrivateKeySigner = anvil. keys ( ) [ 1 ] . clone ( ) . into ( ) ;
297
289
let new_owner_wallet = EthereumWallet :: from ( new_owner_signer) ;
298
290
let new_owner_provider = ProviderBuilder :: new ( )
299
- . with_recommended_fillers ( )
300
291
. wallet ( new_owner_wallet)
301
- . on_http ( anvil. endpoint ( ) . parse ( ) ?) ;
292
+ . connect_http ( anvil. endpoint ( ) . parse ( ) ?) ;
302
293
let contract_as_new_owner = IBlobstream :: new ( contract. address ( ) . clone ( ) , new_owner_provider) ;
303
294
contract_as_new_owner
304
295
. acceptOwnership ( )
@@ -309,7 +300,7 @@ async fn test_ownership_transfer() -> anyhow::Result<()> {
309
300
310
301
// Verify the new owner
311
302
let final_owner = contract. owner ( ) . call ( ) . await ?;
312
- assert_eq ! ( final_owner. _0 , new_owner) ;
303
+ assert_eq ! ( final_owner, new_owner) ;
313
304
314
305
Ok ( ( ) )
315
306
}
0 commit comments