Resolve rust compiler warnings
Change-Id: Iaac63d0fb44ecb7e03d68a10df7bddbb521c73a0
This commit is contained in:
parent
a05017c043
commit
f42453be45
|
@ -57,7 +57,8 @@ pub struct PostMessage<'b> {
|
|||
pub clock: Sysvar<'b, Clock>,
|
||||
}
|
||||
|
||||
impl<'b> InstructionContext<'b> for PostMessage<'b> {}
|
||||
impl<'b> InstructionContext<'b> for PostMessage<'b> {
|
||||
}
|
||||
|
||||
#[derive(BorshDeserialize, BorshSerialize)]
|
||||
pub struct PostMessageData {
|
||||
|
|
|
@ -23,7 +23,6 @@ use crate::{
|
|||
PostVAAConsensusFailed,
|
||||
PostVAAGuardianSetExpired,
|
||||
},
|
||||
CHAIN_ID_SOLANA,
|
||||
};
|
||||
use byteorder::{
|
||||
BigEndian,
|
||||
|
|
|
@ -173,7 +173,7 @@ pub fn post_vaa(
|
|||
&program_id,
|
||||
);
|
||||
|
||||
let mut msg_derivation_data = &PostedVAADerivationData {
|
||||
let msg_derivation_data = &PostedVAADerivationData {
|
||||
payload_hash: hash_vaa(&vaa).to_vec(),
|
||||
};
|
||||
|
||||
|
|
|
@ -41,7 +41,6 @@ use std::{
|
|||
Deref,
|
||||
DerefMut,
|
||||
},
|
||||
str::FromStr,
|
||||
};
|
||||
|
||||
#[derive(Default, BorshSerialize, BorshDeserialize, Serialize, Deserialize)]
|
||||
|
@ -176,9 +175,8 @@ impl Owned for PostedMessageData {
|
|||
#[cfg(feature = "cpi")]
|
||||
impl Owned for PostedMessageData {
|
||||
fn owner(&self) -> AccountOwner {
|
||||
AccountOwner::Other(
|
||||
Pubkey::from_str(env!("BRIDGE_ADDRESS")).unwrap(),
|
||||
)
|
||||
use std::str::FromStr;
|
||||
AccountOwner::Other(Pubkey::from_str(env!("BRIDGE_ADDRESS")).unwrap())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -270,9 +268,8 @@ impl Owned for PostedVAAData {
|
|||
#[cfg(feature = "cpi")]
|
||||
impl Owned for PostedVAAData {
|
||||
fn owner(&self) -> AccountOwner {
|
||||
AccountOwner::Other(
|
||||
Pubkey::from_str(env!("BRIDGE_ADDRESS")).unwrap(),
|
||||
)
|
||||
use std::str::FromStr;
|
||||
AccountOwner::Other(Pubkey::from_str(env!("BRIDGE_ADDRESS")).unwrap())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -311,8 +308,8 @@ impl SerializePayload for GovernancePayloadUpgrade {
|
|||
}
|
||||
|
||||
impl DeserializePayload for GovernancePayloadUpgrade
|
||||
where
|
||||
Self: DeserializeGovernancePayload,
|
||||
where
|
||||
Self: DeserializeGovernancePayload,
|
||||
{
|
||||
fn deserialize(buf: &mut &[u8]) -> Result<Self, SolitaireError> {
|
||||
let mut c = Cursor::new(buf);
|
||||
|
@ -336,7 +333,8 @@ impl SerializeGovernancePayload for GovernancePayloadUpgrade {
|
|||
const ACTION: u8 = 1;
|
||||
}
|
||||
|
||||
impl DeserializeGovernancePayload for GovernancePayloadUpgrade {}
|
||||
impl DeserializeGovernancePayload for GovernancePayloadUpgrade {
|
||||
}
|
||||
|
||||
pub struct GovernancePayloadGuardianSetChange {
|
||||
// New GuardianSetIndex
|
||||
|
@ -359,8 +357,8 @@ impl SerializePayload for GovernancePayloadGuardianSetChange {
|
|||
}
|
||||
|
||||
impl DeserializePayload for GovernancePayloadGuardianSetChange
|
||||
where
|
||||
Self: DeserializeGovernancePayload,
|
||||
where
|
||||
Self: DeserializeGovernancePayload,
|
||||
{
|
||||
fn deserialize(buf: &mut &[u8]) -> Result<Self, SolitaireError> {
|
||||
let mut c = Cursor::new(buf);
|
||||
|
@ -392,7 +390,8 @@ impl SerializeGovernancePayload for GovernancePayloadGuardianSetChange {
|
|||
const ACTION: u8 = 2;
|
||||
}
|
||||
|
||||
impl DeserializeGovernancePayload for GovernancePayloadGuardianSetChange {}
|
||||
impl DeserializeGovernancePayload for GovernancePayloadGuardianSetChange {
|
||||
}
|
||||
|
||||
pub struct GovernancePayloadSetMessageFee {
|
||||
// New fee in lamports
|
||||
|
@ -410,8 +409,8 @@ impl SerializePayload for GovernancePayloadSetMessageFee {
|
|||
}
|
||||
|
||||
impl DeserializePayload for GovernancePayloadSetMessageFee
|
||||
where
|
||||
Self: DeserializeGovernancePayload,
|
||||
where
|
||||
Self: DeserializeGovernancePayload,
|
||||
{
|
||||
fn deserialize(buf: &mut &[u8]) -> Result<Self, SolitaireError> {
|
||||
let mut c = Cursor::new(buf);
|
||||
|
@ -434,7 +433,8 @@ impl SerializeGovernancePayload for GovernancePayloadSetMessageFee {
|
|||
const ACTION: u8 = 3;
|
||||
}
|
||||
|
||||
impl DeserializeGovernancePayload for GovernancePayloadSetMessageFee {}
|
||||
impl DeserializeGovernancePayload for GovernancePayloadSetMessageFee {
|
||||
}
|
||||
|
||||
pub struct GovernancePayloadTransferFees {
|
||||
// Amount to be transferred
|
||||
|
@ -455,8 +455,8 @@ impl SerializePayload for GovernancePayloadTransferFees {
|
|||
}
|
||||
|
||||
impl DeserializePayload for GovernancePayloadTransferFees
|
||||
where
|
||||
Self: DeserializeGovernancePayload,
|
||||
where
|
||||
Self: DeserializeGovernancePayload,
|
||||
{
|
||||
fn deserialize(buf: &mut &[u8]) -> Result<Self, SolitaireError> {
|
||||
let mut c = Cursor::new(buf);
|
||||
|
@ -482,7 +482,8 @@ impl SerializeGovernancePayload for GovernancePayloadTransferFees {
|
|||
const ACTION: u8 = 4;
|
||||
}
|
||||
|
||||
impl DeserializeGovernancePayload for GovernancePayloadTransferFees {}
|
||||
impl DeserializeGovernancePayload for GovernancePayloadTransferFees {
|
||||
}
|
||||
|
||||
#[repr(u8)]
|
||||
#[derive(BorshSerialize, BorshDeserialize, Clone, Serialize, Deserialize)]
|
||||
|
|
Loading…
Reference in New Issue