cargo fix
This commit is contained in:
parent
bea78fc897
commit
124e0ab7ae
|
@ -1,7 +1,7 @@
|
||||||
use borsh::{BorshDeserialize, BorshSerialize};
|
use borsh::{BorshDeserialize, BorshSerialize};
|
||||||
|
|
||||||
use solana_program::{
|
use solana_program::{
|
||||||
account_info::AccountInfo, entrypoint::ProgramResult, msg, program_error::ProgramError,
|
account_info::AccountInfo, entrypoint::ProgramResult, program_error::ProgramError,
|
||||||
program_pack::IsInitialized, sysvar::rent::Rent,
|
program_pack::IsInitialized, sysvar::rent::Rent,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
//! Program entrypoint
|
//! Program entrypoint
|
||||||
|
|
||||||
use crate::{error::Error, processor::Processor};
|
use crate::{processor::Processor};
|
||||||
|
|
||||||
use solana_program::{
|
use solana_program::{
|
||||||
account_info::AccountInfo, entrypoint, entrypoint::ProgramResult,
|
account_info::AccountInfo, entrypoint, entrypoint::ProgramResult, pubkey::Pubkey,
|
||||||
program_error::PrintProgramError, pubkey::Pubkey,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
entrypoint!(process_instruction);
|
entrypoint!(process_instruction);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
//! An Flux Aggregator program for the Solana blockchain
|
//! An Flux Aggregator program for the Solana blockchain
|
||||||
|
|
||||||
use solana_program::{account_info::AccountInfo, program_error::ProgramError, program_pack::Pack};
|
|
||||||
|
|
||||||
pub mod borsh_state;
|
pub mod borsh_state;
|
||||||
pub mod borsh_utils;
|
pub mod borsh_utils;
|
||||||
|
@ -14,8 +14,8 @@ pub mod state;
|
||||||
#[cfg(not(feature = "no-entrypoint"))]
|
#[cfg(not(feature = "no-entrypoint"))]
|
||||||
pub mod entrypoint;
|
pub mod entrypoint;
|
||||||
|
|
||||||
use error::Error;
|
|
||||||
use state::Aggregator;
|
|
||||||
|
|
||||||
/// Get median value from the aggregator account
|
/// Get median value from the aggregator account
|
||||||
// pub fn get_median(aggregator_info: &AccountInfo) -> Result<u64, ProgramError> {
|
// pub fn get_median(aggregator_info: &AccountInfo) -> Result<u64, ProgramError> {
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
//! Program state processor
|
//! Program state processor
|
||||||
|
|
||||||
use std::default;
|
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
error::Error,
|
error::Error,
|
||||||
instruction::{Instruction, PAYMENT_AMOUNT},
|
instruction::{Instruction},
|
||||||
state::{Aggregator, AggregatorConfig, Oracle, Round},
|
state::{Aggregator, AggregatorConfig, Oracle, Round},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -185,7 +185,7 @@ impl<'a> SubmitContext<'a> {
|
||||||
.submissions
|
.submissions
|
||||||
.iter_mut()
|
.iter_mut()
|
||||||
.enumerate()
|
.enumerate()
|
||||||
.find(|(i, s)| {
|
.find(|(_i, s)| {
|
||||||
// either finds a new spot to put the submission, or find a spot
|
// either finds a new spot to put the submission, or find a spot
|
||||||
// that the oracle previously submitted to.
|
// that the oracle previously submitted to.
|
||||||
return !s.is_initialized() || s.oracle == self.oracle.key.to_bytes();
|
return !s.is_initialized() || s.oracle == self.oracle.key.to_bytes();
|
||||||
|
@ -262,7 +262,7 @@ pub struct Processor {}
|
||||||
|
|
||||||
impl Processor {
|
impl Processor {
|
||||||
pub fn process<'a>(
|
pub fn process<'a>(
|
||||||
program_id: &Pubkey,
|
_program_id: &Pubkey,
|
||||||
accounts: &'a [AccountInfo<'a>],
|
accounts: &'a [AccountInfo<'a>],
|
||||||
input: &[u8],
|
input: &[u8],
|
||||||
) -> ProgramResult {
|
) -> ProgramResult {
|
||||||
|
@ -481,7 +481,7 @@ mod tests {
|
||||||
let program_id = Pubkey::new_unique();
|
let program_id = Pubkey::new_unique();
|
||||||
|
|
||||||
let (mut aggregator, mut aggregator_owner) = create_aggregator(&program_id)?;
|
let (mut aggregator, mut aggregator_owner) = create_aggregator(&program_id)?;
|
||||||
let (mut oracle, mut oracle_owner) =
|
let (mut oracle, _oracle_owner) =
|
||||||
create_oracle(&program_id, &mut aggregator, &mut aggregator_owner)?;
|
create_oracle(&program_id, &mut aggregator, &mut aggregator_owner)?;
|
||||||
|
|
||||||
process(
|
process(
|
||||||
|
|
Loading…
Reference in New Issue