@@ -16,7 +16,6 @@ pub enum GovernanceAction {
1616 SetValidPeriod ,
1717 RequestGovernanceDataSourceTransfer ,
1818 SetWormholeAddress ,
19- SetFeeInToken ,
2019 SetTransactionFee ,
2120 WithdrawFee ,
2221}
@@ -33,7 +32,6 @@ impl TryFrom<u8> for GovernanceAction {
3332 4 => Ok ( GovernanceAction :: SetValidPeriod ) ,
3433 5 => Ok ( GovernanceAction :: RequestGovernanceDataSourceTransfer ) ,
3534 6 => Ok ( GovernanceAction :: SetWormholeAddress ) ,
36- 7 => Ok ( GovernanceAction :: SetFeeInToken ) ,
3735 8 => Ok ( GovernanceAction :: SetTransactionFee ) ,
3836 9 => Ok ( GovernanceAction :: WithdrawFee ) ,
3937 _ => Err ( PythReceiverError :: InvalidGovernanceAction ) ,
@@ -56,7 +54,6 @@ pub enum GovernancePayload {
5654 SetValidPeriod ( SetValidPeriod ) ,
5755 RequestGovernanceDataSourceTransfer ( RequestGovernanceDataSourceTransfer ) ,
5856 SetWormholeAddress ( SetWormholeAddress ) ,
59- SetFeeInToken ( SetFeeInToken ) ,
6057 SetTransactionFee ( SetTransactionFee ) ,
6158 WithdrawFee ( WithdrawFee ) ,
6259}
@@ -85,13 +82,6 @@ pub struct WithdrawFee {
8582 pub target_address : Address ,
8683}
8784
88- #[ derive( Clone , Debug , PartialEq ) ]
89- pub struct SetFeeInToken {
90- pub value : u64 ,
91- pub expo : u64 ,
92- pub token : Address ,
93- }
94-
9585#[ derive( Clone , Debug , PartialEq ) ]
9686pub struct SetDataSources {
9787 pub sources : Vec < DataSource > ,
@@ -247,50 +237,6 @@ pub fn parse_instruction(payload: Vec<u8>) -> Result<GovernanceInstruction, Pyth
247237 cursor += 8 ;
248238 GovernancePayload :: SetFee ( SetFee { value, expo } )
249239 }
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- }
294240 GovernanceAction :: SetValidPeriod => {
295241 if payload. len ( ) < cursor + 8 {
296242 return Err ( PythReceiverError :: InvalidGovernanceMessage ) ;
0 commit comments