From 54aadf5f5a28414da0e260cb564b55a423faca45 Mon Sep 17 00:00:00 2001 From: Stan Drozd Date: Tue, 29 Jun 2021 17:32:24 +0200 Subject: [PATCH] pyth2wormhole-client: Fix warnings and the client feature Change-Id: Ia74685f5e8e448c30678a4445c38f39f2f324a89 --- solana/pyth2wormhole/Cargo.lock | 1 + solana/pyth2wormhole/program/Cargo.toml | 3 ++- solana/pyth2wormhole/program/src/forward.rs | 12 +++++------- solana/pyth2wormhole/program/src/types.rs | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/solana/pyth2wormhole/Cargo.lock b/solana/pyth2wormhole/Cargo.lock index 914fcf89..d8fa2d76 100644 --- a/solana/pyth2wormhole/Cargo.lock +++ b/solana/pyth2wormhole/Cargo.lock @@ -2068,6 +2068,7 @@ dependencies = [ "rocksalt", "solana-program", "solitaire", + "solitaire-client", ] [[package]] diff --git a/solana/pyth2wormhole/program/Cargo.toml b/solana/pyth2wormhole/program/Cargo.toml index 1728ab6a..8239c9ec 100644 --- a/solana/pyth2wormhole/program/Cargo.toml +++ b/solana/pyth2wormhole/program/Cargo.toml @@ -9,12 +9,13 @@ crate-type = ["cdylib", "lib"] name = "pyth2wormhole" [features] -client = ["solitaire/client", "no-entrypoint"] +client = ["solitaire/client", "solitaire-client", "no-entrypoint"] no-entrypoint = [] [dependencies] bridge = {path = "../../bridge/program"} solitaire = { path = "../../solitaire/program" } +solitaire-client = { path = "../../solitaire/client", optional = true } pyth-client = {git = "https://github.com/drozdziak1/pyth-client-rs", branch = "v2-clone-and-debug"} rocksalt = { path = "../../solitaire/rocksalt" } solana-program = "=1.7.0" diff --git a/solana/pyth2wormhole/program/src/forward.rs b/solana/pyth2wormhole/program/src/forward.rs index 75d2b0eb..ba31ae94 100644 --- a/solana/pyth2wormhole/program/src/forward.rs +++ b/solana/pyth2wormhole/program/src/forward.rs @@ -1,13 +1,11 @@ -use std::{convert::TryFrom, mem}; + use borsh::{BorshDeserialize, BorshSerialize}; -use pyth_client::{ - AccKey, AccountType, CorpAction, Price, PriceComp, PriceInfo, PriceStatus, PriceType, -}; + use solana_program::{msg, program_error::ProgramError, pubkey::Pubkey}; use solitaire::{ processors::seeded::AccountOwner, AccountState, Context, Data, ExecutionContext, FromAccounts, - Info, InstructionContext, Keyed, Owned, Peel, Result as SoliResult, Signer, SolitaireError, + Info, InstructionContext, Keyed, Owned, Peel, Result as SoliResult, Signer, ToInstruction, }; @@ -67,9 +65,9 @@ impl<'b> InstructionContext<'b> for Forward<'b> { pub fn forward_price( _ctx: &ExecutionContext, accs: &mut Forward, - data: ForwardData, + _data: ForwardData, ) -> SoliResult<()> { - let price_attestation = PriceAttestation::from_bytes(&*accs.pyth_price.0.try_borrow_data()?)?; + let _price_attestation = PriceAttestation::from_bytes(&*accs.pyth_price.0.try_borrow_data()?)?; Ok(()) } diff --git a/solana/pyth2wormhole/program/src/types.rs b/solana/pyth2wormhole/program/src/types.rs index 2ce91b4d..3094b851 100644 --- a/solana/pyth2wormhole/program/src/types.rs +++ b/solana/pyth2wormhole/program/src/types.rs @@ -1,4 +1,4 @@ -use std::{convert::TryFrom, mem}; +use std::{mem}; use pyth_client::{CorpAction, Price, PriceStatus, PriceType}; use solana_program::{program_error::ProgramError, pubkey::Pubkey};