@@ -29,7 +29,7 @@ pub struct GuardianSignature {
29
29
}
30
30
31
31
#[ derive( Clone , Debug ) ]
32
- pub struct VAA {
32
+ pub struct VerifiedVMM {
33
33
pub version : u8 ,
34
34
pub guardian_set_index : u32 ,
35
35
pub signatures : Vec < GuardianSignature > ,
@@ -109,7 +109,7 @@ pub enum WormholeError {
109
109
}
110
110
111
111
pub trait IWormhole {
112
- fn parse_and_verify_vm ( & self , encoded_vaa : Vec < u8 > ) -> Result < VAA , WormholeError > ;
112
+ fn parse_and_verify_vm ( & self , encoded_vaa : Vec < u8 > ) -> Result < VerifiedVMM , WormholeError > ;
113
113
fn get_guardian_set ( & self , index : u32 ) -> Option < GuardianSet > ;
114
114
fn get_current_guardian_set_index ( & self ) -> u32 ;
115
115
fn governance_action_is_consumed ( & self , hash : Vec < u8 > ) -> bool ;
@@ -229,13 +229,13 @@ impl WormholeContract {
229
229
}
230
230
231
231
impl WormholeContract {
232
- fn parse_vm ( & self , encoded_vaa : & [ u8 ] ) -> Result < VAA , WormholeError > {
232
+ fn parse_vm ( & self , encoded_vaa : & [ u8 ] ) -> Result < VerifiedVMM , WormholeError > {
233
233
Self :: parse_vm_static ( encoded_vaa)
234
234
}
235
235
236
236
// Parsing a Wormhole VAA according to the structure defined
237
237
// by https://wormhole.com/docs/protocol/infrastructure/vaas/
238
- fn parse_vm_static ( encoded_vaa : & [ u8 ] ) -> Result < VAA , WormholeError > {
238
+ fn parse_vm_static ( encoded_vaa : & [ u8 ] ) -> Result < VerifiedVMM , WormholeError > {
239
239
if encoded_vaa. len ( ) < 6 {
240
240
return Err ( WormholeError :: InvalidVAAFormat ( InvalidVAAFormat { } ) ) ;
241
241
}
@@ -327,7 +327,7 @@ impl WormholeContract {
327
327
328
328
let hash = Self :: compute_hash_static ( & encoded_vaa[ cursor - 51 ..] ) ?;
329
329
330
- Ok ( VAA {
330
+ Ok ( VerifiedVMM {
331
331
version,
332
332
guardian_set_index,
333
333
signatures,
@@ -342,7 +342,7 @@ impl WormholeContract {
342
342
} )
343
343
}
344
344
345
- fn verify_vm ( & self , vaa : & VAA ) -> Result < ( ) , WormholeError > {
345
+ fn verify_vm ( & self , vaa : & VerifiedVMM ) -> Result < ( ) , WormholeError > {
346
346
let guardian_set = self . get_guardian_set_internal ( vaa. guardian_set_index )
347
347
. ok_or ( WormholeError :: InvalidGuardianSetIndex ( InvalidGuardianSetIndex { } ) ) ?;
348
348
@@ -492,7 +492,7 @@ impl WormholeContract {
492
492
}
493
493
494
494
impl IWormhole for WormholeContract {
495
- fn parse_and_verify_vm ( & self , encoded_vaa : Vec < u8 > ) -> Result < VAA , WormholeError > {
495
+ fn parse_and_verify_vm ( & self , encoded_vaa : Vec < u8 > ) -> Result < VerifiedVMM , WormholeError > {
496
496
if !self . initialized . get ( ) {
497
497
return Err ( WormholeError :: NotInitialized ( NotInitialized { } ) ) ;
498
498
}
@@ -694,8 +694,8 @@ mod tests {
694
694
real_data
695
695
}
696
696
697
- fn create_test_vaa ( guardian_set_index : u32 , signatures : Vec < GuardianSignature > ) -> VAA {
698
- VAA {
697
+ fn create_test_vaa ( guardian_set_index : u32 , signatures : Vec < GuardianSignature > ) -> VerifiedVMM {
698
+ VerifiedVMM {
699
699
version : 1 ,
700
700
guardian_set_index,
701
701
signatures,
@@ -710,11 +710,11 @@ mod tests {
710
710
}
711
711
}
712
712
713
- fn create_test_vaa_with_emitter ( guardian_set_index : u32 , signatures : Vec < GuardianSignature > , emitter : Address ) -> VAA {
713
+ fn create_test_vaa_with_emitter ( guardian_set_index : u32 , signatures : Vec < GuardianSignature > , emitter : Address ) -> VerifiedVMM {
714
714
let mut emitter_bytes = [ 0u8 ; 32 ] ;
715
715
emitter_bytes[ 12 ..32 ] . copy_from_slice ( emitter. as_slice ( ) ) ;
716
716
717
- VAA {
717
+ VerifiedVMM {
718
718
version : 1 ,
719
719
guardian_set_index,
720
720
signatures,
@@ -1069,7 +1069,7 @@ mod tests {
1069
1069
}
1070
1070
let hash = FixedBytes :: < 32 > :: from ( [ 0x42u8 ; 32 ] ) ;
1071
1071
1072
- let vaa = VAA {
1072
+ let vaa = VerifiedVMM {
1073
1073
version : 1 ,
1074
1074
guardian_set_index : 0 ,
1075
1075
signatures : vec ! [
0 commit comments