@@ -34,7 +34,7 @@ pub struct GuardianSignature {
34
34
}
35
35
36
36
#[ derive( Clone ) ]
37
- pub struct VerifiedVMM {
37
+ pub struct VerifiedVM {
38
38
pub version : u8 ,
39
39
pub guardian_set_index : u32 ,
40
40
pub signatures : Vec < GuardianSignature > ,
@@ -93,7 +93,7 @@ impl From<WormholeError> for Vec<u8> {
93
93
}
94
94
95
95
pub trait IWormhole {
96
- fn parse_and_verify_vm ( & self , encoded_vaa : Vec < u8 > ) -> Result < VerifiedVMM , WormholeError > ;
96
+ fn parse_and_verify_vm ( & self , encoded_vaa : Vec < u8 > ) -> Result < VerifiedVM , WormholeError > ;
97
97
fn get_guardian_set ( & self , index : u32 ) -> Option < GuardianSet > ;
98
98
fn get_current_guardian_set_index ( & self ) -> u32 ;
99
99
fn governance_action_is_consumed ( & self , hash : Vec < u8 > ) -> bool ;
@@ -184,13 +184,13 @@ impl WormholeContract {
184
184
}
185
185
186
186
impl WormholeContract {
187
- fn parse_vm ( & self , encoded_vaa : & [ u8 ] ) -> Result < VerifiedVMM , WormholeError > {
187
+ fn parse_vm ( & self , encoded_vaa : & [ u8 ] ) -> Result < VerifiedVM , WormholeError > {
188
188
Self :: parse_vm_static ( encoded_vaa)
189
189
}
190
190
191
191
// Parsing a Wormhole VAA according to the structure defined
192
192
// by https://wormhole.com/docs/protocol/infrastructure/vaas/
193
- fn parse_vm_static ( encoded_vaa : & [ u8 ] ) -> Result < VerifiedVMM , WormholeError > {
193
+ fn parse_vm_static ( encoded_vaa : & [ u8 ] ) -> Result < VerifiedVM , WormholeError > {
194
194
if encoded_vaa. len ( ) < 6 {
195
195
return Err ( WormholeError :: InvalidVAAFormat ) ;
196
196
}
@@ -282,7 +282,7 @@ impl WormholeContract {
282
282
283
283
let hash = Self :: hash_static ( & encoded_vaa[ cursor - 51 ..] ) ?;
284
284
285
- Ok ( VerifiedVMM {
285
+ Ok ( VerifiedVM {
286
286
version,
287
287
guardian_set_index,
288
288
signatures,
@@ -297,7 +297,7 @@ impl WormholeContract {
297
297
} )
298
298
}
299
299
300
- fn verify_vm ( & self , vaa : & VerifiedVMM ) -> Result < ( ) , WormholeError > {
300
+ fn verify_vm ( & self , vaa : & VerifiedVM ) -> Result < ( ) , WormholeError > {
301
301
302
302
let guardian_set = self . get_gs_internal ( vaa. guardian_set_index ) ?;
303
303
if vaa. guardian_set_index != self . current_guardian_set_index . get ( ) . try_into ( ) . unwrap_or ( 0u32 )
@@ -441,7 +441,7 @@ impl WormholeContract {
441
441
}
442
442
443
443
impl IWormhole for WormholeContract {
444
- fn parse_and_verify_vm ( & self , encoded_vaa : Vec < u8 > ) -> Result < VerifiedVMM , WormholeError > {
444
+ fn parse_and_verify_vm ( & self , encoded_vaa : Vec < u8 > ) -> Result < VerifiedVM , WormholeError > {
445
445
if !self . initialized . get ( ) {
446
446
return Err ( WormholeError :: NotInitialized ) ;
447
447
}
0 commit comments