Prune ix and solana version pinning (#569)

This commit is contained in:
Armani Ferrante 2021-08-03 12:50:43 -07:00 committed by GitHub
parent 0ec5b377f8
commit 1bea1bcbfc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 19 additions and 14 deletions

View File

@ -23,9 +23,9 @@ serde_json = "1.0"
shellexpand = "2.1.0"
toml = "0.5.8"
serde = { version = "1.0.122", features = ["derive"] }
solana-sdk = "1.7.4"
solana-program = "1.7.4"
solana-client = "1.7.4"
solana-sdk = "=1.7.8"
solana-program = "=1.7.8"
solana-client = "=1.7.8"
serum-common = { git = "https://github.com/project-serum/serum-dex", features = ["client"] }
dirs = "3.0"
heck = "0.3.1"

View File

@ -6,7 +6,7 @@ ANCHOR_CLI=v$(shell awk -F ' = ' '$$1 ~ /version/ { gsub(/[\"]/, "", $$2); print
#
# Solana toolchain.
#
SOLANA_CLI=v1.7.4
SOLANA_CLI=v1.7.8
#
# Build version should match the Anchor cli version.
#

View File

@ -18,7 +18,7 @@ rustup component add rustfmt
See the solana [docs](https://docs.solana.com/cli/install-solana-cli-tools) for installation instructions. On macOS and Linux,
```bash
sh -c "$(curl -sSfL https://release.solana.com/v1.7.4/install)"
sh -c "$(curl -sSfL https://release.solana.com/v1.7.8/install)"
```
## Install Mocha

View File

@ -17,4 +17,4 @@ default = []
[dependencies]
anchor-lang = { path = "../../../../lang" }
anchor-spl = { path = "../../../../spl" }
solana-program = "1.7.4"
solana-program = "=1.7.8"

View File

@ -18,5 +18,5 @@ default = []
anchor-lang = { path = "../../../../lang" }
anchor-spl = { path = "../../../../spl" }
serum_dex = { path = "../../deps/serum-dex/dex", features = ["no-entrypoint"] }
solana-program = "1.7.4"
solana-program = "=1.7.8"
spl-token = { version = "3.1.1", features = ["no-entrypoint"] }

View File

@ -34,7 +34,7 @@ anchor-derive-accounts = { path = "./derive/accounts", version = "0.11.1" }
base64 = "0.13.0"
borsh = "0.9"
bytemuck = "1.4.0"
solana-program = "1.7.4"
solana-program = "=1.7.8"
thiserror = "1.0.20"
#

View File

@ -12,6 +12,6 @@ devnet = []
[dependencies]
anchor-lang = { path = "../lang", version = "0.11.1", features = ["derive"] }
lazy_static = "1.4.0"
serum_dex = { git = "https://github.com/project-serum/serum-dex", branch = "armani/auth", version = "0.3.1", features = ["no-entrypoint"] }
solana-program = "1.7.4"
serum_dex = { git = "https://github.com/project-serum/serum-dex", version = "0.3.1", features = ["no-entrypoint"] }
solana-program = "=1.7.8"
spl-token = { version = "3.1.1", features = ["no-entrypoint"] }

View File

@ -75,7 +75,7 @@ pub trait MarketMiddleware {
Ok(())
}
fn prune(&self, _ctx: &mut Context) -> ProgramResult {
fn prune(&self, _ctx: &mut Context, _limit: u16) -> ProgramResult {
Ok(())
}
@ -357,7 +357,7 @@ impl MarketMiddleware for OpenOrdersPda {
///
/// 0. Discriminant.
/// ..
fn prune(&self, ctx: &mut Context) -> ProgramResult {
fn prune(&self, ctx: &mut Context, _limit: u16) -> ProgramResult {
// Set owner of open orders to be itself.
ctx.accounts[5] = ctx.accounts[4].clone();
Ok(())
@ -396,6 +396,11 @@ impl MarketMiddleware for Logger {
msg!("proxying close open orders");
Ok(())
}
fn prune(&self, _ctx: &mut Context, limit: u16) -> ProgramResult {
msg!("proxying prune {:?}", limit);
Ok(())
}
}
/// Enforces referal fees being sent to the configured address.

View File

@ -95,10 +95,10 @@ impl<'a> MarketProxy<'a> {
mw.close_open_orders(&mut ctx)?;
}
}
Some(MarketInstruction::Prune) => {
Some(MarketInstruction::Prune(limit)) => {
require!(ctx.accounts.len() >= 7, ErrorCode::NotEnoughAccounts);
for mw in &self.middlewares {
mw.prune(&mut ctx)?;
mw.prune(&mut ctx, limit)?;
}
}
_ => {