solitaire: remove unused InstructionContext

This commit is contained in:
Reisen 2022-06-24 03:40:25 +00:00 committed by Csongor Kiss
parent a8d1ed129b
commit 4131381fa4
19 changed files with 0 additions and 94 deletions

View File

@ -30,9 +30,6 @@ pub struct PostMessage<'b> {
pub bridge_program: Info<'b>,
}
impl<'b> InstructionContext<'b> for PostMessage<'b> {
}
#[derive(BorshDeserialize, BorshSerialize)]
pub struct PostMessageData {
/// Unique nonce for this message

View File

@ -86,9 +86,6 @@ pub struct UpgradeContract<'b> {
pub system: Info<'b>,
}
impl<'b> InstructionContext<'b> for UpgradeContract<'b> {
}
#[derive(BorshDeserialize, BorshSerialize, Default)]
pub struct UpgradeContractData {}
@ -136,9 +133,6 @@ pub struct UpgradeGuardianSet<'b> {
pub guardian_set_new: Mut<GuardianSet<'b, { AccountState::Uninitialized }>>,
}
impl<'b> InstructionContext<'b> for UpgradeGuardianSet<'b> {
}
#[derive(BorshDeserialize, BorshSerialize, Default)]
pub struct UpgradeGuardianSetData {}
@ -212,9 +206,6 @@ pub struct SetFees<'b> {
pub vaa: ClaimableVAA<'b, GovernancePayloadSetMessageFee>,
}
impl<'b> InstructionContext<'b> for SetFees<'b> {
}
#[derive(BorshDeserialize, BorshSerialize, Default)]
pub struct SetFeesData {}
@ -248,9 +239,6 @@ pub struct TransferFees<'b> {
pub rent: Sysvar<'b, Rent>,
}
impl<'b> InstructionContext<'b> for TransferFees<'b> {
}
#[derive(BorshDeserialize, BorshSerialize, Default)]
pub struct TransferFeesData {}

View File

@ -35,9 +35,6 @@ pub struct Initialize<'b> {
pub clock: Sysvar<'b, Clock>,
}
impl<'b> InstructionContext<'b> for Initialize<'b> {
}
#[derive(BorshDeserialize, BorshSerialize, Default)]
pub struct InitializeData {
/// Period for how long a guardian set is valid after it has been replaced by a new one. This

View File

@ -58,8 +58,6 @@ pub struct PostMessage<'b> {
pub clock: Sysvar<'b, Clock>,
}
impl<'b> InstructionContext<'b> for PostMessage<'b> {}
#[derive(BorshDeserialize, BorshSerialize)]
pub struct PostMessageData {
/// Unique nonce for this message

View File

@ -73,9 +73,6 @@ pub struct PostVAA<'b> {
pub clock: Sysvar<'b, Clock>,
}
impl<'b> InstructionContext<'b> for PostVAA<'b> {
}
#[derive(Default, BorshSerialize, BorshDeserialize)]
pub struct Signature {
pub index: u8,

View File

@ -36,9 +36,6 @@ pub struct VerifySignatures<'b> {
pub instruction_acc: Info<'b>,
}
impl<'b> InstructionContext<'b> for VerifySignatures<'b> {
}
impl From<&VerifySignatures<'_>> for GuardianSetDerivationData {
fn from(data: &VerifySignatures<'_>) -> Self {
GuardianSetDerivationData {

View File

@ -44,9 +44,6 @@ pub struct PostVAA<'b> {
pub clock: Sysvar<'b, Clock>,
}
impl<'b> InstructionContext<'b> for PostVAA<'b> {
}
#[derive(Default, BorshSerialize, BorshDeserialize)]
pub struct Signature {
pub index: u8,

View File

@ -72,9 +72,6 @@ impl<'a> From<&CompleteNative<'a>> for CustodyAccountDerivationData {
}
}
impl<'b> InstructionContext<'b> for CompleteNative<'b> {
}
#[derive(BorshDeserialize, BorshSerialize, Default)]
pub struct CompleteNativeData {}
@ -203,9 +200,6 @@ impl<'a> From<&CompleteWrapped<'a>> for WrappedMetaDerivationData {
}
}
impl<'b> InstructionContext<'b> for CompleteWrapped<'b> {
}
#[derive(BorshDeserialize, BorshSerialize, Default)]
pub struct CompleteWrappedData {}
@ -214,7 +208,6 @@ pub fn complete_wrapped(
accs: &mut CompleteWrapped,
_data: CompleteWrappedData,
) -> Result<()> {
// Verify the chain registration
let derivation_data: EndpointDerivationData = (&*accs).into();
accs.chain_registration
@ -341,9 +334,6 @@ impl<'a> From<&CompleteWrappedMeta<'a>> for WrappedMetaDerivationData {
}
}
impl<'b> InstructionContext<'b> for CompleteWrappedMeta<'b> {
}
#[derive(BorshDeserialize, BorshSerialize, Default)]
pub struct CompleteWrappedMetaData {}

View File

@ -83,9 +83,6 @@ pub struct UpgradeContract<'b> {
pub system: Info<'b>,
}
impl<'b> InstructionContext<'b> for UpgradeContract<'b> {
}
#[derive(BorshDeserialize, BorshSerialize, Default)]
pub struct UpgradeContractData {}
@ -135,9 +132,6 @@ impl<'a> From<&RegisterChain<'a>> for EndpointDerivationData {
}
}
impl<'b> InstructionContext<'b> for RegisterChain<'b> {
}
#[derive(BorshDeserialize, BorshSerialize, Default)]
pub struct RegisterChainData {}

