@@ -16,7 +16,6 @@ pub enum GovernanceAction {
16
16
SetValidPeriod ,
17
17
RequestGovernanceDataSourceTransfer ,
18
18
SetWormholeAddress ,
19
- SetFeeInToken ,
20
19
SetTransactionFee ,
21
20
WithdrawFee ,
22
21
}
@@ -33,7 +32,6 @@ impl TryFrom<u8> for GovernanceAction {
33
32
4 => Ok ( GovernanceAction :: SetValidPeriod ) ,
34
33
5 => Ok ( GovernanceAction :: RequestGovernanceDataSourceTransfer ) ,
35
34
6 => Ok ( GovernanceAction :: SetWormholeAddress ) ,
36
- 7 => Ok ( GovernanceAction :: SetFeeInToken ) ,
37
35
8 => Ok ( GovernanceAction :: SetTransactionFee ) ,
38
36
9 => Ok ( GovernanceAction :: WithdrawFee ) ,
39
37
_ => Err ( PythReceiverError :: InvalidGovernanceAction ) ,
@@ -56,7 +54,6 @@ pub enum GovernancePayload {
56
54
SetValidPeriod ( SetValidPeriod ) ,
57
55
RequestGovernanceDataSourceTransfer ( RequestGovernanceDataSourceTransfer ) ,
58
56
SetWormholeAddress ( SetWormholeAddress ) ,
59
- SetFeeInToken ( SetFeeInToken ) ,
60
57
SetTransactionFee ( SetTransactionFee ) ,
61
58
WithdrawFee ( WithdrawFee ) ,
62
59
}
@@ -85,13 +82,6 @@ pub struct WithdrawFee {
85
82
pub target_address : Address ,
86
83
}
87
84
88
- #[ derive( Clone , Debug , PartialEq ) ]
89
- pub struct SetFeeInToken {
90
- pub value : u64 ,
91
- pub expo : u64 ,
92
- pub token : Address ,
93
- }
94
-
95
85
#[ derive( Clone , Debug , PartialEq ) ]
96
86
pub struct SetDataSources {
97
87
pub sources : Vec < DataSource > ,
@@ -247,50 +237,6 @@ pub fn parse_instruction(payload: Vec<u8>) -> Result<GovernanceInstruction, Pyth
247
237
cursor += 8 ;
248
238
GovernancePayload :: SetFee ( SetFee { value, expo } )
249
239
}
250
- GovernanceAction :: SetFeeInToken => {
251
- if payload. len ( ) < cursor + 17 {
252
- return Err ( PythReceiverError :: InvalidGovernanceMessage ) ;
253
- }
254
-
255
- let fee_token_value = payload
256
- . get ( cursor..cursor + 8 )
257
- . ok_or ( PythReceiverError :: InvalidGovernanceMessage ) ?;
258
-
259
- let value = u64:: from_be_bytes (
260
- fee_token_value
261
- . try_into ( )
262
- . map_err ( |_| PythReceiverError :: InvalidGovernanceMessage ) ?,
263
- ) ;
264
- cursor += 8 ;
265
-
266
- let expo_bytes = payload
267
- . get ( cursor..cursor + 8 )
268
- . ok_or ( PythReceiverError :: InvalidGovernanceMessage ) ?;
269
- let expo = u64:: from_be_bytes (
270
- expo_bytes
271
- . try_into ( )
272
- . map_err ( |_| PythReceiverError :: InvalidGovernanceMessage ) ?,
273
- ) ;
274
- cursor += 8 ;
275
-
276
- let token_len = payload[ cursor] ;
277
- cursor += 1 ;
278
-
279
- if token_len != 20 {
280
- return Err ( PythReceiverError :: InvalidGovernanceMessage ) ;
281
- }
282
- if payload. len ( ) < cursor + 20 {
283
- return Err ( PythReceiverError :: InvalidGovernanceMessage ) ;
284
- }
285
- let mut token_bytes = [ 0u8 ; 20 ] ;
286
- token_bytes. copy_from_slice ( & payload[ cursor..cursor + 20 ] ) ;
287
- cursor += 20 ;
288
- GovernancePayload :: SetFeeInToken ( SetFeeInToken {
289
- value,
290
- expo,
291
- token : Address :: from ( token_bytes) ,
292
- } )
293
- }
294
240
GovernanceAction :: SetValidPeriod => {
295
241
if payload. len ( ) < cursor + 8 {
296
242
return Err ( PythReceiverError :: InvalidGovernanceMessage ) ;
0 commit comments