88 solana_client:: {
99 nonblocking:: pubsub_client:: PubsubClient ,
1010 pubsub_client:: PubsubClientError ,
11- rpc_config:: {
12- RpcAccountInfoConfig ,
13- RpcProgramAccountsConfig ,
14- } ,
15- rpc_filter:: {
16- Memcmp ,
17- RpcFilterType ,
18- } ,
11+ rpc_config:: { RpcAccountInfoConfig , RpcProgramAccountsConfig } ,
12+ rpc_filter:: { Memcmp , RpcFilterType } ,
1913 } ,
2014 solana_sdk:: pubkey:: Pubkey ,
21- std:: {
22- fs,
23- str:: FromStr ,
24- time:: Duration ,
25- } ,
15+ std:: { fs, str:: FromStr , time:: Duration } ,
2616 tokio:: time:: sleep,
2717 tokio_stream:: StreamExt ,
28- wormhole_sdk:: {
29- vaa:: Body ,
30- Address ,
31- Chain ,
32- } ,
18+ wormhole_sdk:: { vaa:: Body , Address , Chain } ,
3319} ;
3420
3521mod config;
3622mod posted_message;
3723mod signed_body;
3824
3925struct ListenerConfig {
40- ws_url : String ,
41- secret_key : SecretKey ,
42- wormhole_pid : Pubkey ,
26+ ws_url : String ,
27+ secret_key : SecretKey ,
28+ wormhole_pid : Pubkey ,
4329 accumulator_address : Pubkey ,
4430}
4531
@@ -58,20 +44,18 @@ async fn run_listener(config: ListenerConfig) -> Result<(), PubsubClientError> {
5844 . program_subscribe (
5945 & config. wormhole_pid ,
6046 Some ( RpcProgramAccountsConfig {
61- filters : Some ( vec ! [ RpcFilterType :: Memcmp ( Memcmp :: new(
47+ filters : Some ( vec ! [ RpcFilterType :: Memcmp ( Memcmp :: new(
6248 0 ,
6349 solana_client:: rpc_filter:: MemcmpEncodedBytes :: Bytes ( b"msu" . to_vec( ) ) ,
6450 ) ) ] ) ,
6551 account_config : RpcAccountInfoConfig {
66- encoding : Some ( UiAccountEncoding :: Base64 ) ,
67- data_slice : None ,
68- commitment : Some (
69- solana_sdk:: commitment_config:: CommitmentConfig :: confirmed ( ) ,
70- ) ,
52+ encoding : Some ( UiAccountEncoding :: Base64 ) ,
53+ data_slice : None ,
54+ commitment : Some ( solana_sdk:: commitment_config:: CommitmentConfig :: confirmed ( ) ) ,
7155 min_context_slot : None ,
7256 } ,
73- with_context : None ,
74- sort_results : None ,
57+ with_context : None ,
58+ sort_results : None ,
7559 } ) ,
7660 )
7761 . await ?;
@@ -109,13 +93,13 @@ async fn run_listener(config: ListenerConfig) -> Result<(), PubsubClientError> {
10993 }
11094
11195 let body = Body {
112- timestamp : unreliable_data. submission_time ,
113- nonce : unreliable_data. nonce ,
114- emitter_chain : unreliable_data. emitter_chain . into ( ) ,
115- emitter_address : Address ( unreliable_data. emitter_address ) ,
116- sequence : unreliable_data. sequence ,
96+ timestamp : unreliable_data. submission_time ,
97+ nonce : unreliable_data. nonce ,
98+ emitter_chain : unreliable_data. emitter_chain . into ( ) ,
99+ emitter_address : Address ( unreliable_data. emitter_address ) ,
100+ sequence : unreliable_data. sequence ,
117101 consistency_level : unreliable_data. consistency_level ,
118- payload : unreliable_data. payload . clone ( ) ,
102+ payload : unreliable_data. payload . clone ( ) ,
119103 } ;
120104
121105 match SignedBody :: try_new ( body, config. secret_key ) {
0 commit comments