View File

@ -20,9 +20,6 @@ pub struct InitializeData {
pub bridge: Pubkey,
}
impl<'b> InstructionContext<'b> for Initialize<'b> {
}
pub fn initialize(
ctx: &ExecutionContext,
accs: &mut Initialize,

View File

@ -106,9 +106,6 @@ impl<'a> From<&TransferNative<'a>> for SplTokenMetaDerivationData {
}
}
impl<'b> InstructionContext<'b> for TransferNative<'b> {
}
#[derive(BorshDeserialize, BorshSerialize, Default)]
pub struct TransferNativeData {
pub nonce: u32,
@ -277,9 +274,6 @@ impl<'a> From<&TransferWrapped<'a>> for SplTokenMetaDerivationData {
}
}
impl<'b> InstructionContext<'b> for TransferWrapped<'b> {
}
#[derive(BorshDeserialize, BorshSerialize, Default)]
pub struct TransferWrappedData {
pub nonce: u32,

View File

@ -67,9 +67,6 @@ pub struct AttestToken<'b> {
pub clock: Sysvar<'b, Clock>,
}
impl<'b> InstructionContext<'b> for AttestToken<'b> {
}
impl<'a> From<&AttestToken<'a>> for WrappedMetaDerivationData {
fn from(accs: &AttestToken<'a>) -> Self {
WrappedMetaDerivationData {

View File

@ -63,9 +63,6 @@ impl<'a> From<&CompleteNative<'a>> for CustodyAccountDerivationData {
}
}
impl<'b> InstructionContext<'b> for CompleteNative<'b> {
}
#[derive(BorshDeserialize, BorshSerialize, Default)]
pub struct CompleteNativeData {}
@ -189,9 +186,6 @@ impl<'a> From<&CompleteWrapped<'a>> for WrappedDerivationData {
}
}
impl<'b> InstructionContext<'b> for CompleteWrapped<'b> {
}
#[derive(BorshDeserialize, BorshSerialize, Default)]
pub struct CompleteWrappedData {}

View File

@ -73,9 +73,6 @@ impl<'a> From<&CompleteNativeWithPayload<'a>> for CustodyAccountDerivationData {
}
}
impl<'b> InstructionContext<'b> for CompleteNativeWithPayload<'b> {
}
#[derive(BorshDeserialize, BorshSerialize, Default)]
pub struct CompleteNativeWithPayloadData {}
@ -212,9 +209,6 @@ impl<'a> From<&CompleteWrappedWithPayload<'a>> for WrappedDerivationData {
}
}
impl<'b> InstructionContext<'b> for CompleteWrappedWithPayload<'b> {
}
#[derive(BorshDeserialize, BorshSerialize, Default)]
pub struct CompleteWrappedWithPayloadData {}

View File

@ -86,9 +86,6 @@ impl<'a> From<&CreateWrapped<'a>> for WrappedMetaDerivationData {
}
}
impl<'b> InstructionContext<'b> for CreateWrapped<'b> {
}
#[derive(BorshDeserialize, BorshSerialize, Default)]
pub struct CreateWrappedData {}

View File

@ -84,9 +84,6 @@ pub struct UpgradeContract<'b> {
pub system: Info<'b>,
}
impl<'b> InstructionContext<'b> for UpgradeContract<'b> {
}
#[derive(BorshDeserialize, BorshSerialize, Default)]
pub struct UpgradeContractData {}
@ -139,9 +136,6 @@ impl<'a> From<&RegisterChain<'a>> for EndpointDerivationData {
}
}
impl<'b> InstructionContext<'b> for RegisterChain<'b> {
}
#[derive(BorshDeserialize, BorshSerialize, Default)]
pub struct RegisterChainData {}

View File

@ -20,9 +20,6 @@ pub struct InitializeData {
pub bridge: Pubkey,
}
impl<'b> InstructionContext<'b> for Initialize<'b> {
}
pub fn initialize(
ctx: &ExecutionContext,
accs: &mut Initialize,

View File

@ -100,9 +100,6 @@ impl<'a> From<&TransferNative<'a>> for CustodyAccountDerivationData {
}
}
impl<'b> InstructionContext<'b> for TransferNative<'b> {
}
#[derive(BorshDeserialize, BorshSerialize, Default)]
pub struct TransferNativeData {
pub nonce: u32,
@ -342,9 +339,6 @@ impl<'a> From<&TransferWrapped<'a>> for WrappedMetaDerivationData {
}
}
impl<'b> InstructionContext<'b> for TransferWrapped<'b> {
}
#[derive(BorshDeserialize, BorshSerialize, Default)]
pub struct TransferWrappedData {
pub nonce: u32,

View File

@ -1,4 +1,3 @@
#![allow(incomplete_features)]
#![feature(adt_const_params)]
@ -82,12 +81,6 @@ impl CreationLamports {
}
}
pub trait InstructionContext<'a> {
fn deps(&self) -> Vec<Pubkey> {
vec![]
}
}
/// Trait definition that describes types that can be constructed from a list of solana account
/// references. A list of dependent accounts is produced as a side effect of the parsing stage.
pub trait FromAccounts<'a, 'b: 'a, 'c> {