Remove serum-common dependency from cli (#1667)
This commit is contained in:
parent
d2233d6163
commit
811a4cb318
|
@ -27,12 +27,6 @@ version = "1.0.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
|
checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "ahash"
|
|
||||||
version = "0.4.7"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "739f4a8db6605981345c5654f3a85b056ce52f37a39d34da03f25bf2151ea16e"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ahash"
|
name = "ahash"
|
||||||
version = "0.7.6"
|
version = "0.7.6"
|
||||||
|
@ -174,7 +168,6 @@ dependencies = [
|
||||||
"semver 1.0.6",
|
"semver 1.0.6",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"serum-common",
|
|
||||||
"shellexpand",
|
"shellexpand",
|
||||||
"solana-cli-config",
|
"solana-cli-config",
|
||||||
"solana-client",
|
"solana-client",
|
||||||
|
@ -243,7 +236,7 @@ dependencies = [
|
||||||
"serum_dex",
|
"serum_dex",
|
||||||
"solana-program",
|
"solana-program",
|
||||||
"spl-associated-token-account",
|
"spl-associated-token-account",
|
||||||
"spl-token 3.2.0",
|
"spl-token",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -454,21 +447,8 @@ version = "0.9.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "15bf3650200d8bffa99015595e10f1fbd17de07abbc25bb067da79e769939bfa"
|
checksum = "15bf3650200d8bffa99015595e10f1fbd17de07abbc25bb067da79e769939bfa"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"borsh-derive 0.9.3",
|
"borsh-derive",
|
||||||
"hashbrown 0.11.2",
|
"hashbrown",
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "borsh-derive"
|
|
||||||
version = "0.8.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "307f3740906bac2c118a8122fe22681232b244f1369273e45f1156b45c43d2dd"
|
|
||||||
dependencies = [
|
|
||||||
"borsh-derive-internal 0.8.2",
|
|
||||||
"borsh-schema-derive-internal 0.8.2",
|
|
||||||
"proc-macro-crate 0.1.5",
|
|
||||||
"proc-macro2 1.0.36",
|
|
||||||
"syn 1.0.88",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -477,24 +457,13 @@ version = "0.9.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6441c552f230375d18e3cc377677914d2ca2b0d36e52129fe15450a2dce46775"
|
checksum = "6441c552f230375d18e3cc377677914d2ca2b0d36e52129fe15450a2dce46775"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"borsh-derive-internal 0.9.3",
|
"borsh-derive-internal",
|
||||||
"borsh-schema-derive-internal 0.9.3",
|
"borsh-schema-derive-internal",
|
||||||
"proc-macro-crate 0.1.5",
|
"proc-macro-crate 0.1.5",
|
||||||
"proc-macro2 1.0.36",
|
"proc-macro2 1.0.36",
|
||||||
"syn 1.0.88",
|
"syn 1.0.88",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "borsh-derive-internal"
|
|
||||||
version = "0.8.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "d2104c73179359431cc98e016998f2f23bc7a05bc53e79741bcba705f30047bc"
|
|
||||||
dependencies = [
|
|
||||||
"proc-macro2 1.0.36",
|
|
||||||
"quote 1.0.15",
|
|
||||||
"syn 1.0.88",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "borsh-derive-internal"
|
name = "borsh-derive-internal"
|
||||||
version = "0.9.3"
|
version = "0.9.3"
|
||||||
|
@ -506,17 +475,6 @@ dependencies = [
|
||||||
"syn 1.0.88",
|
"syn 1.0.88",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "borsh-schema-derive-internal"
|
|
||||||
version = "0.8.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "ae29eb8418fcd46f723f8691a2ac06857d31179d33d2f2d91eb13967de97c728"
|
|
||||||
dependencies = [
|
|
||||||
"proc-macro2 1.0.36",
|
|
||||||
"quote 1.0.15",
|
|
||||||
"syn 1.0.88",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "borsh-schema-derive-internal"
|
name = "borsh-schema-derive-internal"
|
||||||
version = "0.9.3"
|
version = "0.9.3"
|
||||||
|
@ -1486,22 +1444,13 @@ dependencies = [
|
||||||
"tracing",
|
"tracing",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "hashbrown"
|
|
||||||
version = "0.9.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04"
|
|
||||||
dependencies = [
|
|
||||||
"ahash 0.4.7",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hashbrown"
|
name = "hashbrown"
|
||||||
version = "0.11.2"
|
version = "0.11.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e"
|
checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ahash 0.7.6",
|
"ahash",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -1694,7 +1643,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "282a6247722caba404c065016bbfa522806e51714c34f5dfc3e4a3a46fcb4223"
|
checksum = "282a6247722caba404c065016bbfa522806e51714c34f5dfc3e4a3a46fcb4223"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"autocfg",
|
"autocfg",
|
||||||
"hashbrown 0.11.2",
|
"hashbrown",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -2870,35 +2819,6 @@ dependencies = [
|
||||||
"yaml-rust",
|
"yaml-rust",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "serum-borsh"
|
|
||||||
version = "0.8.1-serum.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "a4fed3f601b23f15dc890f6e52ffdbfe2dcf16418a41e0aa016b5f10cf30c892"
|
|
||||||
dependencies = [
|
|
||||||
"borsh-derive 0.8.2",
|
|
||||||
"hashbrown 0.9.1",
|
|
||||||
"solana-program",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "serum-common"
|
|
||||||
version = "0.1.0"
|
|
||||||
source = "git+https://github.com/project-serum/serum-dex#5b43fe1455470de59233e434f979082092ebb28d"
|
|
||||||
dependencies = [
|
|
||||||
"anyhow",
|
|
||||||
"arrayref",
|
|
||||||
"bincode",
|
|
||||||
"bs58 0.3.1",
|
|
||||||
"rand",
|
|
||||||
"serde",
|
|
||||||
"serde_json",
|
|
||||||
"serum-borsh",
|
|
||||||
"solana-client",
|
|
||||||
"solana-sdk",
|
|
||||||
"spl-token 2.0.8",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serum_dex"
|
name = "serum_dex"
|
||||||
version = "0.4.0"
|
version = "0.4.0"
|
||||||
|
@ -2916,7 +2836,7 @@ dependencies = [
|
||||||
"safe-transmute",
|
"safe-transmute",
|
||||||
"serde",
|
"serde",
|
||||||
"solana-program",
|
"solana-program",
|
||||||
"spl-token 3.2.0",
|
"spl-token",
|
||||||
"static_assertions",
|
"static_assertions",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"without-alloc",
|
"without-alloc",
|
||||||
|
@ -3034,7 +2954,7 @@ dependencies = [
|
||||||
"solana-config-program",
|
"solana-config-program",
|
||||||
"solana-sdk",
|
"solana-sdk",
|
||||||
"solana-vote-program",
|
"solana-vote-program",
|
||||||
"spl-token 3.2.0",
|
"spl-token",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"zstd",
|
"zstd",
|
||||||
]
|
]
|
||||||
|
@ -3300,7 +3220,7 @@ version = "1.8.14"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f3aaa73acee6e4ced74f607ef53b3bbac0b8598bff06c95c790e8068d9c5a948"
|
checksum = "f3aaa73acee6e4ced74f607ef53b3bbac0b8598bff06c95c790e8068d9c5a948"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ahash 0.7.6",
|
"ahash",
|
||||||
"bincode",
|
"bincode",
|
||||||
"caps",
|
"caps",
|
||||||
"curve25519-dalek 2.1.3",
|
"curve25519-dalek 2.1.3",
|
||||||
|
@ -3331,7 +3251,7 @@ dependencies = [
|
||||||
"bincode",
|
"bincode",
|
||||||
"blake3",
|
"blake3",
|
||||||
"borsh",
|
"borsh",
|
||||||
"borsh-derive 0.9.3",
|
"borsh-derive",
|
||||||
"bs58 0.3.1",
|
"bs58 0.3.1",
|
||||||
"bv",
|
"bv",
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
|
@ -3453,7 +3373,7 @@ dependencies = [
|
||||||
"base64 0.13.0",
|
"base64 0.13.0",
|
||||||
"bincode",
|
"bincode",
|
||||||
"borsh",
|
"borsh",
|
||||||
"borsh-derive 0.9.3",
|
"borsh-derive",
|
||||||
"bs58 0.4.0",
|
"bs58 0.4.0",
|
||||||
"bv",
|
"bv",
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
|
@ -3563,7 +3483,7 @@ dependencies = [
|
||||||
"solana-vote-program",
|
"solana-vote-program",
|
||||||
"spl-associated-token-account",
|
"spl-associated-token-account",
|
||||||
"spl-memo",
|
"spl-memo",
|
||||||
"spl-token 3.2.0",
|
"spl-token",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -3617,7 +3537,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "393e2240d521c3dd770806bff25c2c00d761ac962be106e14e22dd912007f428"
|
checksum = "393e2240d521c3dd770806bff25c2c00d761ac962be106e14e22dd912007f428"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"solana-program",
|
"solana-program",
|
||||||
"spl-token 3.2.0",
|
"spl-token",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -3629,21 +3549,6 @@ dependencies = [
|
||||||
"solana-program",
|
"solana-program",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "spl-token"
|
|
||||||
version = "2.0.8"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "eaa27ab75067c63b8804d9fff30bd2e8bfb5be448bea8067ed768381e70ca181"
|
|
||||||
dependencies = [
|
|
||||||
"arrayref",
|
|
||||||
"num-derive",
|
|
||||||
"num-traits",
|
|
||||||
"num_enum",
|
|
||||||
"remove_dir_all",
|
|
||||||
"solana-sdk",
|
|
||||||
"thiserror",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "spl-token"
|
name = "spl-token"
|
||||||
version = "3.2.0"
|
version = "3.2.0"
|
||||||
|
|
|
@ -29,7 +29,6 @@ solana-sdk = "~1.8.14"
|
||||||
solana-program = "~1.8.14"
|
solana-program = "~1.8.14"
|
||||||
solana-client = "~1.8.14"
|
solana-client = "~1.8.14"
|
||||||
solana-cli-config = "~1.8.14"
|
solana-cli-config = "~1.8.14"
|
||||||
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"
|
||||||
flate2 = "1.0.19"
|
flate2 = "1.0.19"
|
||||||
|
|
|
@ -732,4 +732,4 @@ impl AnchorPackage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
serum_common::home_path!(WalletPath, ".config/solana/id.json");
|
crate::home_path!(WalletPath, ".config/solana/id.json");
|
||||||
|
|
|
@ -44,6 +44,7 @@ use std::string::ToString;
|
||||||
use tar::Archive;
|
use tar::Archive;
|
||||||
|
|
||||||
pub mod config;
|
pub mod config;
|
||||||
|
mod path;
|
||||||
pub mod template;
|
pub mod template;
|
||||||
|
|
||||||
// Version of the docker image.
|
// Version of the docker image.
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
#[macro_export]
|
||||||
|
macro_rules! home_path {
|
||||||
|
($my_struct:ident, $path:literal) => {
|
||||||
|
#[derive(Clone, Debug)]
|
||||||
|
pub struct $my_struct(String);
|
||||||
|
|
||||||
|
impl Default for $my_struct {
|
||||||
|
fn default() -> Self {
|
||||||
|
match dirs::home_dir() {
|
||||||
|
None => {
|
||||||
|
println!("$HOME doesn't exist. This probably won't do what you want.");
|
||||||
|
$my_struct(".".to_string())
|
||||||
|
}
|
||||||
|
Some(mut path) => {
|
||||||
|
path.push($path);
|
||||||
|
$my_struct(path.as_path().display().to_string())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ToString for $my_struct {
|
||||||
|
fn to_string(&self) -> String {
|
||||||
|
self.0.clone()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl FromStr for $my_struct {
|
||||||
|
type Err = anyhow::Error;
|
||||||
|
|
||||||
|
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||||
|
Ok(Self(s.to_string()))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue