@@ -71,6 +71,8 @@ pub mod data_feeds_cache {
71
71
}
72
72
73
73
pub fn set_feed_admin ( ctx : Context < SetFeedAdmin > , admin : Pubkey , is_admin : bool ) -> Result < ( ) > {
74
+ require_keys_neq ! ( admin, Pubkey :: default ( ) , DataCacheError :: InvalidAddress ) ;
75
+
74
76
let mut state = ctx. accounts . state . load_mut ( ) ?;
75
77
let mut changed = false ;
76
78
@@ -101,8 +103,14 @@ pub mod data_feeds_cache {
101
103
proposed_owner : Pubkey ,
102
104
) -> Result < ( ) > {
103
105
let state = & mut ctx. accounts . state . load_mut ( ) ?;
104
- state. proposed_owner = proposed_owner;
106
+ require ! (
107
+ proposed_owner != Pubkey :: default ( )
108
+ && proposed_owner != state. owner
109
+ && proposed_owner != state. proposed_owner,
110
+ DataCacheError :: InvalidProposedOwner
111
+ ) ;
105
112
113
+ state. proposed_owner = proposed_owner;
106
114
emit ! ( OwnershipTransfer {
107
115
current_owner: state. owner,
108
116
proposed_owner
@@ -689,6 +697,12 @@ pub mod data_feeds_cache {
689
697
delete_permission_accounts. append ( & mut temp_candidates_deletion)
690
698
}
691
699
700
+ require_eq ! (
701
+ delete_permission_accounts. len( ) ,
702
+ delete_permission_account_infos. len( ) ,
703
+ DataCacheError :: ArrayLengthMismatch
704
+ ) ;
705
+
692
706
for ( i, permission_account) in delete_permission_accounts. iter ( ) . enumerate ( ) {
693
707
let curr_permission_account_info = & delete_permission_account_infos[ i] ;
694
708
@@ -1047,6 +1061,12 @@ pub mod data_feeds_cache {
1047
1061
ctx : Context < ' _ , ' _ , ' info , ' info , QueryValues < ' info > > ,
1048
1062
data_ids : Vec < [ u8 ; 16 ] > ,
1049
1063
) -> Result < Vec < DecimalReport > > {
1064
+ require_eq ! (
1065
+ data_ids. len( ) ,
1066
+ ctx. remaining_accounts. len( ) ,
1067
+ DataCacheError :: ArrayLengthMismatch
1068
+ ) ;
1069
+
1050
1070
let mut reports = Vec :: new ( ) ;
1051
1071
1052
1072
for ( i, data_id) in data_ids. iter ( ) . enumerate ( ) {
0 commit comments