pyth2wormhole-client: Fix warnings and the client feature
Change-Id: Ia74685f5e8e448c30678a4445c38f39f2f324a89
This commit is contained in:
parent
b5463572be
commit
54aadf5f5a
|
@ -2068,6 +2068,7 @@ dependencies = [
|
||||||
"rocksalt",
|
"rocksalt",
|
||||||
"solana-program",
|
"solana-program",
|
||||||
"solitaire",
|
"solitaire",
|
||||||
|
"solitaire-client",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
|
@ -9,12 +9,13 @@ crate-type = ["cdylib", "lib"]
|
||||||
name = "pyth2wormhole"
|
name = "pyth2wormhole"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
client = ["solitaire/client", "no-entrypoint"]
|
client = ["solitaire/client", "solitaire-client", "no-entrypoint"]
|
||||||
no-entrypoint = []
|
no-entrypoint = []
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
bridge = {path = "../../bridge/program"}
|
bridge = {path = "../../bridge/program"}
|
||||||
solitaire = { path = "../../solitaire/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"}
|
pyth-client = {git = "https://github.com/drozdziak1/pyth-client-rs", branch = "v2-clone-and-debug"}
|
||||||
rocksalt = { path = "../../solitaire/rocksalt" }
|
rocksalt = { path = "../../solitaire/rocksalt" }
|
||||||
solana-program = "=1.7.0"
|
solana-program = "=1.7.0"
|
||||||
|
|
|
@ -1,13 +1,11 @@
|
||||||
use std::{convert::TryFrom, mem};
|
|
||||||
|
|
||||||
use borsh::{BorshDeserialize, BorshSerialize};
|
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 solana_program::{msg, program_error::ProgramError, pubkey::Pubkey};
|
||||||
use solitaire::{
|
use solitaire::{
|
||||||
processors::seeded::AccountOwner, AccountState, Context, Data, ExecutionContext, FromAccounts,
|
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,
|
ToInstruction,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -67,9 +65,9 @@ impl<'b> InstructionContext<'b> for Forward<'b> {
|
||||||
pub fn forward_price(
|
pub fn forward_price(
|
||||||
_ctx: &ExecutionContext,
|
_ctx: &ExecutionContext,
|
||||||
accs: &mut Forward,
|
accs: &mut Forward,
|
||||||
data: ForwardData,
|
_data: ForwardData,
|
||||||
) -> SoliResult<()> {
|
) -> 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(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use std::{convert::TryFrom, mem};
|
use std::{mem};
|
||||||
|
|
||||||
use pyth_client::{CorpAction, Price, PriceStatus, PriceType};
|
use pyth_client::{CorpAction, Price, PriceStatus, PriceType};
|
||||||
use solana_program::{program_error::ProgramError, pubkey::Pubkey};
|
use solana_program::{program_error::ProgramError, pubkey::Pubkey};
|
||||||
|
|
Loading…
Reference in New Issue