Skip to content

Commit

Permalink
Use 1.8.14 instead and fix compute
Browse files Browse the repository at this point in the history
  • Loading branch information
0xkiplet committed Feb 10, 2022
1 parent 7160c00 commit 78028d5
Show file tree
Hide file tree
Showing 11 changed files with 751 additions and 482 deletions.
1,193 changes: 732 additions & 461 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ci/solana-version.sh
Expand Up @@ -14,7 +14,7 @@
if [[ -n $SOLANA_VERSION ]]; then
solana_version="$SOLANA_VERSION"
else
solana_version=v1.9.5
solana_version=v1.8.14
fi

export solana_version="$solana_version"
Expand Down
12 changes: 6 additions & 6 deletions token-lending/cli/Cargo.toml
Expand Up @@ -10,12 +10,12 @@ version = "0.1.0"

[dependencies]
clap = "=2.34.0"
solana-clap-utils = "=1.9.5"
solana-cli-config = "=1.9.5"
solana-client = "=1.9.5"
solana-logger = "=1.9.5"
solana-sdk = "=1.9.5"
solana-program = "=1.9.5"
solana-clap-utils = "=1.8.14"
solana-cli-config = "=1.8.14"
solana-client = "=1.8.14"
solana-logger = "=1.8.14"
solana-sdk = "=1.8.14"
solana-program = "=1.8.14"
spl-token-lending = { path="../program", features = [ "no-entrypoint" ] }
spl-token = { version = "3.2.0", features=["no-entrypoint"] }

Expand Down
6 changes: 3 additions & 3 deletions token-lending/program/Cargo.toml
Expand Up @@ -16,7 +16,7 @@ arrayref = "0.3.6"
bytemuck = "1.5.1"
num-derive = "0.3"
num-traits = "0.2"
solana-program = "=1.9.5"
solana-program = "=1.8.14"
spl-token = { version = "3.2.0", features=["no-entrypoint"] }
switchboard-program = "0.2.0"
thiserror = "1.0"
Expand All @@ -27,8 +27,8 @@ assert_matches = "1.5.0"
base64 = "0.13"
log = "0.4.14"
proptest = "1.0"
solana-program-test = "=1.9.5"
solana-sdk = "=1.9.5"
solana-program-test = "=1.8.14"
solana-sdk = "=1.8.14"
serde = "1.0"
serde_yaml = "0.8"

Expand Down
4 changes: 2 additions & 2 deletions token-lending/program/tests/borrow_obligation_liquidity.rs
Expand Up @@ -28,7 +28,7 @@ async fn test_borrow_usdc_fixed_amount() {
);

// limit to track compute unit increase
test.set_bpf_compute_max_units(45_000);
test.set_bpf_compute_max_units(50_000);

const USDC_TOTAL_BORROW_FRACTIONAL: u64 = 1_000 * FRACTIONAL_TO_USDC;
const FEE_AMOUNT: u64 = 100;
Expand Down Expand Up @@ -172,7 +172,7 @@ async fn test_borrow_sol_max_amount() {
);

// limit to track compute unit increase
test.set_bpf_compute_max_units(45_000);
test.set_bpf_compute_max_units(52_000);

const FEE_AMOUNT: u64 = 5000;
const HOST_FEE_AMOUNT: u64 = 1000;
Expand Down
6 changes: 2 additions & 4 deletions token-lending/program/tests/flash_borrow_repay.rs
Expand Up @@ -3,16 +3,14 @@
mod helpers;

use helpers::*;
use solana_program::instruction::AccountMeta;
use solana_program_test::*;
use solana_sdk::{
pubkey::Pubkey,
signature::{Keypair, Signer},
transaction::{Transaction, TransactionError},
transaction::{Transaction},
};
use spl_token::solana_program::instruction::InstructionError;
use spl_token_lending::{
error::LendingError, instruction::flash_borrow_reserve_liquidity,
instruction::flash_borrow_reserve_liquidity,
instruction::flash_repay_reserve_liquidity, processor::process_instruction,
};

Expand Down
2 changes: 1 addition & 1 deletion token-lending/program/tests/liquidate_obligation.rs
Expand Up @@ -25,7 +25,7 @@ async fn test_success() {
);

// limit to track compute unit increase
test.set_bpf_compute_max_units(51_000);
test.set_bpf_compute_max_units(57_000);

// 100 SOL collateral
const SOL_DEPOSIT_AMOUNT_LAMPORTS: u64 = 100 * LAMPORTS_TO_SOL * INITIAL_COLLATERAL_RATIO;
Expand Down
2 changes: 1 addition & 1 deletion token-lending/program/tests/obligation_end_to_end.rs
Expand Up @@ -32,7 +32,7 @@ async fn test_success() {
);

// limit to track compute unit increase
test.set_bpf_compute_max_units(45_000);
test.set_bpf_compute_max_units(160_000);

const FEE_AMOUNT: u64 = 100;
const HOST_FEE_AMOUNT: u64 = 20;
Expand Down
2 changes: 1 addition & 1 deletion token-lending/program/tests/refresh_obligation.rs
Expand Up @@ -27,7 +27,7 @@ async fn test_success() {
);

// limit to track compute unit increase
test.set_bpf_compute_max_units(28_000);
test.set_bpf_compute_max_units(42_000);

const SOL_DEPOSIT_AMOUNT: u64 = 100;
const USDC_BORROW_AMOUNT: u64 = 1_000;
Expand Down
2 changes: 1 addition & 1 deletion token-lending/program/tests/refresh_reserve.rs
Expand Up @@ -25,7 +25,7 @@ async fn test_success() {
);

// limit to track compute unit increase
test.set_bpf_compute_max_units(16_000);
test.set_bpf_compute_max_units(28_000);

const SOL_RESERVE_LIQUIDITY_LAMPORTS: u64 = 100 * LAMPORTS_TO_SOL;
const USDC_RESERVE_LIQUIDITY_FRACTIONAL: u64 = 100 * FRACTIONAL_TO_USDC;
Expand Down
Expand Up @@ -27,7 +27,7 @@ async fn test_withdraw_fixed_amount() {
);

// limit to track compute unit increase
test.set_bpf_compute_max_units(33_000);
test.set_bpf_compute_max_units(36_000);

const SOL_DEPOSIT_AMOUNT_LAMPORTS: u64 = 200 * LAMPORTS_TO_SOL * INITIAL_COLLATERAL_RATIO;
const USDC_BORROW_AMOUNT_FRACTIONAL: u64 = 1_000 * FRACTIONAL_TO_USDC;
Expand Down

0 comments on commit 78028d5

Please sign in to comment.