cargo fix

This commit is contained in:
De Facto 2021-02-04 16:22:45 +08:00
parent bea78fc897
commit 124e0ab7ae
4 changed files with 11 additions and 12 deletions

View File

@ -1,7 +1,7 @@
use borsh::{BorshDeserialize, BorshSerialize};
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,
};

View File

@ -1,10 +1,9 @@
//! Program entrypoint
use crate::{error::Error, processor::Processor};
use crate::{processor::Processor};
use solana_program::{
account_info::AccountInfo, entrypoint, entrypoint::ProgramResult,
program_error::PrintProgramError, pubkey::Pubkey,
account_info::AccountInfo, entrypoint, entrypoint::ProgramResult, pubkey::Pubkey,
};
entrypoint!(process_instruction);

View File

@ -2,7 +2,7 @@
//! 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_utils;
@ -14,8 +14,8 @@ pub mod state;
#[cfg(not(feature = "no-entrypoint"))]
pub mod entrypoint;
use error::Error;
use state::Aggregator;
/// Get median value from the aggregator account
// pub fn get_median(aggregator_info: &AccountInfo) -> Result<u64, ProgramError> {

View File

@ -1,10 +1,10 @@
//! Program state processor
use std::default;
use crate::{
error::Error,
instruction::{Instruction, PAYMENT_AMOUNT},
instruction::{Instruction},
state::{Aggregator, AggregatorConfig, Oracle, Round},
};
@ -185,7 +185,7 @@ impl<'a> SubmitContext<'a> {
.submissions
.iter_mut()
.enumerate()
.find(|(i, s)| {
.find(|(_i, s)| {
// either finds a new spot to put the submission, or find a spot
// that the oracle previously submitted to.
return !s.is_initialized() || s.oracle == self.oracle.key.to_bytes();
@ -262,7 +262,7 @@ pub struct Processor {}
impl Processor {
pub fn process<'a>(
program_id: &Pubkey,
_program_id: &Pubkey,
accounts: &'a [AccountInfo<'a>],
input: &[u8],
) -> ProgramResult {
@ -481,7 +481,7 @@ mod tests {
let program_id = Pubkey::new_unique();
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)?;
process(