Prune ix and solana version pinning (#569)
This commit is contained in:
parent
0ec5b377f8
commit
1bea1bcbfc
|
@ -23,9 +23,9 @@ serde_json = "1.0"
|
||||||
shellexpand = "2.1.0"
|
shellexpand = "2.1.0"
|
||||||
toml = "0.5.8"
|
toml = "0.5.8"
|
||||||
serde = { version = "1.0.122", features = ["derive"] }
|
serde = { version = "1.0.122", features = ["derive"] }
|
||||||
solana-sdk = "1.7.4"
|
solana-sdk = "=1.7.8"
|
||||||
solana-program = "1.7.4"
|
solana-program = "=1.7.8"
|
||||||
solana-client = "1.7.4"
|
solana-client = "=1.7.8"
|
||||||
serum-common = { git = "https://github.com/project-serum/serum-dex", features = ["client"] }
|
serum-common = { git = "https://github.com/project-serum/serum-dex", features = ["client"] }
|
||||||
dirs = "3.0"
|
dirs = "3.0"
|
||||||
heck = "0.3.1"
|
heck = "0.3.1"
|
||||||
|
|
|
@ -6,7 +6,7 @@ ANCHOR_CLI=v$(shell awk -F ' = ' '$$1 ~ /version/ { gsub(/[\"]/, "", $$2); print
|
||||||
#
|
#
|
||||||
# Solana toolchain.
|
# Solana toolchain.
|
||||||
#
|
#
|
||||||
SOLANA_CLI=v1.7.4
|
SOLANA_CLI=v1.7.8
|
||||||
#
|
#
|
||||||
# Build version should match the Anchor cli version.
|
# Build version should match the Anchor cli version.
|
||||||
#
|
#
|
||||||
|
|
|
@ -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,
|
See the solana [docs](https://docs.solana.com/cli/install-solana-cli-tools) for installation instructions. On macOS and Linux,
|
||||||
|
|
||||||
```bash
|
```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
|
## Install Mocha
|
||||||
|
|
|
@ -17,4 +17,4 @@ default = []
|
||||||
[dependencies]
|
[dependencies]
|
||||||
anchor-lang = { path = "../../../../lang" }
|
anchor-lang = { path = "../../../../lang" }
|
||||||
anchor-spl = { path = "../../../../spl" }
|
anchor-spl = { path = "../../../../spl" }
|
||||||
solana-program = "1.7.4"
|
solana-program = "=1.7.8"
|
||||||
|
|
|
@ -18,5 +18,5 @@ default = []
|
||||||
anchor-lang = { path = "../../../../lang" }
|
anchor-lang = { path = "../../../../lang" }
|
||||||
anchor-spl = { path = "../../../../spl" }
|
anchor-spl = { path = "../../../../spl" }
|
||||||
serum_dex = { path = "../../deps/serum-dex/dex", features = ["no-entrypoint"] }
|
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"] }
|
spl-token = { version = "3.1.1", features = ["no-entrypoint"] }
|
||||||
|
|
|
@ -34,7 +34,7 @@ anchor-derive-accounts = { path = "./derive/accounts", version = "0.11.1" }
|
||||||
base64 = "0.13.0"
|
base64 = "0.13.0"
|
||||||
borsh = "0.9"
|
borsh = "0.9"
|
||||||
bytemuck = "1.4.0"
|
bytemuck = "1.4.0"
|
||||||
solana-program = "1.7.4"
|
solana-program = "=1.7.8"
|
||||||
thiserror = "1.0.20"
|
thiserror = "1.0.20"
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
@ -12,6 +12,6 @@ devnet = []
|
||||||
[dependencies]
|
[dependencies]
|
||||||
anchor-lang = { path = "../lang", version = "0.11.1", features = ["derive"] }
|
anchor-lang = { path = "../lang", version = "0.11.1", features = ["derive"] }
|
||||||
lazy_static = "1.4.0"
|
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"] }
|
serum_dex = { git = "https://github.com/project-serum/serum-dex", version = "0.3.1", features = ["no-entrypoint"] }
|
||||||
solana-program = "1.7.4"
|
solana-program = "=1.7.8"
|
||||||
spl-token = { version = "3.1.1", features = ["no-entrypoint"] }
|
spl-token = { version = "3.1.1", features = ["no-entrypoint"] }
|
||||||
|
|
|
@ -75,7 +75,7 @@ pub trait MarketMiddleware {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn prune(&self, _ctx: &mut Context) -> ProgramResult {
|
fn prune(&self, _ctx: &mut Context, _limit: u16) -> ProgramResult {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -357,7 +357,7 @@ impl MarketMiddleware for OpenOrdersPda {
|
||||||
///
|
///
|
||||||
/// 0. Discriminant.
|
/// 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.
|
// Set owner of open orders to be itself.
|
||||||
ctx.accounts[5] = ctx.accounts[4].clone();
|
ctx.accounts[5] = ctx.accounts[4].clone();
|
||||||
Ok(())
|
Ok(())
|
||||||
|
@ -396,6 +396,11 @@ impl MarketMiddleware for Logger {
|
||||||
msg!("proxying close open orders");
|
msg!("proxying close open orders");
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn prune(&self, _ctx: &mut Context, limit: u16) -> ProgramResult {
|
||||||
|
msg!("proxying prune {:?}", limit);
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Enforces referal fees being sent to the configured address.
|
/// Enforces referal fees being sent to the configured address.
|
||||||
|
|
|
@ -95,10 +95,10 @@ impl<'a> MarketProxy<'a> {
|
||||||
mw.close_open_orders(&mut ctx)?;
|
mw.close_open_orders(&mut ctx)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Some(MarketInstruction::Prune) => {
|
Some(MarketInstruction::Prune(limit)) => {
|
||||||
require!(ctx.accounts.len() >= 7, ErrorCode::NotEnoughAccounts);
|
require!(ctx.accounts.len() >= 7, ErrorCode::NotEnoughAccounts);
|
||||||
for mw in &self.middlewares {
|
for mw in &self.middlewares {
|
||||||
mw.prune(&mut ctx)?;
|
mw.prune(&mut ctx, limit)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
|
|
Loading…
Reference in New Issue