@@ -28,7 +28,7 @@ use futures::Future;
2828use jsonrpsee:: {
2929 core:: { error:: Error , server:: rpc_module:: Subscription as RpcSubscription } ,
3030 rpc_params,
31- types:: { error:: CallError , EmptyServerParams as EmptyParams } ,
31+ types:: error:: CallError ,
3232 RpcModule ,
3333} ;
3434use sc_block_builder:: BlockBuilderBuilder ;
@@ -61,7 +61,6 @@ const MAX_PINNED_BLOCKS: usize = 32;
6161const MAX_PINNED_SECS : u64 = 60 ;
6262const MAX_OPERATIONS : usize = 16 ;
6363const MAX_PAGINATION_LIMIT : usize = 5 ;
64- const CHAIN_GENESIS : [ u8 ; 32 ] = [ 0 ; 32 ] ;
6564const INVALID_HASH : [ u8 ; 32 ] = [ 1 ; 32 ] ;
6665const KEY : & [ u8 ] = b":mock" ;
6766const VALUE : & [ u8 ] = b"hello world" ;
@@ -111,7 +110,6 @@ async fn setup_api() -> (
111110 client. clone ( ) ,
112111 backend,
113112 Arc :: new ( TaskExecutor :: default ( ) ) ,
114- CHAIN_GENESIS ,
115113 ChainHeadConfig {
116114 global_max_pinned_blocks : MAX_PINNED_BLOCKS ,
117115 subscription_max_pinned_duration : Duration :: from_secs ( MAX_PINNED_SECS ) ,
@@ -162,7 +160,6 @@ async fn follow_subscription_produces_blocks() {
162160 client. clone ( ) ,
163161 backend,
164162 Arc :: new ( TaskExecutor :: default ( ) ) ,
165- CHAIN_GENESIS ,
166163 ChainHeadConfig {
167164 global_max_pinned_blocks : MAX_PINNED_BLOCKS ,
168165 subscription_max_pinned_duration : Duration :: from_secs ( MAX_PINNED_SECS ) ,
@@ -231,7 +228,6 @@ async fn follow_with_runtime() {
231228 client. clone ( ) ,
232229 backend,
233230 Arc :: new ( TaskExecutor :: default ( ) ) ,
234- CHAIN_GENESIS ,
235231 ChainHeadConfig {
236232 global_max_pinned_blocks : MAX_PINNED_BLOCKS ,
237233 subscription_max_pinned_duration : Duration :: from_secs ( MAX_PINNED_SECS ) ,
@@ -345,31 +341,6 @@ async fn follow_with_runtime() {
345341 assert_eq ! ( event, expected) ;
346342}
347343
348- #[ tokio:: test]
349- async fn get_genesis ( ) {
350- let builder = TestClientBuilder :: new ( ) ;
351- let backend = builder. backend ( ) ;
352- let client = Arc :: new ( builder. build ( ) ) ;
353-
354- let api = ChainHead :: new (
355- client. clone ( ) ,
356- backend,
357- Arc :: new ( TaskExecutor :: default ( ) ) ,
358- CHAIN_GENESIS ,
359- ChainHeadConfig {
360- global_max_pinned_blocks : MAX_PINNED_BLOCKS ,
361- subscription_max_pinned_duration : Duration :: from_secs ( MAX_PINNED_SECS ) ,
362- subscription_max_ongoing_operations : MAX_OPERATIONS ,
363- operation_max_storage_items : MAX_PAGINATION_LIMIT ,
364- } ,
365- )
366- . into_rpc ( ) ;
367-
368- let genesis: String =
369- api. call ( "chainHead_unstable_genesisHash" , EmptyParams :: new ( ) ) . await . unwrap ( ) ;
370- assert_eq ! ( genesis, hex_string( & CHAIN_GENESIS ) ) ;
371- }
372-
373344#[ tokio:: test]
374345async fn get_header ( ) {
375346 let ( _client, api, _sub, sub_id, block) = setup_api ( ) . await ;
@@ -569,7 +540,6 @@ async fn call_runtime_without_flag() {
569540 client. clone ( ) ,
570541 backend,
571542 Arc :: new ( TaskExecutor :: default ( ) ) ,
572- CHAIN_GENESIS ,
573543 ChainHeadConfig {
574544 global_max_pinned_blocks : MAX_PINNED_BLOCKS ,
575545 subscription_max_pinned_duration : Duration :: from_secs ( MAX_PINNED_SECS ) ,
@@ -1228,7 +1198,6 @@ async fn separate_operation_ids_for_subscriptions() {
12281198 client. clone ( ) ,
12291199 backend,
12301200 Arc :: new ( TaskExecutor :: default ( ) ) ,
1231- CHAIN_GENESIS ,
12321201 ChainHeadConfig {
12331202 global_max_pinned_blocks : MAX_PINNED_BLOCKS ,
12341203 subscription_max_pinned_duration : Duration :: from_secs ( MAX_PINNED_SECS ) ,
@@ -1316,7 +1285,6 @@ async fn follow_generates_initial_blocks() {
13161285 client. clone ( ) ,
13171286 backend,
13181287 Arc :: new ( TaskExecutor :: default ( ) ) ,
1319- CHAIN_GENESIS ,
13201288 ChainHeadConfig {
13211289 global_max_pinned_blocks : MAX_PINNED_BLOCKS ,
13221290 subscription_max_pinned_duration : Duration :: from_secs ( MAX_PINNED_SECS ) ,
@@ -1472,7 +1440,6 @@ async fn follow_exceeding_pinned_blocks() {
14721440 client. clone ( ) ,
14731441 backend,
14741442 Arc :: new ( TaskExecutor :: default ( ) ) ,
1475- CHAIN_GENESIS ,
14761443 ChainHeadConfig {
14771444 global_max_pinned_blocks : 2 ,
14781445 subscription_max_pinned_duration : Duration :: from_secs ( MAX_PINNED_SECS ) ,
@@ -1549,7 +1516,6 @@ async fn follow_with_unpin() {
15491516 client. clone ( ) ,
15501517 backend,
15511518 Arc :: new ( TaskExecutor :: default ( ) ) ,
1552- CHAIN_GENESIS ,
15531519 ChainHeadConfig {
15541520 global_max_pinned_blocks : 2 ,
15551521 subscription_max_pinned_duration : Duration :: from_secs ( MAX_PINNED_SECS ) ,
@@ -1815,7 +1781,6 @@ async fn follow_prune_best_block() {
18151781 client. clone ( ) ,
18161782 backend,
18171783 Arc :: new ( TaskExecutor :: default ( ) ) ,
1818- CHAIN_GENESIS ,
18191784 ChainHeadConfig {
18201785 global_max_pinned_blocks : MAX_PINNED_BLOCKS ,
18211786 subscription_max_pinned_duration : Duration :: from_secs ( MAX_PINNED_SECS ) ,
@@ -2001,7 +1966,6 @@ async fn follow_forks_pruned_block() {
20011966 client. clone ( ) ,
20021967 backend,
20031968 Arc :: new ( TaskExecutor :: default ( ) ) ,
2004- CHAIN_GENESIS ,
20051969 ChainHeadConfig {
20061970 global_max_pinned_blocks : MAX_PINNED_BLOCKS ,
20071971 subscription_max_pinned_duration : Duration :: from_secs ( MAX_PINNED_SECS ) ,
@@ -2153,7 +2117,6 @@ async fn follow_report_multiple_pruned_block() {
21532117 client. clone ( ) ,
21542118 backend,
21552119 Arc :: new ( TaskExecutor :: default ( ) ) ,
2156- CHAIN_GENESIS ,
21572120 ChainHeadConfig {
21582121 global_max_pinned_blocks : MAX_PINNED_BLOCKS ,
21592122 subscription_max_pinned_duration : Duration :: from_secs ( MAX_PINNED_SECS ) ,
@@ -2399,7 +2362,6 @@ async fn pin_block_references() {
23992362 client. clone ( ) ,
24002363 backend. clone ( ) ,
24012364 Arc :: new ( TaskExecutor :: default ( ) ) ,
2402- CHAIN_GENESIS ,
24032365 ChainHeadConfig {
24042366 global_max_pinned_blocks : 3 ,
24052367 subscription_max_pinned_duration : Duration :: from_secs ( MAX_PINNED_SECS ) ,
@@ -2537,7 +2499,6 @@ async fn follow_finalized_before_new_block() {
25372499 client_mock. clone ( ) ,
25382500 backend,
25392501 Arc :: new ( TaskExecutor :: default ( ) ) ,
2540- CHAIN_GENESIS ,
25412502 ChainHeadConfig {
25422503 global_max_pinned_blocks : MAX_PINNED_BLOCKS ,
25432504 subscription_max_pinned_duration : Duration :: from_secs ( MAX_PINNED_SECS ) ,
@@ -2652,7 +2613,6 @@ async fn ensure_operation_limits_works() {
26522613 client. clone ( ) ,
26532614 backend,
26542615 Arc :: new ( TaskExecutor :: default ( ) ) ,
2655- CHAIN_GENESIS ,
26562616 ChainHeadConfig {
26572617 global_max_pinned_blocks : MAX_PINNED_BLOCKS ,
26582618 subscription_max_pinned_duration : Duration :: from_secs ( MAX_PINNED_SECS ) ,
@@ -2757,7 +2717,6 @@ async fn check_continue_operation() {
27572717 client. clone ( ) ,
27582718 backend,
27592719 Arc :: new ( TaskExecutor :: default ( ) ) ,
2760- CHAIN_GENESIS ,
27612720 ChainHeadConfig {
27622721 global_max_pinned_blocks : MAX_PINNED_BLOCKS ,
27632722 subscription_max_pinned_duration : Duration :: from_secs ( MAX_PINNED_SECS ) ,
@@ -2940,7 +2899,6 @@ async fn stop_storage_operation() {
29402899 client. clone ( ) ,
29412900 backend,
29422901 Arc :: new ( TaskExecutor :: default ( ) ) ,
2943- CHAIN_GENESIS ,
29442902 ChainHeadConfig {
29452903 global_max_pinned_blocks : MAX_PINNED_BLOCKS ,
29462904 subscription_max_pinned_duration : Duration :: from_secs ( MAX_PINNED_SECS ) ,
0 commit comments